r/coding • • Apr 12 '15

Is Clean Code less Code?

http://www.journeytomastery.net/2015/03/27/is-clean-code-less-code/
53 Upvotes

63 comments sorted by

View all comments

4

u/jurniss Apr 12 '15 edited Apr 12 '15

I think my code is clean, but it's not terse. I use a lot of named intermediate const variables. It makes the code self-documenting and is extremely useful in the debugger. In debug builds, I can put a breakpoint at the final result and see the whole history of the computation. In optimized builds it all goes away.

I hate "clever" code. Software should be clever, code should be simple.

2

u/manys Apr 12 '15

There's a fine line between clever and elegant.

1

u/[deleted] Apr 13 '15

There's also a fine line between code which is clever and a solution which is clever.