Showing posts with label Computer programming. Show all posts
Showing posts with label Computer programming. Show all posts

23 June, 2006

Some depressing programming

Everything wrong with the programming language C, and all the ilk inspired by its incomprehensible syntax, can be illustrated by the following line, which someone used as an example of "good" Perl code:

<eqn>($a==0)?"1":(($a==1)?"<i>x</i>":"<i>x</i><sup><eqn></sup>")</eqn>
Don't feel bad if that orgy of operators makes no sense to you. It makes sense to me, but I desperately wish it didn't. The sad thing is that the same thing can be done quite legibly, even in Perl. People simply choose not to.

Enough griping. Back to work...

... Read More!

08 January, 2006

And so this is... Christmas "vacation"

I have been derelict in updating this weblog, because I've been, ah, "enjoying my vacation." What exactly does this mean?

First, it means an obsessive drive to write computer programs. I highlighted some of them in a previous post. However, a significant amount of work has gone into some other programs that, for the time being, are less easy to "see".

Programming is a pursuit in which an unintelligent machine demonstrates conclusively to intelligent people just what fools they are. Do you think that you are a clever person? Take up programming, and the computer will quickly disabuse you of this notion. The number of mistakes a human being can make in pursuit of solving some very, very simple problems is remarkable, humblingly so.

I also set about working on a generalization of the main result of my PhD research. The actual problem I'm working on can be paraphrased like this: Where should one look to find more of these interesting sets? I worked on it for several days, not counting the occasional dabbling I did, on and off, over the past few months.

Proving theorems is another pursuit that humbles the intelligent. The proof comes in a note I recorded after showing that something couldn't be done: "I should try to generalize this!" No surer sign bespeaks my despair than an optimistic-sounding explanation point.

I sat down the next day to work on it some more. I did not try to generalize that nonsense; I toyed with a completely different approach to the problem. It's a good thing, too; I shocked myself by stumbling onto the proof I had been seeking. What's most embarassing is how "simple" the proof is (to those who understand the background material; sorry, laymen). Of course, I had to spend the next few days cleaning up little oversights in the proof — things like special cases. I had to endure the pain of spending one entire day on the two-variable case; I was very close most of the day, and it turned out to be so simple...

The trouble with all this proving and programming is that it left me with insomnia. I spent several nights lying wide awake next to my wife, my mind racing with ideas on how to fix this final hole, be it in the program or in the proof. I imagined many other things besides, none of them particularly interesting. The mind is a curious thing; I've found that that sometimes it becomes a sort of perpetual motion machine when I push it too hard. It's very difficult to recover after that.

The gift of asthma revisited me, too. Had a pretty bad scare last week: I rode the bicycle to a gas station to buy a newspaper; upon my return, I was coughing and choking worse than I have in a long time. Asthma, like computer programming, is an excellent tool for humbling the proud. To my knowledge, there weren't any allergens prompting this episode; it was simply the cold, dry air, and the lungs' sensitivity after several visiting my parents and their cat. Okay, so the cat's an allergen, but I was back in Rocky Mount at the time.

Needless to say, I'm back on the medicine, for the first time in several months. I'm not complaining; I consider asthma a gift, not a curse. It is, however, one of those inconvenient gifts that require accomodation... Blessed be God, and blessed be his holy name.

... Read More!

04 June, 2005

When you come to a fork in the road, take it

This is for the programming-savvy among you. You know who you are.

My formerly preferred programming language is Eiffel. The compiler I've been using is SmartEiffel. It was the only one I knew that worked for the Mac, although now I discover the aptly-named Eiffel for OS X.

Alas, version 2.x is not exactly compatible with SmartEiffel 1.x. Some of my code compiles; some doesn't. Supplied libraries have changed; formerly case-insensitive keywords (like FALSE and TRUE) are now case-sensitive (apparently — funny, I thought Eiffel itself was supposed to be case-insensitive); even the files that work generate warnings out the wazoo.

Trying to figure out what was going on, I visited the comp.lang.eiffel newsgroup, and began reading anything that might be there.

Hoo-boy. In the words of one frustrated writer:

No one could take their SE 1.x code and compile it with 2.x. Code that worked with ISE Eiffel 5.x, VE 4.x/5.x and SE 1.x doesn't work with SE 2.x.
Apparently the Eiffel language is forking. Someone wrote:
In that respect, we think that indeed ECMA Eiffel has forked from Eiffel. ECMA Eiffel is not Eiffel. ...SmartEiffel is not old Eiffel either, but it looks more like old Eiffel than ECMA Eiffel ever will.
In short: SmartEiffel isn't compatible with its former self, nor with the latest standard Eiffel. The latest standard Eiffel is also not compatible with the former Eiffel. (If I read things correctly.)

Thank God people waited to break things until after I completed my research, or I'd have been really forked.

But wait! there's more!

There's a rumor on C|Net that Apple is considering a switch from PowerPC to Intel chips. I refuse to link to it, but learning about a hardware fork on the heels of learning about a language fork doesn't thrill me one whit.

Look, World: you weren't supposed to take Yogi Berra's advice.

Back to Eiffel. What to do? I could port my code to the SmartEiffel 2.x codebase. This would put me outside the Eiffel mainstream. Of course, if the drums of doom on comp.lang.eiffel are correct (and no one is challenging these basic facts) the Eiffel mainstream will no longer be... ummm... mainstream.

I read a little further in the newsgroups, and one poster asks:
Is there a compiled, object-oriented language that actually would facilitate the production of reusable software and that would be a better choice than Eiffel?
The reply comes:
Ada.
Funny. I had been thinking, Ada's looking better every day.

Now you know what kept me awake until 2.30am: reading all these sordid stories of programming language infidelity.

Sigh.

... Read More!

31 August, 2004

Tax-funded software that harms my productivity

I spent all of last evening programming a Maplet (an interactive Maple object) for a seminar September 8th, to demonstrate the most recent result of my research. It shouldn't have taken all evening, but I make some really boneheaded programming errors.

What's that have to do with tax dollars, you ask? According to mathematical folk takes, Maple originally started life as a research project at the University of Waterloo in Canada. They wanted funding from the Canadian government, and they reasoned that it wouldn't hurt their chances if they named their project Maple (think of the Canadian flag). They were right: it didn't hurt at all.

As for American tax dollars... besides roads, the world's finest military, and my salary (my research is partially supported by an NSF grant), your taxes pay for NASA's JPL, which produced this splendid website: http://space.jpl.nasa.gov/ It simulates the view of one heavenly body in our solar system from another.

I viewed Phobos from Mars, and Jupiter from Europa. If you choose different times, the bodies actually rotate. I wonder how they can predict the weather on Jupiter, but not on earth? :-)

What a fascinating website, and what a great way to waste time! I may never graduate now.

Found this at Steven Riddle's blog Flos Carmeli, where you are bound to find all sorts of wonderful things. Either Steven doesn't have a real job, or he is a terrifyingly fast reader: the man reads and blogs at a rate I can only dream of. He always seems to have new material on his reading list, and remarks on books he's recently finished.

Those who read the links will have noticed Bede's Journal. "Bede" is a British who researches science history (if I've got that right), but his blog advertises itself as The Musings of a Christian Intellectual. His website is a giant library of good Catholic stuff.

... Read More!