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

> But I've never seen any organization actually do that.

You haven't looked very far! Most open source projects these days enforce code style through some forms of tooling.

But saying that "Any coding standard that relies on humans to do something right is going to fail" is basically giving up and saying "do whatever". I mean, why even ask people to indent consistently if it's doomed to fail? It's a mixed indent party for everybody!




> You haven't looked very far! Most open source projects these days enforce code style through some forms of tooling.

Sure, but I've never seen a tool that was able to enforce that no-one was doing alignment.

> But saying that "Any coding standard that relies on humans to do something right is going to fail" is basically giving up and saying "do whatever".

Coding standards that you can implement in your enforcement tool are fine. But any rule you can't automate is not worth bothering with, IMO.

> I mean, why even ask people to indent consistently if it's doomed to fail? It's a mixed indent party for everybody!

Use a language that enforces indentation, or use a tool to autoindent. Trying to get people to indent consistently by hand is a waste of time.


clang-format, Uncrustify, YAPF, and RuboCop all have options to control alignment.




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

Search: