Fog Creek Software
g
Discussion Board




code on a whiteboard

Joel and others mentioned that in an interview for a programming position, when you give the interviewee some code to write on a whiteboard (or a piece of paper), it is a good sign when the interviewee places closing braces just after he places the opening braces (before any content is written inside the braces).

Well, as someone who was on the both sides of the fence (interviewee, interviewer), I disagree.

This practice is good when the interviewee has to write code on a computer terminal. In fact, I always put the closing brace right after the opening. But that's only because then I press "Up" and write code, and with each Enter the closing brace moves down. How do you do it on a whiteboard ? The interviewee must correctly predict how many LOC there will be inside the braces. Is this really necessary ? Or should (s)he just delete the closing brace each time and place it lower when (s)he runs out of space ?

Eli Bendersky
Friday, April 23, 2004

Thank you!  Somebody had to say it... 

I don't do it while coding either because all my IDE's auto-indent.  Type a { and the next line is indented.  Type a } and return to the previous indent.  That's how I keep track of where I am and how I move between indents.

It also helps that generally if you have an open { without a close brace your code won't compile.  This is good as the main reason for not typing the } is that I got distracted and forgot to finish the function!  I certainly don't want it to compile.

Almost Anonymous
Friday, April 23, 2004

>Or should (s)he just delete the closing brace each time and place it lower when (s)he runs out of space ?

That is literally what I did whenever I had to write code in a CS exam (erase the brackets and move them lower). Sometimes I would have to erase a few lines and write them lower too.

Aussie Chick
Friday, April 23, 2004

Writing _real_ code, on paper, in exams, sucks... 

I had to do it once for an introductory Visual Basic course.  I was vastly overqualified and took it for an easy grade.  It took me the entire exam time (2 hours) to write the code, less 5 minutes, and I was first person finished.

I, of course, had arrows drawn everywhere linking bits of code into various procedures!

Almost Anonymous
Friday, April 23, 2004

My first ever exam requiring code, I was shocked.
I wrote a half page (annoyed) explanation stating that I thought this was unfair and would be seriously annoyed if I was marked down for simple compile errors.

It was in my second year of the course that one of the instructors let us know 'We do ignore simple errors..etc'

My page was always black from overuse of the eraser...

Aussie Chick
Friday, April 23, 2004

On a whiteboard you can erase the closing brace and move it.

Mr Jack
Friday, April 23, 2004

I always do the braces thing when typing in the ide. On handwritten I find I do it as an automatism, but I often whish I didn't. Especially on paper you either seem to underestimate the lines needed for the inner part, leaving you with scratched out brace marks all over the page, or overestimate, which is even worse since you face the dilemma of leaving a white gap, or messing up the indent further down to hover around the scratched brace.

Just me (Sir to you)
Friday, April 23, 2004

So what if you can erase it ? What is it needed for, anyway ? Is it vital to be able to write syntactially 100% correct code on a whiteboard ? This is not what's important. Today with the smart compilers and editors, it's even less important.

Eli Bendersky
Friday, April 23, 2004

I have to confess that Eclipse is getting on t*ts. It keeps automagically entering a closing brace when I enter an opening one, so when I type my clsoing brace I actually write invalid code. Grrrr!


Friday, April 23, 2004

It's just an indicator of attention to detail.  It says "I'm someone who has picked up a habit that keeps me from spending time looking for bugs caused by mismatched braces.  I probably have other good programming habits, too."

It's not necessarily the One True Good Programming Habit, but it's a good one to look for on a white board.

Also, when doing it on paper, you just give yourself some space, and then as you write the stuff to go in between, you adapt the size of your writing to how much more you need to write.  Paper code is still valid if the last three lines are smaller than the rest of the function.

Emperor Norton
Friday, April 23, 2004

Emperor,

To me it sounds more like "I've read a lot of sites about interviewing and will do whatever it takes to look good, even clumsily place and erase braces, when on paper it's a waste of time"

Eli Bendersky
Friday, April 23, 2004

Can't you take a bag of closing braces written on cardboard {the carboard being backed with reusable sticky tape, natch} ?

You could take a bunch of public static void's too but, personally, I think *that* would be over the top.

Slough Bloke
Friday, April 23, 2004

The point of whiteboarding is to make an argument for something in public, and it helps them scrutinize your point.  Braces are not part of this.  I will adjust to communicate in an understandable way, but ideally I would write in the best notation available for the subject.  If I later feel I need to hand-compile it in order to step down in abstraction, fine.

If I interview somewhere and not hired solely because of braces, I'd shrug because at any point I could've written closer to some stock computer notation.  And he didn't tell me.  (I used to code Java into Windows notepad to feel the characters between my toes, so I can do it.)  The interviewer would be right not to hire me because I'd probably drive him mad.

Tayssir John Gabbour
Friday, April 23, 2004

So, why not bring in a laptop and a projector, and let them write code that's projected up onto the wall instead?

Problem solved.

Brad Wilson (dotnetguy.techieswithcats.com)
Friday, April 23, 2004

Brad: my thoughts exactly. That has the added benefit of determining if the interviewee touch-types or not. (Disabilities aside, my first impression of a programmer who cannot touch type is that they're not serious about their job.)

Chris Winters
Friday, April 23, 2004

I don't touch type. I do sort of 3-4 finger jumping around the keyboard dance at a quick pace. I always believed touch typing would lead to RSI.

Just me (Sir to you)
Friday, April 23, 2004

But that's just trivial perfectionism ... like making the bottom of your 'g' consistent with the top.


Friday, April 23, 2004

The problem with using a computer/projector is very few people have the same type of system setup, keyboards or have their editors setup the same (I typically dont even use the MS-IDE for most programming, just to fix compiler errors/short inserts).

Keyboards and keystrokes (mapping) are just slightly different from machine to machine that it is a real pain to fix minor things on someone elses machine- I know I feel like I am just flailing around feeling like a 3yr old when not on "my box".  I would never ask a developer to use a machine that they have never sat down in front of before to accomplish a task. 

Whiteboard is much better, it removes this situation and also relaxes the situation (you dont fell like you need to write perfect code, just get the point across)

The only situation where a computer would be appropriate is if the candidate brought their own laptop...

Mike

MikeG
Friday, April 23, 2004

It seems pseudo-code has fallen out of fashion.  I'd rarely, unless I was actually lecturing on the syntax itself, attempt to write pure C or C++ on a whiteboard.  C++ is so bureaucratic that it would occupy too much space and any audience that understood C (or pascal) would understand my pseudo-code.

That said at times I feel like my hands have been removed if I'm trying to explain something and I don't have a whiteboard to draw boxes and arrows.

Simon Lucy
Friday, April 23, 2004

"I would never ask a developer to use a machine that they have never sat down in front of before to accomplish a task."

We're not talking about having a user create a new project, and get it running. We're talking about just typing up a small amount of source code (not even compiling it).

You're telling me you'd rather write on a white-board than type into a simple text editor? For real?

Brad Wilson (dotnetguy.techieswithcats.com)
Friday, April 23, 2004

"You're telling me you'd rather write on a white-board than type into a simple text editor? For real?"

In many ways I agree with this. Sitting at the computer adds a level of distraction--it's an unfamiliar environment. What else is on the screen? How does the editor work?

(imagine pen & paper (which I've had to use when there was no whiteboard). except the guy hands you a fountain pen or charcol stick.)

Then there's the watching-over-the-shoulder aspect--it's normal and obvious with a whiteboard. With a computer screen it works differently, and with a second monitor or projector or whatnot it's even more different.

Then there's the history aspect--is the guy going to make me compile the code next? or take it and stick it in his own work if it's some unusal problem?

all in all, the whiteboard is a commonly used presentation medium, while a computer keyboard just isn't. and a coding question has significant presentation aspects.

mb
Friday, April 23, 2004

"You're telling me you'd rather write on a white-board than type into a simple text editor? For real? "

Absolutely! I would argue it's not just simply typing into a text editor.  I have a completely different mindset when I am writing code.  Before I write code I draw objects/classes etc on paper first (basically scribble out my thoughts) because I need to do this to work out my thoughts/come up with a spec.  Typing in an editor makes me "think differently".  It's hard to jump around/show relationships.  On a white board I can draw boxes/lines/visual relationships.  I can refine my thoughts.  I can show the psuedo code for it right there.  I can move things around and erase at will (and Its not the same as cutting/pasting).

In an interviewing environment, I would definitely prefer white board over a text editor (and if you want me to code/type into a text editor, I would INSIST that you let me do it using my own laptop, keyboard, setup and tools)

Mike

MikeG
Friday, April 23, 2004

One would have to agree with Mike except that I believe the OP is talking about writing actual working code. Personally I think I'd walk out. I've done it before, and I'll do it again. If I get asked questions I think are stupid I'm out of there. I'd do just what Mike said as I do the same thing. Writing actual code on a whiteboard is moronic.  Microsoft thinks it's hiring all the best and the brightest .... I suggest they read Halberstam's book on the subject and how great those best and brightest were.

must remain anonymous
Friday, April 23, 2004

`It's just an indicator of attention to detail.  It says "I'm someone who has picked up a habit that keeps me from spending time looking for bugs caused by mismatched braces. " '

And I'd say your, and Joel's, observations of these quirks are examples of "people with hugely overblown egos who think that everything they do is the right way to to things". I don't know about you, but we already know that Joel has a pretty bloated sense of self evaluation.

I once, many years back when I was an impressionable pup just starting to catch on to the self-serving bullshit that fills the working world, worked for a manager who would constantly tell me the Traits That Make A Good Manager - a good manager liked to do this, and a good manager liked to do that, etc. What he was doing was enumerating all of the things HE did, imaging that therefore they're traits of any good manager. The humorous thing was that they were a horrible manager in virtually every qualifiable way (loyalty, turnover, project awareness and control, etc), but that didn't stop them from espousing the Way Things Should Be Done.

With all due respect to Joel for a lot of great writings with a lot of solid wisdom, he worked on VBA for Excel, a dialer for a ISP, and now works at a company that makes simple tools for publishing wizard websites or tracking bugs -- you can only push the "ultra elite" thing so far before people start to call you on it.

Dennis Forbes
Friday, April 23, 2004

The Emperor has no clothes on!!! There, I said it.

Anon-y-mous Cow-ard
Friday, April 23, 2004

> With all due respect to Joel ...  he
> now works at a company ...

"FOUNDED AND RUNS a company", you mean.  There's a HECK of a difference.

I can understand how his writings sometimes rub people the wrong way, but to me what makes him unusual (and what keeps me coming back here) is his particular combination of business sense, interpersonal skills, and technical acumen, which he conveys in an entertaining (in my opinion, anyway) writing style.

Is he a code wizard on par with Knuth et al?  Probably not.  Is he a moneymaking genius like, I dunno, Warren Buffett?  Again, probably not.  Does he sometimes shoot from the hip, and occasionally get called on it by someone with more depth in a particular field?  Well, yes.  But (to me, anyway) Joel combines substantial strengths in several areas, and that combination is not a common thing.

Plus (and this is what really gives him credibility in my mind) by founding Fog Creek (and employing people, and shipping products) he's actually putting his money where his mouth is, so to speak... and so I for one can forgive him the occasional whiff of arrogance.

- former car owner in Queens
Friday, April 23, 2004

I can't believe you guys think Joel is arrogant. You've clearly never dealt with any hard-core business people. Joel is a puppy dog compared to the way most people act in business.

Brad Wilson (dotnetguy.techieswithcats.com)
Saturday, April 24, 2004

` "FOUNDED AND RUNS a company", you mean.  There's a HECK of a difference. '

That was a mistype on my part and I apologize. Of course "founded and runs" in and of itself doesn't earn a lot of respect (Joel came from the era when Microsoft was tossing around money liberally - with seed money founding and running a company is something any monkey can do), though he does earn kudos for founding and running a seemingly _successful_ company, which is definitely credible.

In any case I'm not trying to diminish Joel -- there is absolutely no doubt that he is an excellent writer, has a tremendous amount of wisdom in the realms of effective teams and processes, and is probably a great coder.

What irks me (and I'm only complaining as "some asshole with an opinion" -- Don't think I'm overstating the value of my words) is when people take trivial things that they do and paint it as meaning much more than that. To give an analogy, I've oft heard the claim "You can tell the quality of a man by the quality of his grass" - Again some anal-retentive blowhard with a perfectly trimmed, chemical cesspool lawn then takes that to mean not only that one is vigilent about their lawn and really likes it perfect, but this is indicative of something much greater. This is self-serving rhetoric because one is trying to solidify personal traits as being the ideal traits for a profession or position.

Dennis Forbes
Saturday, April 24, 2004

*  Recent Topics

*  Fog Creek Home