Hacker News new | past | comments | ask | show | jobs | submit login

I like the point in general, but I will say there are times when idiosyncratic formatting can really help understanding "this particular bit of code". Often it has to do with aligning values so that they are easier to read; if a code formatter was smart enough to at least understand the signal the programmer is sending, and maintain (or even improve!) that kind of formatter, it would be the best of all worlds.

One simple example is when you're parsing text and you have a long list of simple one-line if statements. I personally think it's wasteful and harder to read that block of code if you impose curly braces and new lines on that list of conditionals. This kind of formatting convention has been around for at least 40 years, and it makes the code more readable. I have yet to see an auto-formatter that doesn't turn that kind of code section into an unreadable mess.




Or key value lists where the keys have slightly different lengths.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: