a companion discussion area for blog.codinghorror.com

The Non-Programming Programmer


#81

@Andrew Zen - learn algorithms - with this you will be able to do anything. Do not bother to focus on syntax beyond the extent which is required to practice algorithms in a language you choose. I absolutely hate programming tests which focus on syntax - that’s what makes “FizzBuzz” such a great question, especially when asked to write pseudo-code. Learn the popular algorithms, such as QuickSort and Binary Search - but don’t just learn what they do, learn why they work, and how they are derived - so, start with the basic algorithms like Bubble Sort and Linear Search, and learn how and why the improvements exist. Learn to find similar improvements in your own algorithms - if you take a shower every day, figure out how to make that more efficient, or prove that it’s as efficient as possible - learn to recognize why.

In 25 years of programming, I have used maybe 20 languages, most of which aren’t used any more - knowing the syntax of those dead languages is useless today, and knowing C# and the .Net Framework will be useless tomorrow. Knowing how to find an algorithm to solve a problem will serve me well a long time into the future. This is the basic skill that is lacking in a lot of programmers today - they have no ability to think up an algorithm for anything. Colleges are teaching syntax, HR is testing syntax, even certification exams are testing syntax - and they are all missing the target.

Learn how code works, in general, and don’t get bogged down in the format and syntax of a particular language. BTW - there is a book called “Programming for Dummies” - from the popular series of bright yellow “dummies” books. It is one of my most treasured possessions, but I loan it out on occasion - in fact I didn’t buy it for myself, I bought it for a friend who wasn’t learning coding in his college classes. I highly suggest you pick up this book - it is straight to the point about what you need to do to write code, and it’s not “academic” like Code Complete and some of the others on Jeff’s list.


#82

Don’t underestimate the conditions of an interview process. If you think that’s similar to the pressure of a deadline by proxy, I disagree. I’ve worked with very good programmers who I think disintegrate under the scrutiny of someone who looks quizically at them when they’ve been used to (for years) people trusting their judgement. Hell there are even psychological experiments which can coerce people into non-natural behaviour (think the Milgram experiment as an extreme example).

The most difficult thing to evaluate and the most important aspect of a candidate is how hard they work. You can hire someone who can recite an algorithm or do The Times crossword in ten minutes but if you only get ten minutes of work out of them a day then they’re fucking useless.

Another thing I’ve noticed is how poorly people are trained to interview potential candidates. How many companies track the ability of an interviewer?

The fact is, is that in most cases people hire people who are like them.


#83

I am, frankly, appalled at some of the responses here from “experienced” programmers.

“What is the next hex number after F” is NOT an obscure question that very few programmers will know the answer to. It is a very basic thing that (over here at least) we get taught in our first year of Uni, which is redundant as we also get taught it before we ever reach Uni. That’s part of the number systems material where we get octal, binary and hex. Admittedly there is only a nod to octal, I can’t do much with it in my head still. That’s alongside the boolean logic and finite state machine material taught in other classes.

I fail to see how you can possibly have 10 year professional experience in programming (or even 10 years amateur experience) without ever reading or using hex numbers. It’s not like not knowing an API, a pattern, or even a language. This is a basic thing inherent to computing.


#84

I’m an old school programmer. Old, old school. Punched paper card old. I read Ellen Ullman’s article, about 10 years ago (“The dumbing-down of programming”, or something like that), and I felt almost proud of being obsolete. But the world kept going round, and since last year I began to revamp my skills, got my C# and my .NET together (great choice for old-timers, by the way) - begginer’s level, but I’m psyched - and it all seems to be coming back again.

I’m just trying to say that, back in my student days, teachers didn’t pretend to teach, and we didn’t pretend to learn. Why? Not because we were braver and more virtuous (trust me on that), but simply because it was impossible. Productivity begins with honesty, and if honesty is not rewarded, well, now you know what happens.


#85

Tonylo>> The fact is, is that in most cases people hire people who are like them

It’s also said that generally people don’t hire staff who are smarter than themself, often because they can’t recognize talent and sometimes because they don’t want to hire a person that may become a threat and ultimately become their successor

John Kenp>> I am, frankly, appalled at some of the responses here from “experienced” programmers

+1!


#86

@Martin, I’ve rarely (fortunately) found that programmers in a position to have a choice are that cynical - usually because the net effect will hit them. Manager’s and marketeers are a different matter :slight_smile:


#87

Oh my.

Why the heck are people applying for a job they can’t do?


#88

As recent graduate with a BS in Computer Science, and one looking for a J-O-B. Some of these questions are trivial, but a lot of times you haven’t thought about them since your initial classes. Your head is full of random trivia or more complicated stuff like polymorphism, threading, differences in SDLCs, and which UML diagram you should use. I haven’t had a “programming” class since Freshman year (unless you count assembly–soph). Most classes/Uni. Programs are skimping on the code monkey, and concentrating on how to properly design/engineer a solution. So us newly graduated ARE lacking in the actual coding experience it doesn’t mean we can’t program, just that we haven’t done it.


#89

as a newbie programmer myself, mostly versed in Python and C/C++, and with very very weak math skills… many of these questions would take me much longer to solve than most programmers. I could solve them, and likely in an unexpected way.

anyway. The biggest issue is always going to be whether the applicant has the skills to learn. No environment is the same, and no skillsets and knowledge base are going to match up perfectly.
So what the guy said previously about learning algorithms is probably the best comment here. I know next to nothing about most syntax, and I suck at math, but once I learn the methodology of an algorithm i can translate that to any language, with just a little bit of learning.

the guy who cant learn is going to be stuck with a missmatched set of skills.


#90

I think what I’m what I’m geting out of this is that anybody looking for a programming job should brush up on their CS 101 textbook exercises? I tend to side with Joseph Connolly’s 6:22 AM post: sometimes interviewers are looking for a “stock” answer, and someone without a Math or CS degree will never know the magic phrase.

I’m not so sure that being able to code a “small” program like a linked list will accurately predict someone’s competence as a programmer (although I agree it’s a reasonable baseline requirement for any applicant with a CS degree or 5+ years of experience).

When I interview candidates, I always show them a “Rorschach Test” - a Java class that is a sort of Frankenstein monster of unclean code, anti-patterns and lurking runtime exceptions (all lifted from “Production” code I’ve had to support over the years). I would show them the code and say “this code compiles and is functional, but it’s got some problems. How would you make it better?”

The best candidates would look at it and laughingly go through all the problems and start discussing refactorings. The worst candidates - some who had newly-minted CS degrees and no doubt could crank out a mean linked list implementation - would stare blankly at the sheet for several minutes or even say (unbelievably) “looks pretty good!”

Finally, I’ve noticed some of the comments here are by people who have apparently used the interview process as an opportunity to “toy” with candidates and thus boost their own ego. Unprofessional and lame.


#91

Jeff it’s possible you’re only hearing about the totally unqualified applicants. The decent-or-better candidates don’t make for interesting interview stories.


#92

To anyone who’s trying to figure out why so many interview candidates are bad, you should read this Joel on Software article (from 2005): http://www.joelonsoftware.com/items/2005/01/27.html


#93

@Jasmine Adamson Thanks for the advice. I’ll check out that book too - I have no qualms being a dummy. But I’ll make sure I’m up-to-scratch before I start applying for, and attending interviews for, programming jobs.


#94

The worst thing about all this - apart from having to work with them - is realizing they keep average salaries down, because business have to worry about being profitable with some of these no-hopers on their team.


#95

@Paul Jungwirth

You have the numbers 123456789, in that order. Between each number, you must insert either nothing, a plus sign, or a multiplication sign, so that the resulting expression equals [2002]. Write a program that prints all solutions. (There are two.) This is a pretty tricky problem, actually, if you don’t think to use recursion. I was satisfied with pseudocode, but the Perl Mongers version was to fit the whole thing into 80 characters!

There’s probably a more CPU-efficient way to do this, but considering how much I’m being paid and how important time-to-market is, you would probably rather that I sacrifice CPU time for developer time, as long as the code’s clear enough for somebody to optimize later; I can optimize it later when the situation calls for it.

In Ruby:

Represent a nonnegative integer as a fixed-length array in base 3 (little endian),

using the symbols “”, “*”, and “+”.

Example:

base3(0,3) # => ["", “”, “”]

base3(1,3) # => ["*", “”, “”]

base3(2,3) # => ["+", “”, “”]

base3(3,3) # => ["", “*”, “”]

def base3(n, len)
   symbol_space = ["", “*”, “+”]  
   retval = []
   len.times do
     retval << symbol_space[n % 3]
     n /= 3
   end
   retval
end

XXX - This is slow (O(3**n)). Luckily, with a string of length 9,

we only have to do 6561 iterations.

s = “123456789"
s = s.split(”") # Split into array: [“1”, “2”, …, “9”]
(0…3**(s.length-1)-1).each do |n|   # iterate through all possible combinations
   ops = base3(n, s.length-1)
   expr = s.zip(ops).flatten.join
   puts expr if eval(expr) == 2002
end

I should get extra credit for figuring out how to indent stuff on this blog. (Hint: U+00A0)


#96

The problem I have with these mathematics-based questions is just that: math. I am not very quick at math, but give me some time and I’ll get it. The other thing is that I have only ever needed to use mod a few times in the 10 years I’ve done development (alternating row CSS anyone?! Thank God for CSS3 selectors). I suppose it’s good the first thing that came to my mind with the FizzBuzz was a mod solution, but I always forget how it works. I don’t do a lot of math heavy programming though and I didn’t come from the comp sci school, I learned by myself.

I’d rather be asked to build a simple app rather than a math-based problem. I like the idea of asking for a code sample. I’d feel a lot better giving someone a polished code sample… but I understand the need for on-the-spot questioning to determine how well someone can do something on their own.


#97

I have a really simple solution to the “insert operators into 123456789 to add up to 2002” problem.

It may not be the most elegant, or recursive, but it took only a couple of minutes to conceive, type, and execute.

Using bash:

for e in 1{,+,}2{,+,}3{,+,}4{,+,}5{,+,}6{,+,}7{,+,}8{,+,}9; do echo $e = $(($e)); done | grep ‘= 2002’


#98

one thing that you haven’t mentioned (and i’m not sure if anyone else has) the non-programming programmer takes away the job of a programmer. which is bad for the programmer, the company, and any potential customer of that company. so considering so many of them actually make it to the interview in the first place… how can the programming-able programmer distinguish himself from the one who can not actually program.
should i add a line to my resume saying “i can actually program” ?
would be nice if someone could come up with a way of helping all involved, the programmer who wants the job, the interviewer who would be very happy of never having to actually interview someone who can’t program, and the company that does the hiring.
i’m thinking a web based application process wouldn’t be a bad thing, some little flash application that records all the keystrokes of a simple programming question (just so you rule out the ctrl-V people) and give the people who succeed a GUID of some sort which they have to put on their application. then you start by interviewing the people who have completed the simple question and only if you run out of applicants who have done that you start interviewing those who have not (and probably ask them to finish it before coming in for the interview, or before you call them).


#99

Not to pound on a dying horse, but who could possibly care about a gotcha question like how to find the smallest common multiple of two integers? What’s sad is interview questions that aim to demonstrate the omnipotence of the questioner rather than gauge someone’s fitness for solving real business problems in code.


#100

I’m astonished at how many responses are along the lines of, “Interview Question X is no good, because I’ve been programming for 10/20/30 years and never had to do anything like that.”

Do you really want to present yourself as someone who can only handle problems you’ve already solved in the past?