[Tutor] Python Interview Questions..

Marc Tompkins marc.tompkins at gmail.com
Sat May 28 07:32:03 CEST 2011


On Fri, May 27, 2011 at 8:38 PM, Steven D'Aprano <steve at pearwood.info>wrote:

> Not such a good analogy, since modern consumer goods are getting to the
> point where they are almost unrepairable except by replacing the control
> board. It often costs you *more* to fix a broken widget than to throw the
> machine away and buy a new one, e.g. monitors, TVs, DVD players...
>

I kept going way, way too long with the dishwasher analogy, but the actual
incident that was stuck in my mind was automotive: a few years ago, my
brakes started pulsing whenever I tried to stop, and the brake light was
constantly lit.  I took it to the dealership; they took a look, and said
"You need a new anti-lock brake computer.  That'll be $1000."  That seemed a
bit steep to me, so I took it to Midas Brake and Muffler.  They took a look,
and said "You need a new right-front anti-lock brake sensor; that'll be
$600."  That seemed more reasonable, but when you have two clocks that don't
agree you should consult a third, so I went to my regular mechanic (where I
should have started in the first place!)  He said "A stone from the road cut
the wire from the right front sensor to the computer.  We spliced the wire,
wrapped it in heat-shrink tubing and sealed it.  That'll be $15."
Now, try to re-imagine my analogy with those three mechanics in the place of
programmers.  Which one should I hire?


> That's also often the case with computers unless you value your time very
> low. In my day job, if I have the choice in paying one of my junior techs
> more than 4 hours to diagnose a flaky piece of hardware, I'd rather just hit
> it with a hammer and replace the likely suspects (memory, motherboard...
> whatever is likely to be causing the symptoms). Obviously its a sliding
> scale -- I don't replace a $14,000 server because a hard drive is broken,
> but neither do I spend three days trying to be absolutely 100% sure that a
> $60 power supply is flaky before replacing it.
>
> Coming back to programming, sometimes the right answer is to throw more
> memory at a problem rather than to write better code. A GB of RAM costs,
> what, $100? That's like what, 1-3 hours of developer time? If it takes you
> three hours to lower your application's memory requirements by half a gig,
> you might be throwing money away.
>

This approach may be acceptable for in-house development, or a case where
you and three other people use your program.  When Microsoft and Apple adopt
this philosophy, it makes me incredibly angry - multiply that $100 by all
the computers running their crap software, and eventually it adds up to real
money.  I truly think that one of the tragedies of modern software is that
the developers at places like MS, Apple, Adobe, etc. get their computers
replaced on a shorter lifecycle than most of the rest of us.  I mean, really
- have you used Outlook or iTunes, or FSM help us Acrobat, recently?  Makes
me want to open a vein.

And that gets to the point I was trying to make.  I am ALL FOR hobbyist and
part-time programming - I would not describe myself as a genius programmer,
so it's a good thing that it's not my full-time job (although it's my
favorite part of my job!)
BUT:
I damn well want geniuses, and nobody else, working on the software that I
have to use to make my living.  It pisses me off beyond belief to have to
use some Schlemiel's efforts when I'm trying to put food on my family.*  And
that is why, if I were hiring developers, I would be strongly tempted to
skip the resumes from Java schools (even if, FSM help me, my shop actually
developed in Java) - there may very well be great programmers who went to
those schools, but someone else can find them; I want the ones who've been
pre-sifted for me.


> That's partly why we program in Python: use a relatively heavyweight
> language environment (at least compared to C or assembly) that allows us to
> be 10-30 times as productive for the cost of 10 times slower code and twice
> as much memory.
>

At no time have I advocated developing in assembler.   I think that
programmers should Get their Stuff Done in the most efficient manner
possible.  BUT:  if you work for me, I want you to have sprained your brain
learning how the flippin' machine works.  Then, when you come to work for
me, I will be ever-so happy to let you work in Python - because I know it's
the best way to harness your talent.  But (although I love this list, and
wish everybody on it well) I would never hire a programmer who had only ever
used Python, even if I ran a Python shop.

Full disclosure: I am currently cranky on the subject of crap software (and
the crap programmers who produce it) because, in one of my non-Python gigs,
I've been struggling to update some templates in an Electronic Health Record
system (which shall remain nameless.)  The template editor was clearly
written by a loosely-affiliated team of mental defectives, and it raises my
blood pressure every time I get near it.  So I may be a little unreasonable
on the subject of quality software...

* pace G.W.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110527/417334c7/attachment.html>


More information about the Tutor mailing list