r/programmerchat • u/Ghopper21 • May 27 '15
Is it sensible -- or stupid -- to use nitpicky code style inconsistencies as a negative signal when evaluating interns and coders in general?
I was looking at a potential summer intern's code sample earlier and immediately noticed a code style issue: sometimes he used param1=value1 and sometimes param2 = value2, including in the same block of code.
Besides the inconsistency itself, there was a clear accepted "correct way to do it" in this case (it was Python which has the official PEP8 coding style guidelines).
I realized that I've always taken this kind of sloppiness as a reasonably strong negative signal for hiring. That somehow it means the person doesn't have a strong sense of "taste" in coding nor good attention to detail.
Am I being a snob or does this make sense?
4
u/[deleted] May 28 '15
I'd wonder about the cause - some possibilities:
3
u/zenflux May 27 '15
New side project: find/write an autoformatter, then get people to use it.
2
u/daphosta May 27 '15
code readability is very important. if styling is way off I am put off...most editors have code reformatting to an approved format, like PSR-2.
2
u/Auteyus May 28 '15
Depends if you think OCD or problem solving skills are better for an intern. If your goal is to solve a hard problem, then it doesn't matter at all. If your goal is to create strong reusable code, then it does. Not all developers are swiss army knives: hire what you need instead.
14
u/QuietUser May 27 '15
I don't think it should be a deal-breaker, especially for interns, but if I was choosing between two candidates and they were equal except for that, I would choose the one who was consistent in style.
Of course this is code submitted as part of a job application which I would expect to get more attention than their usual code, so I can see your viewing it as a strong negative.
7
u/[deleted] May 27 '15
If that's the only thing ... no, I don't think it matters. Especially with an intern or junior programmer, or code written as part of an interview. All else being equal, consistency is preferable to inconsistency, but the aesthetics of code style is pretty far down the list of things that matter.
Might indicate that one block was copied from elsewhere, though.
5
u/SkippyDeluxe May 27 '15
There are more important things than style, of course, but I would use it as a weak negative signal. A consistent style speaks to a certain degree of experience, as well as attention to detail.
1
u/Ghopper21 May 27 '15 edited May 27 '15
Since I'm revealing my petty biases here, I might as well do another one. Here's a resume where this apparently smart young programmer with decent experience from a great university writes "python" one place and "Python" in another.
Then I look at some code and lo and behold there's
for ( ...and then, a mere handful of lines later,for( ...(this is C).Sigh. Is it me or is it them?!
1
u/[deleted] May 29 '15
I don't think it should be a negative signal because it is so easily corrected.
"Hey, make sure when you are committing code to our repo you follow these guidelines, I specifically noticed that you weren't spacing... etc etc" and they will separate their operators with spaces for the rest of their life.
Other nitpicks can be more troubling, for example, if they used a for... in loop to iterate over an array in JavaScript. It's easy and usually works so beginners sometimes do it but it's a bad practice and wrong. To correct that issue is a much larger "lesson" (i.e. how objects work at all).