Thanks for the pointer - I had read about it, but hadn't put two and two together. The kinds of things I work on (cacheable wesbites) don't need to be highly tuned for back-end performance, so I guess it's easier for me to do that.
That’s horrible because the git commit messages are easily lost, disconnected or hard to find in any reasonably active codebase. For example as soon as you do a change and move a file it almost always disconnects from the previous change history.
Whats even more difficult is searching through a code base when the documentation isn’t in or near the code. I don’t know any IDE or editor that makes it easy to search though git commit message and source code at the same time.
On top of that, do you review git commit message in code review? Do you aks people to improve descriptions, typos and language in commit messages?
I don't understand how they are hard to find. It's trivial to find where the file was moved from.
What I truly care about is why something is the way it is, what is the rationale behind it, how it works with other parts of the codebase, what problems it solves, what is tricky about it, what to pay attention to and so on. I don't care at all about the code that was written and an explanation to it because this I can read myself in the code. The best place I've found for this is a code commit because it can tie different parts of the codebase together and add a lot of context to a change. I commit heavily and don't squash. A long comment in a commit that contains all file changes related to a certain feature, bug or whatever adds a lot more information than a comment in one file. When other people do it, it helps me a lot more than chasing their (outdated) code comments throughout the codebase.
But if that doesn't work for you, then don't do it. Just don't be dogmatic and dismissive. I accept there might be situations and codebases where this doesn't work.
I'm lost. Are you talking about meta-level comments, like "here's why this change is being made", that aren't directly tied to any particular line of code? If so, certainly putting that stuff in commits makes sense.
But for regular "explanatory note about this variable/function/etc" comments, how does one work if those things are in commit logs? If you're reading code and something is unclear, do you look back through the commit messages of every commit that's ever touched that line, just in case one of them has something relevant?
IDEs can show commit history. But you're right that it can get messy tracing back to the original commit when a file has been changed many times.
But for the most part I feel like comments should be automated tests. If a line is there for an edge case it should have a matching test for that edge case.
The only exceptions I see are for performance optimizations or some other situation where you can't easily test.
How you check the commit history is beside the point - the question is, do you read the entire commit log history for a chunk of code before editing it?
If not, any comments there might as well not exist - functionally speaking you're maintaining an uncommented codebase.
Your comments applies very little to commit messages, and much more so to comments.
> That’s horrible because the git commit messages are easily lost, disconnected or hard to find in any reasonably active codebase. For example as soon as you do a change and move a file it almost always disconnects from the previous change history.
Learn your tools or get better ones, `git log --follow` has no issues with renames, and when files get munged in ways it can't handle (e.g. content is split out or merged) it's easy enough to stitch back, and good annotate UIs (Jetbrain's is stellar and one of the few things I don't use magit for) make flitting through a snippet's history trivial.
Meanwhile finding removed comments is nearly impossible (VCS are nowhere near as good for finding when was removed than when it was added), and comments can easily drift apart from their point of origin as developers aren't too careful about maintaining them when adding unrelated comments.
> On top of that, do you review git commit message in code review? Do you aks people to improve descriptions, typos and language in commit messages?
Can second that. Having the commit message as a virtual comment on the end of the current line is immensely helpful in tracking changes. It’s like git blame on steroids.
> On top of that, do you review git commit message in code review? Do you aks people to improve descriptions, typos and language in commit messages?
Absolutely I do. The commit message is part of the commit just like the code; why would it be excluded from review? The number of times that a good commit message has helped me when dealing with a bug, and that a poor one has stymied me, have firmly convinced me that they are just as important as any other project documentation. They should be clear and informative, and I ask for those aspects to be improved when needed.
Not sure I agree with you. It’sa minimal product. It’s still something you can carry forward, improve on, and enhance.
Seems wasteful to build something only to scrap it once people say they want it.
I’m right now testing out demand for a headless CMS @ https://moogle.cc/nirvaancms.html and I’m not planning to redo the entire tech stack if there seems to be demand for such a product.
> Seems wasteful to build something only to scrap it once people say they want it.
It can be. But you probably shouldn't build a product to test whether people in your chosen market say they want it, or to find out whether buyers or sellers are hardest to acquire to bootstrap a two-sided market, when you can probably validate that with some landing pages or user interviews.
If you need to test whether people will use it after buying (or perhaps which users will use it after buying, or how many users will keep using it and paying for it), you probably need to build something, but it may only need to be implemented using manual processes behind the scenes.
If you need to test whether you can serve the customer at scale for less than your cost to acquire them, that is a different sort of MVP.
In any case, there are definitely MVPs that can and should be scrapped when you are done using them to validate (or invalidate) whichever proposition is then your biggest source of risk.
Keep in mind that should you invalidate the hypothesis being tested, you may need to scrap the MVP anyway when you pivot away from that particular hypothesis. And, some of your hypotheses will be invalidated, so making sure you don't run out of resources for testing new ones is kind of important.
Compared to other package managers: You could use Nix to install packages, in the same way you would with other package managers. An advantage to this is you'll get the same version of the package regardless of which distribution you use. (Whereas with, say, Ubuntu you might need to add a PPA to get versions as bleeding-edge as what Arch would offer).
Nix's tooling is also broader in scope:
e.g. with nix-shell, you can have a shell which has a Go-lang compiler (or whatever) in that shell, but without needing the Go-lang compiler installed on the computer. This is comparable to e.g. asdf, or to running your toolchain in a Docker container (like what VSCode Remote Containers offers). -- i.e. Nix can be useful for development.
NixOS takes the same Nix declarative language, and allows describing the configuration of the whole OS setup with it. Just as Terraform declares an orchestration of cloud infrastructure, NixOS allows declaring how the OS is setup. (Here, Nix is comparable to e.g. cloud-init or Ansible). -- i.e. Nix can be useful for deployment.
Nix as a package manager is a subset of a broader concept of a graph database of reproducible build instructions that explicitly track every dependency of your project, and a set of tools that allow you to build and cache said dependencies in an isolated, distributed (parallel), and transparent way. Add filesystem- / path-sandboxing to the equation and you'll get a set of features that make Nix different to other conventional package managers.
Can you really trust those average 3 engineers you work with to build any sort of complex piece of software more reliably just to get started with the project you're actually building?
SOLID[0] is always somewhere to start if you really have no idea where to begin understanding what makes code more maintainable. There are plenty of books out there, but those can be a minefield in terms of knowing which ones to really commit energy to learning. The only real answer that I know of here is personal experience though.