Home > Uncategorized > I never could get the hang of Mondays

I never could get the hang of Mondays

I was eating dinner with a comrade yesterday, and as a part of a conversation on Computer Science, he offered a quip that there is some truth in. He said, after I commented that high-level algorithm classes might be better taught in Python, “But you would rather everything be written in Python.”

He’s right that, all things being equal, I will program in Python above other languages. But things never really are equal, are they? When efficiency is not really a concern, but development time is, Python wins; it’s quick to write, if relatively slow to execute. In working on a side-project that involves a dice-roller, I needed code that could parse a string like “1d4+3+3d6-2”, and when I was inspired as to how to do it well, I booted up Python to do it. The code is quick, simple, and elegant. And since it’s not by any means computationally intensive, the interpreted nature of Python doesn’t really hurt.

Of course, the program this is a part of is written in Java (for portability as well as ease of designing the user interface). I still haven’t gotten around to translating the code by hand, mostly because to do so would require one of two things. The first is to craft a crime against Java: using Strings to act like Python lists. It’s doable, and probably wouldn’t be terribly inefficient, but it would be incredibly inelegant, and especially in defiance of the Proper Java Way. The other is to find something within Java that will allow what I need, which seems doubtful. Actually, that gives a third option: write my own data structure. Yes, perhaps that is the right way to go about things.

Anyways, where was I? Ah, yes, discussing Python and how good it is for so many things. On the other hand, you can’t have Python applets. There are no embedded games that run on Python. Java has more or less exclusive domain over such things.

Java also has exceedingly large utility libraries of all kinds of code, already written, in case you need it one day. I’ve heard this described as something of a negative, but so far it’s not been terribly detrimental to the language, that I’ve seen. Some times you have the time to write out a custom-tailored linked list to do the job you need, but other times, you just need the job done, and java.util.LinkedList is right there waiting.

Honestly, though, at this point, I think the only people left reading are the people who are programmers, and they fall into one of two categories: “genuinely interested in my thoughts on the languages for some reason” or “already have emacs open, typing up a rebuttal of my off-the-cuff 2am musings on programming”. If you’re in the former category, I’ll probably see you at lunch this week. If you’re in the latter category, you really should consider switching to vi. It’s so much better.

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: