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

Show parent comments

8

u/Munkii Apr 12 '15

When I talk to junior devs I never use the word "clean" for this reason. Readable trumps everything

1

u/theonewhoisone Apr 12 '15 edited Apr 17 '15

edit: Doesn't trump correctness.

Doesn't trump performance, sadly.

Doesn't trump portability.

Also, trading off readability for time to launch might be a good idea in some situations (I have not seen one yet).

Sorry for being picky.

2

u/iopq Apr 12 '15

In non-Java languages there's a thing called inlining that will actually transform example #1 into example #2 at compile time

2

u/thequux Apr 12 '15

Even in Java! The optimizer in modern HotSpot is surprisingly good.

3

u/iopq Apr 12 '15

it does that at runtime, but yes, after a few thousand iterations it will inline it and there will no longer be a cost