March 01, 2004

If they could C me now

I already wrote many words today, but as they're all in C, I won't post them. I spent the day working on a programming assignment for my computer science class. The resources provided by our teacher were on the null side, so I had to scrounge up pthread tutorials to fill in the gaps. This one was particularly helpful even though the person who wrote it is a terrible speller who insists on using vi. vi doesn't have a spell checker, does it? vi barely lets you type.

If all the programming in the last two years of school has to be in C, they should have had us learn C in the first place, instead of making us spend two semesters on C++. Yes, they aren't that different, but they are different enough that you can spend much time beating your head against syntax that works in one but not in the other. And pure ignorance tends to induce flailing at the keyboard in desperate attempts to try anything—"Maybe it wants more asterisks? Why didn't it like the ampersands? C++ likes ampersands."—that might clear up the parse errors.

Over the course of more hours than I care to contemplate, I reduced four screens full of compile time errors to nothing. Woo! Then I ran my program and got an error message. "Segmentation fault? What's that?" I should just learn to check Google first. After I wasted time looking through the indexes of my computer science books, I found an explanation online. A segmentation fault is what happens when your program tries to access memory that it's not allowed to, usually a pointer problem. "Oh no!" I wail, "There's pointers all through this thing!"

After more flailing, I manage to comment out the bad pointer and get the rest in line. Now it's running well enough that I can work on the logic errors. And, uh, get to that bad pointer.

My eyes are burning. I hope the programmer's hunch I've developed isn't permanent.

334 words | March 1, 2004 10:42 PM | Ivory tower