raganwald
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.)

Monday, January 28, 2008
  Lazy Evaluation in Java


Thanks for your call. I can pull your interview evaluation right up on my screen. Let me see now, home…, candidates…, search candidates…, click the last name field…, clickity clickety…, search. Sorry, wrong, I put your full name in the last name field, let me try again…, search candidates…, click the last name field…, clickity clickety…, search. Sorry about the wait, it’s too bad finding someone in our application is so clunky. Ok, here’s your evaluation, I’m looking at it right now.

I’m sorry, I don’t have good news abut the job opening here at BigCo. We have elected to pass on bringing you in for another interview.

Yes, I can appreciate that you are disappointed. You’re right, you have the right kind of degree from the right kind of University, and you have excellent grades. But still, we are going to bring some of the other candidates in for another round of talks.

We know that you will never need to understand recursion to do things here. In fact, we will probably fire anyone who writes higher-order functional code in our Java applications.

Why? Well, you seem like a nice person, so I will break our policy and tell you the actual reason. It was because you blew the recursion and data structures code tests. That’s it, really. You passed the database stuff and the loop stuff and the web architecture stuff just fine. As well as anybody might. But the recursion and data structures tests are kind of important. If we didn’t think so, we wouldn’t ask those questions.

Yes, we know that recursion doesn’t come up often in business applications. It’s been a while since I needed it for anything, these days we use XPath and SQL and let libraries do all of the dirty work for us. That’s true. And you’re right, we always use libraries and never write our own data structures. This is BigCo, not some sushi-gobbling start up. But we still ask you these questions, and we still expect you to get them right if you want to work here.

Are you asking why again? I feel like I’m talking to my three year-old here. But you obviously put a lot of work into researching our company before coming in for the interviews, you really stood out from the crowd of new graduates, and nobody else had the gumption to follow up with a phone call, I feel I owe you one.

The reason we expect you to know these things is that they were subjects you claim to have studied when you got your Computer Science degree. Don’t argue with me, I know that Universities are getting a lot more “practical” these days, we like that. I know that you learned your stuff in Java instead of in Scheme or—and this would make you instantly unemployable here at BigCo—in Haskell. But they still teach you about recursion. They still teach you about data structures. You are supposed to graduate knowing how to reverse a linked list, how to find the shortest distance between two nodes in a graph, how to search a tree, and what’s involved in finding cycles in a graph.

I know, if it were up to us they wouldn’t waste time teaching you stuff we don’t want you to use every day. But until we finish making programming a level playing field with the Third World, they are going to keep teaching some of that stuff and you are supposed to learn it. We didn’t ask you anything really tricky, we just asked you to regurgitate stuff you ought to have learned.

Laziness

Harumph. really? You really knew it but forgot it because you didn’t think you’d need it here? Well, let me be blunt: you were lazy. You tried to optimize your time to spend as little as possible on the things that you thought we wouldn’t ask you to know. You tried to maximize your grades by taking the easiest courses possible, so you didn’t get much of that stuff.

You were lazy. Now, laziness is said to be a virtue in a programmer. And if you want to be one of those super-smart programmers who can tell me why the only birds you need are Starlings and Kestrels, you might start a company that we buy for big bucks. But quite honestly, we don’t appreciate laziness in someone we are hiring to toil away in the bowels of our enterprise application code.

Quite honestly, we don’t appreciate laziness in someone we are hiring to toil away in the bowels of our enterprise application code.

Ok, stop, stop, I am not finished. Of course we know that you will almost never need to deeply understand recursion to do things here. And if you need it, you can Google around for some code to cut and paste. In fact, we will probably fire anyone who writes a lot of that higher-order functional code in our Java applications. We know that. But you know what else we know? We know you took shortcuts in school, you did just enough to get through without actually learning anything about the stuff you figured you didn’t need to get a job here.

Which makes us worried about what else you skipped to get here. We can’t test everything, we have to assume that if you skipped that stuff, you might have skipped something else. We have to assume that if you took short cuts to get here, you’ll take short cuts after we hire you. Maybe you’ll decide to push code into production without testing it thoroughly. Maybe you’ll decide to pretend to review someone else’s code but you won’t find an obvious error because you were too lazy to read it carefully.

There you go interrupting me again.

Yes of course we sometimes push code into production without as much testing as we like. But you know what? We want to make those decisions. We don’t want our newly hired, wet-behind-the-ears juniors being lazy and making those decisions for us. We want to hire people that are thorough and meticulous and always do everything they are told by us, and by their professors in University.

The bottom line is this: we appreciate your interest, but there is no room for laziness in our evaluation. We’re looking for people who put their heads down and do what they’re told without trying to game the system. We play the game. You are supposed to be the pawn, and if we let you survive to reach the eighth rank, you might get a chance to play along. But nobody needs a lazy pawn, sorry.

Best of luck with your job search, better luck next time.



Update: Finally, someone sided with the hapless and much-maligned candidate

To expect someone to know a skill which is not going to be needed on the job is unfair.
—Brandon on news.ycombinator.com

First, remember that an employer is talking to dozens or even hundreds of candidates. This one knows everything they anticipate is needed for the job, that one knows all of those things and more: which one should the employer hire?

Second, forget a Computer Science degree for a moment. You are interviewing a programmer who has just graduated with a degree in something unrelated, say English. You ask him whether he studied Shakespeare. He did. Does he remember any of it? Why no, he was just taking the course to get a degree, he didn’t pay attention beyond passing his examination. Is it unfair to pass over this person because they didn’t actually do any learning in College, just doing whatever they needed to do to pass courses and accumulate credits? I think this is a behaviour that—if repeated on the job— is deleterious.

As an employer, I do not select a candidate’s University. I do not select their courses. I do not choose the coursework and study material. The candidate does all of that. Am I unfair to say to the candidate that whatever they choose to study, they ought to actually learn it?

Putting it in harsher terms, when a candidate puts a degree on their résumé, they are making a claim. Are they claiming that they did just enough to obtain the required marks and no more, or are they claiming to know the material that was taught to them? If it is the latter, then as an employer I am being perfectly fair in testing their claims, whether or not the material has direct relevance to their initial job assignment.
 

Comments on “Lazy Evaluation in Java:
That's a logical, if somewhat stark, explanation for why CS courses teach all that "useless" stuff, but it's a bit like saying "you should avoid being racist because some black people are rich enough to sue you". I'd rather CS students learned all the extra stuff because it made them better programmers, but if you have to use the laziness argument instead, I guess it's better than nothing.
 
I'd rather CS students learned all the extra stuff because it made them better programmers

I'd rather that as well, but it is not clear to me that the majority of students in CS programs have any interest in being "better programmers." Why should they? BigCo has already taught them—in word and in deed—that better programming is frowned upon, the incentive is to become an architect or a manager and learn how to direct the energies of cadres of mediocre programmers.

I really wonder if these folks want to be better programmers but somehow nobody has convinced them that learning functional programming would help?
 
This post has been removed by the author.
 
I must admit, this story confused me. Are you saying it isn't worth teaching recursion in school? Really? Because it isn't used?

I have guys at work who each use it at least once a year. It's a key differentiator of our work vs the standard-issue consultancies out there. I think it's very practical.

As for your points about school: keep in mind, BigCo comes after school, not before. Worst-case, in the case of large grants from MS or some such company, it comes at the same time. Students haven't had time to be jaded yet, and I think should learn the fundamentals as a form of differentiation if nothing else.

In my mind, the ones who barely learn recursion and think it's useless and boring are collateral damage, because they really could have gone to DeVry and gotten the job at BigCo. They don't interest me; it's the ones that are interested in the fundamentals that carry the long term value. And I think we've been pretty clear that they're in the minority, always have been, and always will be.
 
Uh, Steve, I think what I was saying is that students should study it even if they don't think they'll need it.

Remember, (a) this is fictitious, and (b) it describes one fictitious new graduate and one fictitious BigCo employer. Nowhere does it say that all new graduates are identical, nor does it say that all large companies are identical.

Furtermore, the fictitious BigCo isn't really described. We get the fictitious perspective of one fictitious BigCo hiring manager who may completely misunderstand whether recursion is needed on their fictitious enterprise Java applications.

All we know for certain about this fictitious situation is that their fictitious standard set of code problems include recursion and data structure problems. Maybe they actually use them from time to time.

Ok, I'll stop. I'm sure you get the fictitious point. Good luck with your Starlings and Kestrels.
 
Awesome post, but at first it confused me enough to leave a comment.

If you want to get new programmers to learn fundamentals or "extras" like functional programming, you need a carrot.

Learning recursion and functional languages may make them more experienced, if not flat-out better. But this isn't enough for Joe Q. Coder. I think this is your 1st point.

I think your 2nd point is that companies don't really care, beyond the fact that they need some way to weed through the pile of potential candidates. Test for recursion knowledge as a means of filtering 100 applicants who all have 4.0 GPAs or are otherwise the same.

My analysis: these ideas have a serious marketing problem. Not only would they improve a programmer's skill, but for most companies they could be a competitive advantage. Sounds like a win-win, no? But this is not the mainstream view. The world needs people and companies who can change that.
 
Jesse:

For Joe Q. Coder, Point #1 is Point #2: they only thing he cares about is whatever companies care about when they're hiring.

And my basic point here is that his attitude is flat-out lazy and undesirable in any environment.

BigCo wants people who are diligent. Joe is not diligent. More enlightened companies want people who are competent. Joe isn't competent either.

As for companies and competitive advantage, that's a shelf full of books, much less a blog comment, but the simplest thing I can say about it is that companies look for competitive advantages in their core businesses. For example, ING Direct does banking one line, as do many other banks. But it's their core business, because their entire strategy is around offering better rates through lowering overheads.

As a result, ING Direct cares very much about its software development competence, because software is a core part of their business strategy.

Software is obviously tightly coupled to every business these days, but the difference between doing an mediocre job and a great job doesn't have the same leverage for OldStyleBankCo, so they invest their time looking for competitive advantages elsewhere, such as managing their branches.
 
So you're basically saying Joe Q. Coder epitomizes the selfish scumbag who doesn't care about their job any more than necessary to gain employment and live a lifestyle of comfortable ease.

And perhaps BigCo's are partly to blame by emphasizing top-down management over bottom-up collaboration.

I'm sure this is frequently the truth. And it's an epidemic that extends well beyond software development.
 
Jesse:

If you drop the word “scumbag” from your last comment you will find we are in perfect accord.

I tried to explain why such folks aren’t worth hiring anywhere: I tried to explain why they are a liability even in a top-down command-and-control culture.

And yes, I especially agree with your final statement:

It's an epidemic that extends well beyond software development.

And in truth, BigCo is very much to blame. As I hinted in the post, BigCo games its employees. Why should we be surprised that its employees try to game BigCo?

But nevertheless, my feeling is that choosing to learn less is not a good game strategy for Undergraduates. Knowledge and diligence are personal assets, it is always a good idea for students to invest in themselves, even if they are not sure that their first employer will pay a premium for those assets.

It's the old story fo short-term vs. long-term investment. Learning more and taking harder courses may not get you right into Google, but over the course of a career they will pay for themselves several thousandfold.
 
I used the term "scumbag" for exaggerated emphasis. I think society is not hard enough on this sort of apathy. However, it's not entirely the fault of the individual. To your point, institutional failures are often a key cause.

To borrow from modern slacker parlance: "Right on."
 
I have to admit, Reg, that the point of this post was lost on me until I read the comments. It seems to make contradictory arguments.
 
Matt:

1. It's not that well-written, and
2. I was trying to avoid a preachy anti-BigCo tone.

So, there isn't really a huge, deep point to be found. It's really a reaction I had to someone (whom I did not quote) arguing that employment tests shouldn't include recursion and advanced data structures since they don't pop up that often in Enterprisey jobs.
 
Scheme? Haskell?

Man, the world's gone to hell in the last decade - when I was taking CS classes they taught is the fundamentals of programming, and all about datastructures, in C.

Nothing makes sure that you really know your linked list or b-tree like having to implement it in C, with Real Live Pointers And Everything.

(Of course, like any sane person who isn't a Unix kernel programmer or driver developer I immediately stopped using C afterward.

But boy is it a good tool for knowing the guts of a computer; that and a term of assembly.)
 
Dear My. Braithwaite:

It has come to our attention that you have written a post that fails to make the clear point that something is black, and its opposite is white.

As a representative of the blog-reading collective, your attempt to simply examine a concept without declaring the good guys and the bad guys confuses and annoys us.

We ask that you immediately revise this post to make it more clear what the target of our Five Minute Hate should be.

Your prompt action on this matter would be appreciated.
 
It has come to our attention that you have written a post that fails to make the clear point that something is black, and its opposite is white.

There are two kinds of people in the world: those that bifurcate everything into two kinds, and...
 
I thought the point of a University degree was (a) to teach theory (critical thinking) and (b) to prove discipline (you survived).

I usually hire developers that are quick on their feet, can think their way through complex problems and can work independently. They can learn the technologies on the job -- I am always willing to teach -- but if they aren't flexible to begin with...

Paul.
http://theprogrammersparadox.blogspot.com
 
Remember that previous post of yours, where you wanted people to post "What I learned from language X that made me a better programmer in Y?"

Well, I don't think this is very different from getting a CS degree and learning about "fancy", "theoretical" concepts like recursion. Regardless of whether those topics are used everyday, what you gain from understanding them may manifest itself in other ways.

Do I expect the course I took in compiler design, for example, to be practically applicable in my everyday life once I graduate? Not really. But one day I may have to work with domain-specific languages, and I will be better prepared to deal with them.
 
My CS department was in the engineering school of the university. Like all of the other engr. majors, we had to take 4 semesters of calculus. I hated them. I just wanted to write cool web apps. Have I ever used calculus since those classes? No. But I realize now that the same abstract thinking, problem solving, attention to detail, and stick-to-it-ness that's required to do calculus are the same skills that give you the ability to be a programmer who can do novel or interesting things from "pure thought stuff". A lot of professional programmers don't know or don't remember their theory, but there's tremendous business value in being able to hand a programmer a problem and have them immediately recognize it as a variant of a theory problem they've already solved, rather than (usually poorly) reinvent the tree or graph.
 
Recursion isn't used very often.. but I can think of one place where it is. XSLT. Doing a template match and then doing an apply templates is recursive. I frequently see "programmers" have trouble using apply templates instead of a xsl:for loop.
 
I found this post to be rather confusing. At first, I thought you were ranting against universities not teaching functional PL or recursion or something of that sort. Then I thought you were ranting against students not wanting to learn that stuff even though its available.

Finally I read through the comments and found:
"I tried to explain why such folks aren’t worth hiring anywhere: I tried to explain why they are a liability even in a top-down command-and-control culture."
which made things a lot better.

All I would like to say is that no matter how incompetent or stupid or unwilling to learn the new graduate is, the BigCo manager in your story wields complete power over him (in his ability to offer him a job) and his attitude, his manner and his tone make him a much smaller, more despicable person than the graduate himself. Nobody deserves to be treated that way, no matter what they have done (or not done, as in this case).
 
no matter how incompetent or stupid or unwilling to learn the new graduate is, the BigCo manager in your story wields complete power over him (in his ability to offer him a job) and his attitude, his manner and his tone make him a much smaller, more despicable person than the graduate himself.

Well, seeing as they are both fictional, there are no feelings to be hurt by your criticism or mine.

But even if hiring managers are small and despicable, it is never a good thing to be incompetent or unwilling to learn.
 
I stumbled upon this page while at uni and searching to see if there were "lazy or operators in java" - ie the lazy ones you can use in unix.

I read the first line and decided to press back to get on with my work, but then something made me hesitate and read on... and on until the end.

I totally 100% agree with this HR drone! A degree is supposed to show a qualities in the person. And those include perseverance, discipline, self-motivation and passion for your area.

I've talked to some people in there post grad years who have told me not to worry about certain things in some papers, saying "Hardly anyone understands those concepts, just remember them for the exam". That is just absurd. Why would I pay thousands of dollars to take these papers if I didn't WANT to learn everything I could from them.

So many people generalize others via there grades. I know this isn't true in the real world and every day I realize that I don't want to stop learning. I am seriously considering becoming a professor after my post-grad years - what's better in life than learning about what you love every single day.

Great article,
Levi Lovelock
University of Auckland, BSc Compsci, Maths
 




<< Home
Reg Braithwaite


Recent Writing
Homoiconic Technical Writing / raganwald.posterous.com

Books
What I‘ve Learned From Failure / Kestrels, Quirky Birds, and Hopeless Egocentricity

Share
rewrite_rails / andand / unfold.rb / string_to_proc.rb / dsl_and_let.rb / comprehension.rb / lazy_lists.rb

Beauty
IS-STRICTLY-EQUIVALENT-TO-A / Spaghetti-Western Coding / Golf is a good program spoiled / Programming conventions as signals / Not all functions should be object methods

The Not So Big Software Design / Writing programs for people to read / Why Why Functional Programming Matters Matters / But Y would I want to do a thing like this?

Work
The single most important thing you must do to improve your programming career / The Naïve Approach to Hiring People / No Disrespect / Take control of your interview / Three tips for getting a job through a recruiter / My favourite interview question

Management
Exception Handling in Software Development / What if powerful languages and idioms only work for small teams? / Bricks / Which theory fits the evidence? / Still failing, still learning / What I’ve learned from failure

Notation
The unary ampersand in Ruby / (1..100).inject(&:+) / The challenge of teaching yourself a programming language / The significance of the meta-circular interpreter / Block-Structured Javascript / Haskell, Ruby and Infinity / Closures and Higher-Order Functions

Opinion
Why Apple is more expensive than Amazon / Why we are the biggest obstacles to our own growth / Is software the documentation of business process mistakes? / We have lost control of the apparatus / What I’ve Learned From Sales I, II, III

Whimsey
The Narcissism of Small Code Differences / Billy Martin’s Technique for Managing his Manager / Three stories about The Tao / Programming Language Stories / Why You Need a Degree to Work For BigCo

History
06/04 / 07/04 / 08/04 / 09/04 / 10/04 / 11/04 / 12/04 / 01/05 / 02/05 / 03/05 / 04/05 / 06/05 / 07/05 / 08/05 / 09/05 / 10/05 / 11/05 / 01/06 / 02/06 / 03/06 / 04/06 / 05/06 / 06/06 / 07/06 / 08/06 / 09/06 / 10/06 / 11/06 / 12/06 / 01/07 / 02/07 / 03/07 / 04/07 / 05/07 / 06/07 / 07/07 / 08/07 / 09/07 / 10/07 / 11/07 / 12/07 / 01/08 / 02/08 / 03/08 / 04/08 / 05/08 / 06/08 / 07/08 /