by nwallin · 5y ago · 0 comments
When I write code for personal projects I don't even bother trying to format it correctly. The only whitespace button I use is the spacebar. tab is mapped to the function that reformats the entire document according to the formatting rules I've configured.
At work, whenever I apply a change in a function I will autoformat that function whenever. I can't just format the entire file, but formatting errors are rife in the codebase I work on.
goto fail; is real.
I don't want to be too cynical about the article, since these are absolutely all good things to know due to their myriad uses in other circumstances. But if your intention is to apply these to code you're writing, as the article describes, I don't think any of them are practical if you're already using an IDE/IDE-lite. (It probably makes a lot more sense if the author is using a lighter editor like vim without a lot of plugins, though.)
One thing I just can't live without, however, is a code formatter. Formatting code by hand is tedious and repetitive and I have no patience for it.
gg=G in vim is fast enough to type for me, though.
So i can just write, save the file and everything is nice :)
Huh. you know...