top | item 37809479

(no title)

tremere | 2 years ago

I don't know if I necessarily agree, especially with D = decoupling. However I do like the idea of dead simple code. Often I'll find code written by self styled haxors who omit curly braces and nest ternary operators because they can. That's great but it ends up biting you in the ass.

The code itself should be treated internally like part of the product and it should be easily extensible, of uniform style, and written so safely that if a child added a line to the code it wouldn't break it entirely.

This is especially true of languages that support macros. If inclusion or modification of macros in your code cannot be done, it is probably a bad sign. When writing code to be resistant to hardware attacks for instance there is a different style that must be adopted entirely, if everyone is writing the fanciest for-loops fathomable then it becomes inefficient and a risk to code correctness to mutate the code to resist classes of attacks. This is terrible and not worth it just because an elite haxor wanted to write a for loop in a single line.

discuss

order

smolder|2 years ago

> Often I'll find code written by self styled haxors who omit curly braces and nest ternary operators because they can. That's great but it ends up biting you in the ass.

I've worked on codebases where omitting curly braces for single line IF was the style, but can't recall ever being 'bitten in the ass' by that particular style choice. I can see how when combined with other questionable style choices it could yield some very ugly and error prone code, but by itself I really have trouble understanding why people object to it.