A recent answer on the topic of compression reminded me of something I did when just getting into the world of computers and programming:
I had found out that in QBasic, a long
uses 4 bytes of memory, as does a single
(float). However, a long
can only take on about four billion different values, while a single
can have magnitudes of 1038. I wondered why nobody had ever noticed this, and got on implementing the best compression scheme of all times by building a large number out of several long
s and storing this number in a single single
. I could even apply this compression several times, and each time the data would be compressed by a constant (and pretty large) factor. I was so smart.
Needless to say, my data came out quite corrupted after uncompressing it again.
So I'm wondering: Are there any similar stories out there? What great ideas have you tried to implement as a newbie in the worlds of bits and bytes and statements, because you didn't know better, only to later find out that the idea was total crap, and it is almost embarassing to think back to it?