3 ms·
Naming things is probably the most important part of programming. If you’re struggling to give a function a good name it probably means that it’s the wrong leve
by wefarrell 4y ago
Naming things is probably the most important part of programming. If you’re struggling to give a function a good name it probably means that it’s the wrong level of abstraction. For example if you find yourself naming a function something like “submitAndParseResult” that’s probably an indication that it should be broken up into two functions.
I used to give a code refactoring exercise as a part of my interview process and I remember one candidate spent most of the exercise just naming the variables and breaking sections of the code into separate functions that didn’t actually improve the performance but made it much more readable. I hired him on the spot.
- poulsbohemian 4y ago>I used to give a code refactoring exercise as a part of my interview process I really like this - smart way to get a dialog between yourself and the candidate over something tangible. Great way to see if you can work together, can communicate effectively together, plus gets in their head about how they will approach work.
- wefarrell 4y agoThanks! I like refactoring exercises because they tend to select for real world experience over classes/studying. And when I think about the most difficult technical problems I’ve worked on it’s never been about selecting the right algorithm or data structure, it’s always involved making legacy code adapt to new requirements when the previous developer is no longer around and the requirements weren’t properly documented.
- poulsbohemian 4y agoI'd agree with this, and it's one of the beefs I have with how we tend to do interviews. When I think too about more involved problems I've worked on, there have been times I've had to consider several different data types or algorithms, and potentially build a prototype and refine it. This "instant gratification" we demand of interviewees to churn out some algorithm or data type in an interview isn't really helpful relative to seeing how they actually think.