rc3.org

Strong opinions, weakly held

Month: March 2003 (page 5 of 12)

M.U.L.E.

As sort of an adjunct to the Greg Costikyan/Warren Spector conversation last week, I link to Salon‘s profile of Dani Bunten, one of the most innovative game designers of the eighties. She was the creator of such incredible games as M.U.L.E. and Seven Cities of Gold.

The article is also a lament for the sorts of games that Bunten created, and it dovetails nicely with Costikyan’s laments about the death of originality and risk taking in the game industry. The conventional wisdom seems to be that the reason games are hard to get made these days is the huge budgets required for sound, graphics, and other glitzy elements that the industry feels are de rigeur. But the question I have to ask is whether that stuff is really necessary to make a successful PC game. Snood is a blast, and it’s one of the ugliest games ever. Popcap makes fun games that don’t have impressive graphics either. Even Civilization and its descendents don’t have incredibly It seems to me that a game with compelling game play and a reasonable price point would do just fine right now, even if it didn’t have the graphics of Unreal.

Reflections on the Bush Speech

If you don’t want to read a superheated rant, please skip this. Did you watch the Bush speech? If you didn’t, you should read the transcript. Based on the statements Bush made, I’d ask you the following questions.

Do you think we’ve done everything we could to avoid war?

Do you believe that we made a good faith effort to bring our case to the United Nations and devise a peaceful resolution to the conflict?

Do you believe that Iraq is an imminent danger to this country?

Do you believe that we’ve created a large coalition that will support us in our effort to depose Saddam Hussein?

Because if you took Bush at his word, you’d have to believe all of those things. I didn’t expect that he’d come on TV and say that we’ve been planning on invading Iraq for at least a year and that despite the fact that we couldn’t make up a story good enough for the members of the UNSC to believe, the war begins this week. I honestly don’t know what I expected.

I’ve given both sides of the debate very serious consideration, and unlike most neocons and warmongers, I’ve actually read The Threatening Storm. What I found today when I heard a reporter on the radio talking about how people in Baghdad were lining up at pharmacies to get all the medicine they can and filling up their cars with gas for all the good it will do is that my reaction against this war is a lot more visceral than I would have imagined. I grew up on the Gulf coast, and I can remember what it was like when we heard there was a hurricane coming. We did what we could and hoped against hope that the coming destruction would miss us, and it always did. What must it be like to be in a city in Iraq right now? You know the destruction is coming, and you know that the only thing that will save you now is luck.

I sit here in America, and I ponder the fact that we’re the people who are about to inflict that on another country. Not because they’ve attacked us, and not because they’re preparing to attack us, but because they might possibly attack us. I won’t argue with anyone who says that Saddam Hussein is a brutal, oppressive dictator who deserves whatever fate befalls him, but there are literally millions of people who are about to stop being Saddam Hussein’s victims and start being our victims. The United States is about to be the disaster that befalls them. And when I look at President Bush, Donald Rumsfeld, and their ghoulish set of war-loving minions, I don’t think they appreciate the gravity of that.

Anti-war poster contest

brushstroke.tv is offering folding money in a contest for the best anti-war poster submitted. The contest isn’t right up my alley — maybe someone will offer a prize for the best anti-war shell script.

The Arrogant Empire

The Arrogant Empire, Fareed Zakaria’s wide ranging article on America’s place in the world, is a must read for, well, everyone. It captures so many of the themes that have been floating around, half formed, in my head, that I’m twice as glad it was written. This sentence confirms every suspicion that I’ve had about our diplomacy under the Bush administration:

Having traveled around the world and met with senior government officials in dozens of countries over the past year, I can report that with the exception of Britain and Israel, every country the administration has dealt with feels humiliated by it.

Read the whole article, though. Zakaria recognizes that people will be more suspicious of the US because we are the lone superpower, but also clearly illustrates how it’s the abuse of that power that has put us where we are.

Reaction

Some people have reacted to my bit comparing Perl and Java from earlier today. I think that my piece came across as trashing Perl, which I didn’t want to do. I like Perl. I write a lot of Perl, and in the past have written a whole lot of Perl. Let me post my simple explanation of my problem with Perl for systems development. Perl gives you many ways to do most things, and many of them are incredibly concise. For the expert programmer, this is wonderful. A guy like Rael Dornfest can cram what would take a whole block of code in most languages into one tiny line of code. My problem is that on most of the projects I’ve worked on, some of the programmers were not what I would refer to as experts. The same goes for maintenance — in many cases, code written by an expert will be maintained by someone who’s not an expert. The more expressive a language is, the more likely it is that non-experts will screw it up.

In some ways, writing code is a lot like speaking a language. Have you ever met that person who is always trying out new words that they saw used somewhere, and getting them wrong every time? The same thing happens with programmers, and a complex language like Perl provides people with a lot more vocabulary and grammar to butcher than Java does. You can butcher Java just as well as you can Perl, believe me, but the potential for doing real damage is greater with Perl.

Dan Lyke says that when you use idioms like the one in my example, people have a hard time with the first one, but then catch on and the conciseness turns out to be a readability advantage. It’s a valid point, and I think it illustrates a general principle that good software engineers follow: consistency matters. Regardless of the construct you prefer to use (there are three examples in my item), make sure that you always use that same construct in similar cases in your code. If you use a for loop for a task in your program, and then a few lines down, you use a while loop for basically the same task, you’re not helping anybody. Over and above indenting your code properly and naming variables properly, establishing a coding style of your own that is consistent and sensible makes you a much better developer.

Speaking of consistency, Mark Hershberger busts me for inconsistency when I say that you could write Perl code just like the Java code that I wrote, but that if you did so, I’d consider you to be a bad Perl programmer. I guess my response to that is that you should use the tools that are available to you. If you’re a Perl programmer, I feel like you should write things in proper idiomatic Perl, and then expect the other people who look at your code to have the Perl expertise to know what you’re doing. Just as I’d say that if you’re porting a Windows application to the Mac OS, it should work like a Mac application. I admire the code in Bloxsom, it’s really well written, but at the same time I had to puzzle over it a bit to figure it out because I’m rusty. That’s not Rael’s fault.

In any case, I like Java for what it is, and I like Perl for what it is. For the type of work I’m doing these days, I find myself preferring Java, but I would never say that Java is better outright. It’s just different.

Update: I just found another well-written response to my Perl and Java comparison. The author is right in saying that I’d be better off stuffing the code into its own function. My intention was to talk a bit about how Perl and Java differ, not explain how one should construct a program. He also says that you should avoid Perl’s idioms, but then the question I ask is whether you should use Perl at all? I know sometimes you have no choice …

The computer book industry

The Register is reporting that Wrox Press is set to close, along with the other properties of Peer Information (like Glasshaus). I’ve never owned a book put out by Wrox, but I think they’re generally well-regarded. Ultimately, though, it doesn’t matter. The computer book industry must be in bad shape all around. I’m sure O’Reilly is still doing alright because they run their business conservatively.

It shouldn’t surprise anyone that now that learning a bunch of computer skills isn’t a guarantee of an above average income and employment for life, people are no longer rushing out to the local bookseller to stock up on books from the computer section. Back in the day, royalties provided me with pretty decent supplemental income. That hasn’t been the case for the past two years at least. If Wrox does bite the dust, my condolences go out to all those authors who won’t be seeing any royalty checks at all from here on out.

Lessig on John Edwards

Larry Lessig posted an interesting recap of a John Edwards campaign appearance. In many ways, I’d like to see Edwards as the Democratic nominee, for some of the reasons Lessig mentions. I think that Edwards would absolutely destroy Bush any time they have to meet head to head. Edwards’ entire career (as a trial lawyer) was built on a foundation of winning regular people over to his position. I think he can do the same thing in this campaign.

Perl and Java

This weekend I was checking out the code for Blosxom. I’m thinking of trying to hack it up and turn it into a package for managing your photo library. Anyway, Blosxom is written in highly idiomatic Perl. If you’ve ever looked at the source code for Greymatter, let me just say that you can think of it as the anti-Greymatter. That’s a good thing. I still hack out Perl scripts somewhat frequently, but I don’t do any development any more in Perl, so messing around with Blosxom is sort of a brain teaser for me.

For example, in Blosxom, you find code like this:

$depth and $depth += ($datadir =~ tr[/][]) - 1;

Unless you’re a pretty serious Perl programmer, you won’t have any clue what that does. In Perl, you can use bare expressions like the one above as statements in your code, creating very concise control structures. That statement could be written more understandably like this:

if ($depth)
{
$depth += ($datadir =~ tr[/][]) - 1;
}

That line inside the if statement is still fairly confusing though. The tr (translate) operator replaces all of the slashes in $datadir with nothing. That’s not what it’s being used for in this case. It also happens to return the number of characters it replaced. So this line of code adds one less than the number of slashes in the variable $datadir to $depth.

As an example of how much functionality you can stuff into one line of code, this statement is an incredible example. It exploits the fact that you can just stick bare expressions in your code, a lesser known usage of the tr operator, alternate delimiters ([] instead of /), short circuiting boolean operators, and more. The same code in Java would look something like this:

if (depth > 0)
{
int count = 0;
for (int i = 0; i < datadir.length(); i++)
{
if (datadir.charAt(i) == '/')
{
count++;
}
}

count--;

depth += count;
}

Clearly the Java code is much more readable, and that's why I like it from a maintainability perspective. That said, if you're really up to speed on your Perl, it's amazing the sorts of things you can compress down into one amazingly byzantine looking line of code. The debate between Perl and Java programmers falls exactly along those lines. The Perl partisans will go to great lengths to tout the expressiveness of the language, which is indeed amazing. But the problem is that few Perl programmers can read code like that, much less write it. I've written tons of Perl in my life, and have worked on a number of Perl books, and I had to think really hard about that line of code (and hit my camel book) to figure out exactly how it worked.

The Java code that I hacked together (without compiling it) is longer, and takes longer to type in, but what it does should be reasonably clear to someone who knows any programming language. When you work on a big team, that's a huge advantage. These days, I prefer using Java, but it's fun to puzzle through a well written Perl program every now and then.

Update: you could write Perl code that looks almost like the Java code above, and it would work, but if I saw Perl code like that, I'd think you were a bad Perl programmer. There are too many easier ways to do it to go down that route (this is both the blessing and curse of Perl, as I've mentioned).

I've posted a follow up to this piece.

Whoops

Looks like the IDF crushed an American peace protestor with a bulldozer while in the process of violating Article 33 of the Fourth Geneva Convention. I guess accidents happen.

Richard Perle’s threatened lawsuit

I’ve been waiting for a story to link to about Richard Perle’s moronic threat to sue Sy Hersh for libel in a British court, but refused to link to the sycophantic and pathetic New York Sun article. Anyway, Slate has a piece up now that sneers sufficiently for my purposes.

Older posts Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑