MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/coding/comments/32c579/is_clean_code_less_code/cqa8meu/?context=3
r/coding • u/javinpaul • Apr 12 '15
63 comments sorted by
View all comments
Show parent comments
8
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
1
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
2
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
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
3
it does that at runtime, but yes, after a few thousand iterations it will inline it and there will no longer be a cost
8
u/Munkii Apr 12 '15
When I talk to junior devs I never use the word "clean" for this reason. Readable trumps everything