4 ms·
Interesting that you write "any programmer worth their salt" has to have the aid of "sublime text style search". Having had to maintain and rebuild other progr
by oldandtired 9y ago
Interesting that you write "any programmer worth their salt" has to have the aid of "sublime text style search".
Having had to maintain and rebuild other programmers' monstrosities of monolithic functions, I appreciate short code routines and relevant comments, especially those that detail why the code is written that way. I then don't have to spend enormous amounts of time trying to understand the thought processes that went into making that code.
If you are worth your "salt", you will write clear code and when it needs to be "tricky", you detail "the why" that you needed to do this.
Different people have different standards as to what is clear code and often, this is dependent on the idiomatic usage within the language in question.
A real simple example for you to ponder:
if a < b & b < c & c < d & d <= e then { do something}
compare with
if a < b < c < d <= e then { do something }
In this particular case, the first is how many programmers would write the condition, whereas the second is idiomatically more correct. The second is also, in this instance directly self documenting.
Of course, how you will do this in your favourite language will be different.
- deleted 9y ago[deleted]