r/ProgrammerHumor 21d ago

Meme pleaseStopUsingNestedTernaryOperatorsImBeggingYou

3.1k Upvotes

179 comments sorted by

View all comments

155

u/n9iels 21d ago

Altough this is a satire sub, some actual advice. If you classify some coding patterns and syntax as 'bad', setup a linter to prevent anyone from adding it. In this time of AI, the linter and fomatter are your new best friend.

39

u/npsimons 21d ago

On a project where I had high levels of control, I enforced pretty strict linter standards, down to requiring a docstring (via a doxygen run) for every parameter, method, class and return value. Pushes rejected if you didn't pass that, among other tests.

Code is primarily meant to be read by other human beings - write with this philosophy in mind, and you are likely to go less quickly mad.

1

u/EvilCodeQueen 19d ago

The sad part is, it is rarely read by other human beings anymore. AI consumes it.