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

> It sucks to spend code review making humans spend time

For some humans, they don't have to be "made" to do it. They love squabbling over style issues and rearranging deck chairs. I will never, ever understand caring about style issues, so auto-formatters are a gift from the heavens. Now the guy that used to waste time in code review can waste time tweaking the formatter rules, and everyone else can move on with their life.




> Now the guy that used to waste time in code review can waste time tweaking the formatter rules, and everyone else can move on with their life.

Had worked with one such person before, unfortunately after introducing formatters he found a new thing to be pedantic about and started annoying everyone with that instead (it was C++ and his second obsession was ensuring that all objects are always moved correctly and no CPU cycle is being wasted while our enterprise app is waiting on the network to resolve tons of API calls).


C++ for high-level code tends to be this way. Waste tons of focus on saving a couple of CPU cycles, but the whole thing is waiting on RPCs anyway.

Also you probably used less efficient algorithms because the smarter ones were too annoying to implement in C++, and there's possibly a solid Python lib that does it with hyper optimized C code anyway.


Yeah I agree. The language lives in a weird niche where both intricate low-level details are visible, but also supports abstractions only visible from outer space.

You always have some low-level detail which can be nitpicked about, even though it does not matter in the slightest.

Admittedly, choosing C++ for such a high-level project wasn't a good idea at all, but that is what the first few devs knew best and sticked with it.


Oh and those measures that save 2 extra CPU cycles do things in a way more error-prone way, which some day causes memory corruption.


... which you spend more CPU cycles than you ever saved trying to debug it


I care about style. If I’m reading the same code day in and day out I want it to look nice. Not nice code is a distraction, maybe it’s an OCD or a ‘visual misophonia’, but inconsistency is one of the first things I notice. I truly don’t understand why some people don’t care how their code looks.

I have noticed that some people will present tidy code during interviews and amazingly drop that habit once they’re employed.


It's not only about it looking 'nice' (although there's that component as well as an added bonus).

Once you've read tons of code formatted with the same formatter, passing the same linter rules and following the same general idiomatic rules, it becomes so much easier to read and review new code that adheres to all the same rules.


This is definitely true. Your eyes tell you that something's off long before your brain figures out what it is.


I passed the style test at work then instantly stopped following any of the rules. My teammates who also don't care approve the changes. We deal with lots of bugs each day, and none of them have ever been because things like using `auto` in C++ when we shouldn't have. There are far better things to spend time on.

And if someone does care about something in particular, often they will contribute to an auto-cleanup tool that makes it a certain way. So there was no reason for me to do it manually.


Which came first, the bugs or the nonchalance!


The bugs of course


Problem is even with auto-formatters, people will squabble over pointless stuff. I just do whatever comes naturally and assume someone is going to want it a certain other way, then I change it without arguing. That goes for designs too.




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

Search: