As part of my vacation recovery, I decided to submit a patch to make GPSBabel understand CoPilot version 4 files. I wrote the module for understanding CoPilot files back in 2002, but it only understood version 3. I decided to make it check the version number in the header and do the right thing for any version.
Now back in 2002, I cargo culted the existing GPSPilot code, and what I was doing wasn’t hugely different from what I already had there. But I haven’t written C code for a living since … (checking my resume) … 1994. Since that time, I’ve been coding in C++, Java, and perl. And I haven’t even done C++ since 2002. Grovelling along a “pointer to data” to try and extract some binary data into a format I can use is something that these days I’d do using pack/unpack in perl. C just seems so damn primitive now – almost like something that belongs in the last millenium. And it does. I was so impressed with it when I first started using it. But that was a lifetime ago.
But aren’t pack() and unpack() simply perlish library functions? just doing a printf’ish mangling of a
list of variables seems like it would be well-suited to a similar function in the One True Programming Language(tm); the manpage for pack() is not completely clear (and it’s perl-cutsy. Nybble? Ugh) but it certainly seems like this is a pair of functions that could trivially be written in tOTPL.
And once written, you’d have the perlish functions without the overhead of perl (and without doing the supreme sacrifice of sacrificing perl for p*th*n)