Monthly ArchiveAugust 2006



geek stuff 31 Aug 2006 11:15 am

Rebuttal to “Why Learning Haskell/Python makes you a worse programmer”

This post is a response to the blog post by Luke Plant titled Why learning Haskell/Python makes you a worse programmer. Now, in the interest of disclosure and keeping things civil, I actually do like this guy’s blog and particularly enjoyed his post A Django website that took (a lot) more than 20 minutes, and I think he’s shown himself to be quite a competent programmer in the other posts of his that I’ve read. That said, I heartily disagree with his contention that learning Haskell or Python makes you a worse programmer, and here’s why.

To the non-geek-inclined readers of this blog who have made it this far, here is a quick summary of the point/counterpoint. Python and Haskell are somewhat-lesser-used programming languages (read: tools), and his contention is that even though these tools are much better at getting more jobs accomplished it makes it more difficult to get the job done with more popular but inferior tools (in his case, the programming language C# which he is forced to use at work). With license for a little hyperbole, it’s kind of like saying that one shouldn’t learn how to use a Swiss army knife because it makes building things with just a hammer more difficult.

Now for a blow-by-blow. The first argument Mr. Plant raises in his blog entry is that it’s basically a letdown that he can’t use Python or Haskell in his work, because they more accurately reflect how he thinks about the problem at hand. A few choice nuggets from that portion of his entry:

It’s very common for me to notice that using either of these languages I could decrease a chunk of code by a factor of 2-5, and not rare to see a factor of 10-20 in certain parts of the code base.

Further, my experience with Haskell means that I now see potential bugs everywhere in imperative code.

Just reading those two things makes me think he’d be arguing the opposite point of view. At least in the latter one, he’s already improving his coding as a result of knowing Haskell, even though the first quote presents more of a “What if…” scenario that may never happen (since he must use C# at work). But, here’s where I think things start to go wrong:

The net result of these things is to make me very depressed and demoralised. I feel like a human compiler, translating the Haskell or Python in my head into a language which is a whole level lower.

Aha, we’ve found the problem and really it’s not an uncommon one at all. I mean, different programming languages are, after all, different languages. Perhaps often even more so than spoken/written languages. So as anyone who knows multiple languages (of any kind) probably realizes, we often treat the new language as something that we just have to translate to, often word-for-word. But, the new language might have constructions/tenses/idioms that don’t make sense in the original language. However, since we’re unfamiliar with them we tend to avoid them for a while at first. Eventually we adopt them into our understanding of the language and then we can even begin to use them effectively. Once you develop a sufficiently deep understanding of the new langauge, you may even find yourself “thinking in” that language (I’ve done so with Spanish, it’s very interesting). Now, while you may be able to make the smooth transition between the two languages, you’re no longer treating them as two dialects of the same language, you’re recognizing them as the separate languages they really are.

Keeping that in mind, let’s push forward to the second point Luke makes, and that is “using functional style obfuscates your code when using other languages.” (Translation for the non-programmers: literal translation gives messy results) Well, yeah, this shouldn’t surprise anyone, especially anyone who has tried to use Babelfish to translate anything semi-complicated. The tool that Mr. Plant is using (C#) has limited (and relatively new) functional language constructs, and the language wasn’t initially designed with them in mind so they don’t have the nice syntax that Python and Haskell have for dealing with them. As a result, trying to literally translate from Python or Haskell into C#, you get a mess. I mean, yes, it works but it’s ugly and awkward. Much like someone who doesn’t understand English well (but speaks another language fine) might be said to be speaking “broken English”, he is effectively writing “broken C#”. He apparently hasn’t learned to compartmentalize the two languages into different portions of his programmer brain, and is still trying to treat these programming languages as different dialects of some superlanguage (or maybe metalanguage) which all programming languages derive from. Now, in a sense, all programming languages are the same in that they can all quantifiably produce the same results, but lets not confuse Turing completeness with equivalence. Programming is, after all, a process and not a result — it’s not just making sure that you get there, it’s the path that you take to get there.

So, to conclude, it’s not learning Haskell/Python that will make one a worse programmer, it’s trying to shoehorn one language into another that will. Recognizing when is the right time to use certain idioms for certain language is a skill that takes time to develop but should eventually come along.

Uncategorized 29 Aug 2006 03:00 pm

No news is not good news

I still have not gotten any further on getting my car fixed. Repeated phone calls do not get returned, I still don’t have a claim number from this past Thursday’s incident, and I am still at risk for being blamed for the Kinkaid incident. No wonder my anxiety levels have been high and I have been running on a short fuse. I got so irate this morning about some tiny issue at work that I fantasized about quitting. I get wayyyyy too angry these days. You should see me in traffic. Impatience plus explosive anger is not an attractive combination. Ask Danny about the eruption that occurred when I dropped my cell phone on the driveway.

In good news, the famed Yorkie pupies Paris and Molly will be coming to stay at Casa DiPaolo/Whitmore on September 10. It’s gonna be a full apartment with 3 doggies! Expect many nauseating pictures to come.

I have to go back to Kinkaid soon to get my kids. I am scared of that place now. :(

Uncategorized 24 Aug 2006 06:14 pm

Make it stop

On the 1 week anniversary of my accident last week I GET HIT AGAIN. This time I was rear ended in bumper to bumper traffic on San Felipe. He hit me twice - BAM BAM. He screwed up my trunk. My car is now double fucked. I have to deal with 2 insurance companies now. I CAN’T TAKE THIS ANYMORE. More crying. Exhaustion. Depression. Fear.

Uncategorized 22 Aug 2006 11:20 pm

Let’s think back to sexier times . . . .

From an article I read recently:

Justin Timberlake’s second solo album, “FutureSex/LoveSounds,” is set for release Sept. 12. “Sexyback,” his first single from the CD, began playing on U.S. radio outlets last month. “I wanted (the album) to look to a time when everything was really sexy,” he says. “Maybe everybody was coked up, but who cares? It was hot. It was all about sex.”

What a lovely time that must have been. A sexy fun time.

WTF is he talking about?

Uncategorized 21 Aug 2006 09:29 am

Dogs, part deux

Just put up all the pictures of the Yorkies up: view them here. I didn’t filter any of them, so even the crappy photos are up there.

I wouldn’t say I am “madly in love”, but small dogs as cute as that can certainly melt away any bad feelings you’ve got at the time :) The fact that they weren’t yappy like I figured they would be certainly didn’t hurt.

Uncategorized 20 Aug 2006 04:02 pm

Dogs

I submit that Danny took my camera out of my purse on purpose just so I couldn’t get a few photos of my grandmother’s horrific dog, Turkey Girl. Rest assured I will get pictures of her next Sunday. She is a lifeform not to be missed.

When I get home from grandmothersitting I will instead treat you to a dog parade of cuteness as stuffiscool.com features Molly and Paris, two very tiny, very adorable Yorkie puppies. Danny is madly in love. We will be taking care of them a few times over the next few months, culminating in the week we have them for New Years. Gigi has some cousins now.

Uncategorized 18 Aug 2006 12:02 pm

Oooooooh no! MY CAR!

So, yesterday afternoon was a bit wild. I get a call from the principal at Kinkaid telling me to come pick up my tutoring kids because their grandmother had just died and they were crying. At this point, all we knew was that their mom was on a plane to Greece and their dad was somewhere in Florida, so suddenly I was caring for two grieving kids. I didn’t know if I would wind up staying with them while their parents were out of town, so I started to pack a bag but decided I needed to just get to school and get the poor kids and worry about that later.

Okay, so, get to school, got the kids, and now we are backing out into the one-way carpool lane when I see this white car backing towards me- going the WRONG WAY in the carpool lane. I hit the brakes, she doesn’t, and she crunches my car.

I found out this morning at the body shop just how badly she damaged my car. About $3,500 worth of damage, at the low end of the spectrum. She bent the frame. The entire car is shifted off the frame over to the right. It’s going to take at least two weeks to fix because they have to take the car apart and rebuild the back end.

How could she have caused so much damage? You ask. Was she driving a Hummer? No, though that is not uncommon at Kinkaid. She was in a regular old sedan. She must have been backing up really fast.

Fortunately she immediatelly accepted all the blame and apologized profusely and offered to pay for lost babysitting time. (She assumed I was a Kinkaid student, BTW) She wanted to pay for the damages privately and not go through insurance, which stressed me out big time because that’s rsiky for me. But after she found out how much it was going to cost, she balked and said ok let’s call our insurance. So now I am feeling better that it’s being taken care of by the professionals. I am pissed about how much time and stress is involved. BUT it is a learning experience. My dad is not doing evrything for me, as he normally would, he is only walking me through it and making me be the one in charge.

I am growing up so much lately.

Also, I went out and got drunk last night to celebrate my crap day. Thank you, Kelli.

Today’s crap day started with me stepping barefoot in a puddle of doggie diarhhea on my bedroom carpet. There were actually two puddles. Gigi is on my bad list.

Bring it on, Friday, bring it on.

maladies 15 Aug 2006 09:58 am

Shoulder update

Probably against the wishes of my doctor (since I’m only in week 3 of a prescribed 4-week rehab stint), I went to play pick-up ultimate last night. I had actually considered playing in a tournament this past weekend, but thought better of it since I didn’t want to have to take myself out early and leave the team essentially down a player. However, I figured that pick-up would be a better alternative because I could stop playing at any time should I feel the need to, and the intensity is reduced. Basically, it gave me the flexibility to go at whatever speed I felt comfortable with.

Good news: my right shoulder feels fantastic. I played at about a 90% clip most of the time and felt great. I got a little winded early on because I haven’t been working on sprints/short distance running, but luckily the running I’ve been doing gave me the endurance I needed to last the full two hours or so. My hope was that getting some playing in might actually help condition my shoulder(s) a bit and strengthen them, and it seems to have worked. In fact, after pick-up my shoulders both felt as good as they ever have since I injured them. Now that it’s the next day and I’m not feeling sore or anything, I’m pretty confident that not only will I not need surgery, but that I might even be playing competitively in another two weeks (I’m still waiting for my doctor’s visit next Wednesday before playing again full time).

The only bad thing to come out of last night’s experiment? A quarter-sized blister on my big toe from not having run in my cleats for a month and a half. DOH!

funny 14 Aug 2006 09:42 am

The Wisdom of Calvin’s Dad

Apparently it’s been a little over 10 years since Bill Watterson published the last Calvin and Hobbes comic strip, but over on Reddit I found a link to a collection of scientific explanations from Calvin’s dad, and for fans of the comic I think you’ll find them pretty funny. Here are my two favorites (C is Calvin, and D is his dad):

C: Dad, how come old photographs are always black and white? Didn’t they have color film back then?
D: Sure they did. In fact, those old photographs ARE in color. It’s just the WORLD was black and white then.
C: Really?
D: Yep. The world didn’t turn color until sometime in the 1930s, and it was pretty grainy color for a while, too.
C: That’s really weird.
D: Well, truth is stranger than fiction.
C: But then why are old PAINTINGS in color?! If the world was black and white, wouldn’t artists have painted it that way?
D: Not necessarily. A lot of great artists were insane.
C: But… but how could they have painted in color anyway? Wouldn’t their paints have been shades of gray back then?
D: Of course, but they turned colors like everything else in the ’30s.
C: So why didn’t old black and white photos turn color too?
D: Because they were color pictures of black and white, remember?

C: Dad, will you explain the theory of relativity to me? I don’t understand why time goes slower at greater speed.
D: It’s because you keep changing time zones. See, if you fly to California, you gain three hours on a five-hour flight, right? So if you go at the speed of light, you gain MORE time, because it doesn’t take as long to get there. Of course, the theory of relativity only works if you’re going west.

I sometimes wonder if I get a bit of my inquisitive nature from reading these strips growing up. I’m glad my parents didn’t disillusion me like this, though. :)

Uncategorized 09 Aug 2006 09:02 pm

Good times

I found this whilst making my Bon Voyage Maggie slideshow. Is Mary really that tall or is she wearing zoom-high stilettos? Anyhow, this is Mary, me, and two of the Matts, I believe sometimes known as M! and M2 but M2 could be M3 because I get them confused. I was M4 but M! bestowed upon me the title of M! so now it’s all gone to hell. Everyone is just Matt. Or Meg. Or Mary. Yes there are many Ms in my world.

Anyhow this is us at Winter Ball my senior year of college, at Rice. December of 2003. Maggie and I organized this huge party for the seniors with many kegs and 144 bottles of champagne. Everything was gone by the end of the night, including the case of champagne we “forgot” in TravJohn’s room. God that was fun. Mary, you’ll get a kick out of this cuz the boys are all spiffed up:

Winter Ball

Then I also felt I should share this because it’s wicked awesome:

Dane Cook!!!!

Yeah, that’s me with my head about to go under Dane Cook’s shirt. And then that’s Maggie, star of the slide show I’ve been working on all evening. She’s moving to Austin, which really isn’t that far away, but it is for me. Especially considering that right now she lives 3 blocks away. So many people are moving away (including MARY AND TWO MATTS, AHEM).

Anyhow, I gotta get ready to go to Camp Firstbasawassa.

Next Page »