Category Archives: Uncategorized

Which code layout do you like more?

I can lay out the same function in two ways. Which one is better?

One return statement and a mutable temporary variable


def f(a, b):
    temp = g(a)
    if b:
        temp = h(temp)
    return temp

Two return statements and everything uses single assignment


def f(a, b):
    if b:
        return h(g(a)
    else:
        return g(a)

I prefer the second approach. Ever since I learned how prolog requires single assignment, I avoid updating variables. I’m not adamant about it, but in general, I try not to. It’s just a style thing though. I’ve met a lot of programmers (older ones, usually) that like only having one return statement in a function. I don’t know why they like that, but I’ve heard it from numerous people.

Guest post: 25 things my wife won’t miss about her intern year

My wife wrote this on her facebook page. I loved it.

Awhile back, the “25 Things About Me” meme was pretty popular on Facebook. I’ll admit, I did it- it’s fun to broadcast all these bits and pieces of myself into cyberspace. But it was pretty self-serving. Do any of you really care about my first job, first car, or my most embarrassing moments?

But now there’s something about me that I really do feel like sharing. I’m sounding my barbaric yawp over the roofs of the world.

That’s right, folks. I am no longer an intern.

(Well, technically I am. I still have to go in early tomorrow for bullshit cross cover on 10C. But my months of doing random intern rotations are over the moment I walk out the building tomorrow. I’m spending the last month in radiology; and as far as I’m concerned, it’s a brave new world down there.)

I was an intern on internal medicine, general surgery, the ED, trauma surgery, the PICU, peds urgent care, pathology, and a few other random things like ortho and rheum. I think it’s fair to say I’ve been on almost every service in the hospital. I’ve taken care of neonates in the NICU, and I’ve done autopsies. Seen far too many people die this year, but just one being born (well, I was doing the birthing). Some months were much more emotionally and physically difficult than others. And honestly, there were a lot of fun times. I got lucky and had a pretty nice year overall and met some very cool people. But it still sucked the big one most of the time.

So, fellow interns, soon-to-be interns, people who were interns once, and the curious other few who might peruse this, I give you…

25 Things I Won’t Miss About Intern Year

1. The Goldenrod Form: An ugly yellow piece of paper you have to fill out when patients go to a nursing home. It’s so ugly it hurts my eyes; it’s like pee that sat in a bedpan too long and had half its free water content evaporate off. The space to write meds is horribly small. I’m sure some nurse somewhere couldn’t read my crappy handwriting and gave a patient 400 mg of Lasix qD.

2. Waking up at 4:30 (or earlier, on gen surg) every morning. Falling asleep at 9:30 pm. Falling asleep in the middle of a conversation. Feeling like people in Target/at preschool/my neighbors must think I’m drunk or stoned because my eyes are bloodshot and I can barely get a sentence out.

3. Environmental services staff who buff floors and vacuum rugs right next to us during rounds. You guys do a great job, really, but do you have to literally vacuum under the chair I’m sitting in when I’m post-call and fumbling my way through a presentation?

4. The Trauma Bomb: 6776. I will remember that number forever.

5. Tele alarms. I hear you in my sleep.

6. Watching five fat, breathless hospital cops try to wrestle my demented 78 year-old crackhead patient back from the elevators. Didn’t work. Actually, I might miss this, cause it was so damn funny to watch.

7. Bouncebacks.

8. Short calls.

9. Swallowers.

10. Drunk members of a certain family (well-known to 10C) who threaten me. You know who you are. Next time I’m calling security. I mean it.

11. Kids kept alive, born at 23 weeks, now trached and PEGed and living in an LTAC in between PICU admissions. Sucks.

12. Smelly trachs. It must suck to have a trach, and I don’t mean to make fun of anyone who has one, but sometimes the smell they emit makes me gag. And the stuff that gets sucked out? Forget it. I just threw up.

13. Patients who insist on repeatedly calling me honey, sweetie, lady, or nurse, even after I remind them I’m their doctor. It’s not hard. I call you Mr. Smith. You call me Dr. Wilson. Get it? Apparently not.

14. The ED. I’m sorry, Deb and John, it’s just not for me. No part of it. But please come see me often in the rads reading room. I’ll be the one in the rocker, eating popcorn in the dark with my ipod on.

15. The smell of horrific gingivitis and that weird yellow gunk that accumulates around the teeth of those who don’t floss.

16. Patients who want me to check out “this spider bite on my ass/nuts/labia.”

17. Tripping and dropping 3 pagers down a stairwell, all of which are going off (true story, happened on rainbow surg call one night)

18. Diabetic nails, gnarly toes, scaly skin. Get thee to a podiatrist.

19. The plastic pillows in the call rooms. Covered with microbes due to years of resident sweat and drool accumulating on them.

20. Digital rectal exams. I feel dirty just seeing a package of Surgilube. I apologize to anyone whose behind I violated. I tried to be gentle, really.

21. The Metrohealth Cafe’s weird obsession with fish. Face it, you can’t do a damn thing to make your cod, scrod, tilapia or salmon palatable to me.

22. The smell of poop that permeates 5A/5C SICU. It’s killer.

23. My stethoscope. Like a noose around my neck. Only I don’t wear it around my neck, I keep it in my pocket. Cause I’m cool like that.

24. Calling bullshit consults cause someone else made me do it. Usually to Ortho or Neurosurg. The call is inevitably returned by some snarling dude who talks to me like I’m an idiot.

And finally…

25. Those two dudes who seem to be preying on the unlucky Clevelanders just mindin’ their own business, sittin’ on the porch, or walkin’ home from church. At 3 am.

Actually, I’d like to thank those two dudes. You bring my hospital a lot of business. (Not that we’re getting paid for it, but whatever).

The Houston Chronicle endorses Obama

I’ve been wondering what my historically Republican hometown newspaper would do, and today they endorsed Obama. Here’s an excerpt:

Perhaps the worst mistake McCain made in his campaign for the White House was the choice of the inexperienced and inflammatory Palin as his vice-presidential running mate. Had he selected a moderate, experienced Republican lawmaker such as Texas Sen. Kay Bailey Hutchison with a strong appeal to independents, the Chronicle’s choice for an endorsement would have been far more difficult.

That captures my feelings. If McCain would have stayed true to his remarks in 2000 about Jerry Falwell, and stayed true to his original position on the Bush tax cuts, and then chosen a VP like Joe Leiberman, truly showing his independent nature, then this could have been a very different race.

F U NATURE. THIS MEANS WAR.

My wife looked out the kitchen window this morning and said I should come look and see it for myself.

There were about twenty cornstalks there last night. Each with fat delicious ears. And pumpkins in between them. It was beautiful. And in one night, something showed up and ravaged my corn patch. It wasn’t squirrels. Squirrels don’t have mouths that can strip a cob down like this.

Charlie and I talked about it. He thinks it was probably a lion that ate the corn. I’m not sure I agree. It might be a lion, but it might also be raccoons or possums or deer. You can’t really see it in this picture, but little ants are picking the last bits of goodness out of corn carcass.

This picture shows how whatever it was ate the stalks down to the ground in some places.

For maximum effect, it should have salted the earth, so that nothing would ever grow there again. Maybe it’s waiting for next year. Something similar happened last year.

It doesn’t matter. Next year, those raccoons / possums / super squirrels / lions / deer / garden gnomes or hobbits are in for a violent end. So violent that I will video it and post it to youtube and then watch it get taken down after children everywhere scream in horror after watching it.

This other Matt Wilson is missing.

He’s been gone since December. I’ve been following this since I saw people searching for “Matt Wilson” visiting my site. I don’t know if he ran away, or got abducted, or what else. It sounds like a nightmare for his family.

I hope the kid is OK. There’s a message board on that site and some guy asserts that Matt is living on the streets in Berkeley.

I finally have a project that justifies learning prolog

Sometimes when I’m feeling batty,I’ll put the Three Laws of Robotics in my source code. Usually, this is an veiled insult aimed at myself; the comment is my script is gotten so morbidly complex that it threatens to wake up and kill me.

On a completely unrelated note, I’ve been picking at the edges of prolog for the last couple of years. I’ve worked my way through a free Prolog textbook, and now I’m very slowly working my way through Language, Proof and Logic in order to learn me some predicate calculus.

Now I thought of a project that combines these two. I’m gonna build daydream about defining an ontology suitable for making robots comply with those three laws of robotics. Once I finished, it would work like this:


> Eat baby
Violates law #1!
> Mop floor
OK
> Burn down abandoned house
OK

You get the idea.