Use etc-keeper, saves everything in a git repo and integrates with a bunch of package managers. Been using it for decades it feels like now.
Use etc-keeper, saves everything in a git repo and integrates with a bunch of package managers. Been using it for decades it feels like now.
“What one programmer can do in one month, two programmers can do in two months.”
Shake and bake in full effect.
Learn to use git bisect
. If you have unit tests, which of course you should, it can save you so much time finding weird breakages.
The code in the image is C or C++ or similar. In those languages and languages derived from them, curly braces are optional but the parentheses are required. It should be the other way around to avoid logic errors like this:
if (some expression)
doSomething()
else if (some other expression)
printf(“some debugging code that’s only here temporarily”);
doSomethingElse();
Based on the indentation you’d think that doSomethingElse
was only meant to run if the else if
condition was true, but because of the lack of braces and the printf
it actually happens regardless of either of the if
conditions. This can sometimes lead to logic errors and it doesn’t hold up to a principle of durability under edit — that is, inserting some code into the if
statement changes the outcome entirely because it changes the code path entirely, so the code is in a sense fragile to edits. If the curly braces were required instead of optional, this wouldn’t happen.
I have all of my linters set up to flag a lack of curly braces in these languages as an error because of this. It’s a topic that sometimes causes some debate, ‘cause some people will vociferously defend their right to not have the braces there for one liners and more compact code, but I have found that in general having them be required consistently has led to fewer issues than having arguments about their absence, but to each their own. I know many big projects that have the opposite stance or have other guidelines, but I just make ‘em required on my own projects or projects that I’m in charge of and be done with it.
I also sometimes wish that the syntax in if
statements was inverted, where ()
was optional and {}
was required.
Linus wrote git to be used via email as part of its core design, so that was just the way he rolled back then. GitHub and Gitlab and all the cloud platforms and tooling came afterwards and it took time to reach a critical mass, and even then, some folks stick to what they’re used to.
Looking at Linus’ GitHub profile, looks like not much has changed — 100% commits, 0% everything else.
Also not Linus from the Peanuts comic.
Bought a new computer, threw the old one out.