Insufficiently Random

The lonely musings of a loosely connected software developer.

Wednesday, April 26, 2006

That's Legal?!

Today I found this gem on the GIT mailing list:

Timo Hirvonen wrote:
> Linus Torvalds wrote:
> > +void verify_filename(const char *prefix, const char *arg)
> > +{
> > + const char *name;
> > + struct stat st;
> > +
> > + if (*arg == '-')
> > + die("bad flag '%s' used after filename", arg);
> > + name = prefix ? prefix_filename(prefix, strlen(prefix), arg) : arg;
> > + if (!lstat(name, &st))
> > + return;
> > + if (errno == ENOENT);
> Extra semicolon.

Just what were the authors of C thinking when they decided to allow:

if (errno == ENOENT);

as a legal statement? It clearly has no real purpose as the "then-clause" of the if statement is completely empty.

What's really bad is this language feature is also available in C++, Objective-C, Java, Perl, etc. I'm so glad modern language designers have kept the warts intact.

pg version v0.1.6 Released

I've made quite a few changes to pg since the last listed release of v0.1.1, I just haven't published it on my website.

What Ever Happened To LaTeX?

So I'm reviewing this paper written by a group of students in a senior-year computer science class. It has some math equations, data tables, and some plots and bar graphs. So why is it written in Microsoft Word?

The equations look horrible. In fact I think one of them is a screenshot taken from the assignment (which was written in LaTeX and distributed in PDF) then doctored in Microsoft Paint, pasted into Microsoft Word and resized to take up the desired amount of space. Needless to say it is impossible to read the superscripts as they are quite blurry.

As a graduate student LaTeX is practically my bread and butter. It handles math equations exceptionally well, its page layout rarely needs to be questioned, and it makes cross referencing within your document a breeze. Yet when I talk to many students they don't even know what LaTeX is. When I show them a LaTeX document file they cringe at the thought of not using a GUI editor to write their content.

So what did happen to LaTeX? Why aren't students learning how to use good publishing tools which will save them time, produce better quality output, and not lock them into proprietary file formats? Why is Microsoft Word the only known method of writing documents?

I think its the "Word comes preinstalled, LaTeX doesn't" mentality. Or its the "if I can't click on an icon with a mouse, its too hard to use" mentality. The former is somewhat reasonable; perhaps RPI should be preinstalling LaTeX on all Windows laptops that it sells to students. The latter is simply not a valid execuse for a computer science major.

Or perhaps I'm just discovering that I am already an old fogey and this is a new generation of whippersnappers.