by mmaunder · 10y ago · 0 comments
I'll usually ask them to resubmit code and really focus on readability and it turns out fine. But I think there might be a misconception among devs where the thought is that really compact code shows talent.
Our ideal coder is someone who cares deeply about performance and where the code is ridiculously easy to read and trace through. I mention performance, because in some situations making things more verbose can affect that.
bad variable names, long complex code...can easily be adjusted. If the candidate doesn't have a good understanding of how to structure a code (what goes where, for what purpose, separation on concern...), it'll take much more effort to teach that candidate than to teach the bad variable namer.
Properly structured code naturally leads to a better performing software, even if/when a bug arises it'll be easier to spot / test.
All that being said, if a coder names a variables, 'a', 'aa', 'aaa', 'aaaa' that's a serious red flag.
Yeah, because amorphous programmers are often unpleasant to work with.
Sorry, I knew what you meant, but the image of a jellyfish in a chair was to good to pass up.
Why would one submit a minified code for a review?
A friend of mine used to work at a place where one of the coder actually used 'a', 'aa', 'aaa'...when naming variables.
So instead of
if (long.and(Complex(Expression)) && (other || long && expressions)
You use mandatoryConditional = long.and(Complex(Expression))
optionalConditional = other
otherOptional = complex && expressions
if (mandatoryConditional && (optionalConditional || otherOptional)
Now you have more names hanging around, and longer code, but it's better to read, especially if these conditional variables are named properly. Some people fear that this could negatively impact execution time, but I don't think it will have any noticable impact in modern languages.Another problem could occur where people verbosely allocate things, pre-computing and re-computing aggregate data structures, and a one-liner would've been more efficient since it goes over the same data only once.