View Full Version : Best embedded code comment on record


Alex
April 27th, 2009, 03:35 PM
original link (http://code.google.com/p/xee/source/browse/trunk/XeePhotoshopLoader.m?spec=svn28&r=11)

The comment is about a quarter of the way down. Here's an excerpt:

// At this point, I'd like to take a moment to speak to you about the Adobe PSD format.
// PSD is not a good format. PSD is not even a bad format. Calling it such would be an
// insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having
// worked on this code for several weeks now, my hate for PSD has grown to a raging fire
// that burns with the fierce passion of a million suns.
// If there are two different ways of doing something, PSD will do both, in different
// places. It will then make up three more ways no sane human would think of, and do those
// too. PSD makes inconsistency an art form. Why, for instance, did it suddenly decide
// that *these* particular chunks should be aligned to four bytes, and that this alignement
// should *not* be included in the size? Other chunks in other places are either unaligned,
// or aligned with the alignment included in the size. Here, though, it is not included.
// Either one of these three behaviours would be fine. A sane format would pick one. PSD,
// of course, uses all three, and more.
// Trying to get data out of a PSD file is like trying to find something in the attic of
// your eccentric old uncle who died in a freak freshwater shark attack on his 58th
// birthday. That last detail may not be important for the purposes of the simile, but
// at this point I am spending a lot of time imagining amusing fates for the people
// responsible for this Rube Goldberg of a file format.
// Earlier, I tried to get a hold of the latest specs for the PSD file format. To do this,
// I had to apply to them for permission to apply to them to have them consider sending
// me this sacred tome. This would have involved faxing them a copy of some document or
// other, probably signed in blood. I can only imagine that they make this process so
// difficult because they are intensely ashamed of having created this abomination. I
// was naturally not gullible enough to go through with this procedure, but if I had done
// so, I would have printed out every single page of the spec, and set them all on fire.
// Were it within my power, I would gather every single copy of those specs, and launch
// them on a spaceship directly into the sun.
//
// PSD is not my favourite file format.

xTKx
April 27th, 2009, 04:12 PM
LOL! :D I'm gonna be honest here, I have no idea what PSD is, but his rant was stinkin hilarious!

Techno250
April 27th, 2009, 04:23 PM
Hmmm....

*notes that Alex is in the Bay Area*

Why were you looking at this code anyway, Alex? :D



(BTW, PSD is Adobe Photoshop's native image file format.)

Alex
April 27th, 2009, 04:43 PM
It was linked on fark.com. :)

KnoxNinja
April 27th, 2009, 04:48 PM
PSD is the layered photoshop image format made by Adobe, is it not?

Techno250
April 27th, 2009, 05:11 PM
It was linked on fark.com. :)

K, just wondering... ;)

Snake
April 27th, 2009, 05:39 PM
HHHHMMMM?????
All that computer talk is Greek to me.

xTKx
April 28th, 2009, 07:38 AM
(BTW, PSD is Adobe Photoshop's native image file format.)

PSD is the layered photoshop image format made by Adobe, is it not?

Thanks ya'll! :o

NJD022588
April 30th, 2009, 08:17 AM
lol, thats great! :D

When you finally finish a project at 3am only to realize you have to back through all your code to comment it, you come up with some ridiculous comments. :)

Techno250
April 30th, 2009, 11:33 AM
Wow Nick! That sounds like a comment from experience. Even though the profs in college always said comment as you go, I always commented code afterwards. It seemed to break me out of the coding groove to stop and write something in english! :D

NJD022588
April 30th, 2009, 04:47 PM
It is from experience :D

I cant wait to be done with coding

Bsmith
April 30th, 2009, 05:50 PM
I don't know. I've read some weird code comments. Written a few as well. But hey I'm an old timer so that doesn't count. I QUIT writing code in 2001 or there abouts. I actually started on an old CP/M-80 NCR machine. Wow I feel old.

Techno250
May 7th, 2009, 09:54 AM
CP/M FTW!!!

I was coding (and commenting) COBOL in college. We were at the tail end of the COBOL era. Almost all of my college friends got jobs at banks or insurance companies. Also did a lot of IBM System 370 Assembler. Pascal was "cutting edge" then. One of my projects was on one of those crazy 4th generation "object oriented" languages! LOL!

Right now I'm goofing around with Ruby (and Rails) at work. Ruby has got to be one of the most elegant languages I've ever worked with.

Alex
April 4th, 2013, 12:44 PM
Necrobump. This made me laugh today. Maybe it will make someone else laugh too. :thumbup:

alex.s
April 4th, 2013, 01:34 PM
i laughed at his memory alignment troubles. psd isnt that bad. not compared to some of the **** i've seen. on ps2, you had to program shaders in this arcane cluster**** known as VU2, which was assembler code, but two simultaneous streams of it side by side. and you had to know exactly how long everything was taking and keep the two streams of assembler in sync with each other. (each side of the assembler got ran on a different processor basically) if something got slightly out of sync, the entire system would crash and spit out a bunch of garbage without really telling you anything about why, where, or how it crashed. basically you had to have a working simulation of the ****ing thing in your head before you could ever hope to get it out in code.