3 ms·
When hiring we ask for sample code from developers written specifically for the job application. We place a really high premium on readability. Occasionally we'
by mmaunder 10y ago
When hiring we ask for sample code from developers written specifically for the job application. We place a really high premium on readability. Occasionally we'll get code from devs that is very concise - not just abbreviated variable names, but complex long statements using ternary etc.
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.
- component 10y agoWhenever we interview a candidate, the one thing we give high premium on is structure, the rest come next. 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.
- Roboprog 10y ago"I ran the code through minify, but it's bigger now?!?"
- component 10y agoI don't understand. 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.
- Roboprog 10y agoI was joking. The example sort of looks like something that would fall out of minify -- although 'a' - 'z' would have to be used/visible in a scope before 'aa' would be generated as a name.
- component 10y agoI should have clarified. The coder style of naming might seem to be run through minifier, but the coder actually wrote 'a', 'aa', 'aaa'... My guess is that the coder saw a minified code a took it as a standard or something.
- Roboprog 10y agoAnd that was the joke: that the original code "out-minified" minify - that running the original gibberish through minify would NOT make it any smaller :-)
- notacoward 10y ago> Whenever we interview a candidate, the one thing we give high premium on is structure 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.
- knocte 10y agoI'm sorry, how can verbose code impact performance???? Please elaborate.
- erlehmann_ 10y agoIn shell scripts, for example, accessing a longer variable takes longer time than accessing a shorter variable. In my testing, accessing a 100 character variable took around 20% longer than accessing a 1 character variable.
- adimitrov 10y agoIt depends on whether The Compiler is Smart Enough™ — verbose code, for example, declares variables for values before using them in expressions. 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.
- new_hackers 10y agoThe older I get, the less I value "cleverness" in programmers. I used to delight in writing code golf one-liners. But now I realize it detracts from solving the hard problems, and it makes simple problems harder.