Hacker News new | ask | show | jobs
by tptacek 6369 days ago
I actually didn't mean that. I meant: write lots of code.

The bad decisions I made?

(a) thinking that people who could talk and talk and talk about code (shut up I'm not interviewing with you) would write good code

(b) thinking that people who couldn't explain why they'd ever use a red-black tree instead of a hash table would write bad code.

I'm making a case for more-is-more. People who write code (really write, sure, not cut-paste) have work ethics, are really into actually writing code, can easily be trained to bring them up to a median "engineery" standard of code, and get stuff done.

3 comments

I'm not sure where in the tree to place this, so I'll put it at the bottom.

The absolute best indicator I've found for separating quality developers from the 9 to 5 set is finding out what they read.

80% read nothing and admit to it.

15% will make up something like "I read lots of things" or "I read blogs". This is the dangerous group, they're the astronauts.

The last 5% will tell you books they're reading, and more often than not will recommend books to you because they are passionate about what they read.

This simple test has yet to fail me. I'm sure there are great programmers in the 9 to 5 crew, but they aren't the people I want to trust in a pinch. I'll always prefer the guy who is doing this because he loves it over the guy who does it because it's a paycheck.

I've met a lot of people who can talk very intelligently about code and design, and who have read the canon, and can't put a function in a text editor to save their lives. Obviously, I'm not the only person to notice this: it's the reason for the "fizzbuzz" test.
Well, there are two parts to this. First of all, here (Phoenix) the market is very full of the "I program because it pays the bills" sort, and when we do a posting we review hundreds of candidates (either who directly contact us or are sent to us). Of those hundreds, I'll talk to probably 30 to 50. Of that 30 to 50, maybe 5 or 6 will come in for a face to face. The conversation around software is a great start and it saves me a TON of time when screening candidates by phone. Once there here we can talk code samples or details.

The second part is that it is inevitable that someone will eventually talk a good talk but be unable to actually walk the walk. That's when it's nice that we're in a right to work state. There's no point keeping someone on if they can't do the job you've hired them to do.

Of course, all that being said, this only works because we are a small shop, and the person doing the hiring is the same person who will work with "the new guy" from day one. This makes it loads easier than having to deal with hiring for someone else's department or even company.

Conversely, I generally don't read books on software design. I buy books on business, math, graduate level CS, occasionally programming languages (but then usually just to get something I can go through once and quickly) - but not software engineering. It just seems so ... well, put bluntly, the concepts covered in most of those books are pretty boring and part of the conventional wisdom of engineering culture.

The crowd that reads all of the software engineering books seems to be evenly split between good engineers and wankers.

I want to see a portfolio with real code behind it. I want to read your code. If I can't do that, you've probably not convinced me you're a good programmer, no matter how much you can talk the talk.

Are we all disqualified because we waste too much time on HN?

Reading looks like a good wheat from chaff question because someone who reads is continually educating him/herself. What gets points for a candidate? Language/framework books, algorithms, professional practices, essays, science fiction?

Well, keep in mind that I'm just one guy. I'm not some sort of high powered executive; I'm a hacker that just happens to do hiring.

There is a world of difference between the people of the world who are interested in making themselves better developers and computer scientists and the people who just want to do the minimum necessary for a job.

Other than the obvious requirement of some modicum of honesty on a resume (like... if you're going to say you know Haskell on your resume, you'd better be prepared to tell me what a monad is), reading has been the best indicator of a hire for me than anything else. Of course, just because someone says they read a ton of books doesn't mean they're going to get a job, but I'll only do face to face interviews with people who give a shit about what they do.

We don't do the caliber of stuff that requires deep discussion about sorting a million integers with only 2MB of memory, but we do like to keep our shop as small as is humanly possible in order to keep the quality level as high as we can.

(a) It's not really the fact that they talk about code, imho, it's what they say about code. Anyone who's clearly a passionate geek and writes weird and wonderful programs in their spare time is likely to be good.

(b) I don't know how to answer that question, but I could easily look it up if I was doing some work that required this sort of optimisation. Despite that lack of knowledge, I've built two start-ups now.

You use a hash table when you just need lookup. You use a tree when you need sorted order. The only tree worth using is a red-black tree. There, now you don't need to look it up. ;)
If I asked that question in an interview, and that's the answer you gave, I'd probably not hire you (assuming the position was CS-intensive).

There are a number of special-purpose trees which are important in some domains (tries, B-tree, splay tree, ...)

Simple hash implementations also tend to assume that it's cheap to compute a hash on the given key type (not always true) and that you have a rough idea on the bound of items in storage. Hashes far below that level are often also less memory efficient since the hash-table is pre-allocated.

Oh, bring it on, wheels.

First, take tries and B-trees out of consideration: they aren't generic search trees. Tries have a higher overhead than binary search trees. You use a trie when you need prefix search. You're wanking if you break out a trie otherwise. B-trees are for building external indices. Most people here have never written one.

If you don't agree with either of those, I'll still just say you're cheating by taking what I clearly meant as "binary search tree" and overgeneralizing. But I'll stand by my take on tries and b-trees. Tries are neat; I even wrote a pretty popular blog post about them:

   http://www.matasano.com/log/1009/aguri-coolest-data-structure-youve-never-heard-of/
... but I wouldn't try to make std::map work in terms of them.

Second, if you need to cache search results, you should cache search results explicitly, with a cache structure. Splay trees suck. They aren't balanced. They have worst case O(n). And they change on read; lookup can invalidate iterators. Lots of people write splay tree code. My theory as to why: splay trees are easy to write.

Finally, and most importantly: nobody in the history of the universe has written and put into production a tree ADT library (at least, not in C/C++) that didn't have catastrophic bugs. A balanced binary tree is something you want to have written once and tested and debugged, and then never touch again. If you're going to get balanced trees right once, what's it going to be? AVL? Actual 2-3 trees? The industry already sorted this out, which is why all the STLs use red-black.

(For the record: I agree with you on hashing being overrated and binary trees being underused, but I'm still more likely to use a generic hash table than a tree for simple lookup).

Sure, now there's a real answer. :-)

What I was mostly taking offense to was: "The only tree worth using is a red-black tree." There are a number of special trees that are useful in specific domains. Especially in a comment addressed at folks that weren't familiar with tree structures, this seemed important to note.

Other than that there's nothing in there I'd disagree with. On splay trees -- they're not just simple to implement, they're also lightweight. Often useful for the cases where you only half-way care. Tries and B-trees obviously aren't general purpose.

I wouldn't dare show my face in a CS-intensive interview and not know this. Fortunately, that's not my bread and butter at the moment. :-)
Cheers :-)
That's an interesting and intuitive-after-the-fact observation. Thanks.