Autofixers in precommit are stupid because they break a fundamental rule of version control: “What you get out of it must be what you put into it” (as coined by Linus). I’ll push this idea in a new direction and say if you use an autofixer in precommit, the VCS (Version Control …
I had to teach someone about debugging today, thought I’d share my thoughts here too. What is debugging? First and foremost, debugging is fixing your b…
Don’t do: text = text.split(delimiter) Instead do: const a = text.split(delimiter) That way at the end of the program you can add console.log({a, text}…
You’re supposed to fix That Bug. That’s it. But the code is so ugly. Oh my gosh no wonder they wrote a bug here. I should tidy up. I’ll fix the “broken…
I got a lot of flack on my last post for suggesting piping to ls a la: ls | grep file Why? Because...
Just Use Sed
If you have a list, say of imports, where there is no semantic meaning in the ordering, alphabetize it. Alphabetizing makes it easier to find duplicate…
There’s no reason to leave code commented when checking it in, just delete it. It’s one of the most common pieces of feedback I give while reviewing co…
See all