My brother the master coder

July 28th, 2010 · 9:00 am @   -  7 Comments

My younger brother Kevin is not only a great guy with a great sense of humor, but he’s a valued member of the Benchside team. Recently, my new Benchside teammate (and professional coder) Anuraag suggested that I start using the Python programming language’s formal exception handling system to handle errors gracefully rather than rely on Kevin/my cobbled together system of error handling which we pieced together for the purpose of getting stuff done rather than getting stuff done well. Anuraag’s suggestion was not a trivial change, although, admittedly, its something we should do as our code gets longer and more complicated, and when I raised the idea with Kevin, this is how he replied:

Kevin:  man i hate exceptions

Me:  aren’t u supposed to be the legit pro programmer?

Me:  shouldn’t u have figured all this out before?

Kevin: my code doesnt make mistakes

Me: LOL :-)

Kevin: thats why i dont need them

Sadly, while Kevin might not mistakes, I almost certainly do :-) .

Tags: , , , , , ,

  • Bhan

    I was waiting for the part where you said he's single and likes long walks on the beach.

  • http://blog.benchside.com Eric

    I have mixed feelings about exceptions. They interrupt the programming flow in the same way as goto statements, and it makes it hard to predict what will happen in the program.

  • http://www.benjamintseng.com/ Ben

    He can write his own personals…

  • http://www.benjamintseng.com/ Ben

    It depends on how you use them (I don't think the flow is interrupted too badly if you leave the try, except blocks as far out as possible) — but on my end they're useful as they allow me to communicate more information on what sort of errors the backend encounters (e.g. is this a database error vs. something else)

  • http://blog.benchside.com Eric

    I think the flow is interrupted more if you have the blocks as large
    as possible. I'm talking about following logical/execution flow. If
    you have more blocks, at least you stay local. Also, exceptions (at
    least I've heard) can seriously hurt performance in that you jettison
    the CPU pipeline; this is less of a problem in the parallel processing
    present, but probably still important.

    Some APIs pass back error variables (by reference or by multiple
    return statements). Perhaps we should, too.

    – Eric

  • http://www.benjamintseng.com/ Ben

    You can take that up with Anuraag — I'm going to go with his opinion until I hear otherwise.

  • Pingback: AGIS Visual Field Score Tool