5 ms·
there's nothing 'current' about BFS. It hasn't changed. You'll never write one to meet a real, work-related need. It's just a memory test that puts recent grads
by ljw1001 11y ago
there's nothing 'current' about BFS. It hasn't changed. You'll never write one to meet a real, work-related need. It's just a memory test that puts recent grads at an advantage.
- bnastic 11y agoYes, people will write them; the fact that you do not means nothing. Software field is large, do not project your experience onto the rest of the industry.
- ljw1001 10y agoOk, people will write them, but very few people should write them. Also, the question is, is the ability to write a BFS on a whiteboard a useful way to screen programming candidates for most positions. No it is not.
- bnastic 10y agoTree traversal is such a basic algo that anyone who's done any amount of programming shouldn't have trouble working out how to do it, depth- or breadth-first, even if they haven't done that before. If a potential candidate can't figure that out, even in a simple pseudo-code, and even with guidance from an interviewer, I can't imagine ever hiring that person. Next to arrays and lists, trees are such fundamental part of computer programming that I can't find an excuse for not being aware of some basic operations. I am not suggesting here that the RB or AVL trees and all the tricky stuff about them should be your bed time reading, but a certain baseline should be established.
- p4wnc6 10y agoMany highly skilled and experienced programmers would struggle with this kind of thing in a whiteboard interview, but then if hired would be very good at the job. The interview scenario is just not similar to on-the-job coding. It has different social pressures, time pressures, access to help, access to privacy, etc. etc. Plus, for someone like me (I studied machine learning and stats, and all data structure knowledge is self-taught post college, yet I have 6 years experience writing scientific code, performant database stuff, etc.) I am always hearing about data structures and algorithms that are supposedly "fundamental" but I never even heard of them before and have yet to need them in a job. Basically, all of my experience, and all of the experience of hiring software developers in any of the companies I've been in just completely suggests what you're saying is actually not true. It's just a story we tell to allow us to keep our crab mentality hazing rituals.
- serge2k 11y agoNot BFS exactly, but I did a breadth first traversal of a graph a couple weeks ago. Could I have dug up a library to do what I needed, sure I guess. Easier to take 20 minutes and just write the tool.
- p4wnc6 11y ago> Easier to take 20 minutes and just write the tool. What? That would be a huge red flag in my book. Where are your unit tests? I'm not trusting your 20 minute off the cuff reproduction of classic algorithms in any business critical piece of the code, not ever. This would get you booted from a lot of places, or at least given a stern talking to for doing something that seems slick, cool, and time-saving in the short term (yay, let's roll our own!) when really it's immature and time-wasting in the long run. Never (!) homebrew that shit unless you have to (like, you're in an embedded environment or your use case requires some bleeding edge research algorithm). It's like seeing someone write their own argument-parsing code. Holy shit, what a bad idea. Never (!) do that.
- ljw1001 11y agoAgreed. Spending twenty minutes finding a good library would be time much better spent
- serge2k 11y ago> It's like seeing someone write their own argument-parsing code. Holy shit, what a bad idea. Never (!) do that. So we did that. works well. I dunno, maybe this company is just full of incompetents. I mean, I doubt it, but it is possible. I appreciate judgement without context as well. Really, it's awesome.
- p4wnc6 11y agoIf you did write your own argument parsing code, then yes the choice to commit to that was incompetent, barring some extraordinary situation. I don't think it's controversial or insulting to say so in the least. It's a solved problem in every major language and most fringe languages. Spending time re-inventing it is just obviously wrong. It's not insulting or judgmental to say that it's wrong. It's just a fact. I do not understand being offended or angry about my statement of that fact. If we're talking about what is effective engineering and what is not, writing your own argument parsing tool for actual business usage (as opposed to doing this as a pedagogical side project or something), without evidence of some exceptional corner case, is ineffective engineering. It's practically the definition of ineffective engineering.