State of total clulessness at MSU

It is sad… Not a single person in my Image Processing class has a clue about how text files work. The task is simple – you need to prepend a 3 line header to a binary file. Easy as pie – you create a new file, write out the header, and then just copy everything over from the binary file.

I had like 5 people arguing that you can just easily prepend stuff to files. They were looking at me funny, and trying to explain to me how “you just have to seek to the beginning of the file and insert 3 blank lines”. At first I thought they were just joking, but no – they were deadly serious. I mean, what the hell do they think a blank line is? It’s a fucking ASCII character! Jesus!

This were all graduate students! Every single one of them had a BS in computer science, engineering or electronics or whatnot. But not a single person knew how files work. This is sad…

I mean come on! I know that this is how a text editor works, but text editors do not work on files. They work on buffers! It is easy to prepend strings to beginning of a memory buffer. It is easy to rearrange stuff in memory. It is actually easier, and more efficient to read in and write out a whole file rather than shift it by n bytes to accommodate the header.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: