Do you have adblock enabled?
 
If you can read this, either the style sheet didn't load or you have an older browser that doesn't support style sheets. Try clearing your browser cache and refreshing the page.

(Google)   Best... code comment... ever   ( code.google.com) divider line
    More: Amusing  
•       •       •

32569 clicks; posted to Geek » on 27 Apr 2009 at 3:41 PM (8 years ago)   |   Favorite    |   share:  Share on Twitter share via Email Share on Facebook   more»



204 Comments     (+0 »)
 


Oldest | « | 1 | 2 | 3 | 4 | 5 | » | Newest | Show all

 
2009-04-27 09:35:27 AM  
Tears of joy.
 
2009-04-27 09:52:13 AM  
So, he's not a PSD fan, I take it?
 
2009-04-27 10:01:57 AM  
ya, psd is an abortion of a file format.
 
2009-04-27 10:02:06 AM  
Wait... jpeg is bad? Why? :(
 
2009-04-27 10:35:50 AM  
Great, now I'm gonna feel guilty every time I save a file.
 
2009-04-27 10:47:37 AM  
lucky for me, I let other people do that kind of work for me, then appropriate their code. ;-)
 
2009-04-27 11:46:18 AM  
Missed a semi-colon at line... WAIT A MINUTE! You wrote that comment just so you could have a bunch of Farkers proof-read your source code!

SNEAKY bastard!

/...don't actually know what I'm talking about
 
2009-04-27 12:23:38 PM  
//Submitter is a nerd.
 
2009-04-27 12:25:03 PM  

The Icelander: //Submitter is a nerd.


NTTAWWT.
 
2009-04-27 12:26:02 PM  

The Icelander: //Submitter is a nerd.


Cue "Nerrrdddsss" pic.
 
2009-04-27 12:40:28 PM  
For easy reference:

// 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.
 
2009-04-27 12:49:48 PM  
I'd always assumed PSD was meant to be proprietary.
 
2009-04-27 01:05:33 PM  
scroll
scroll
scroll
what are they talking about? I don't see any comments at all ...

... oh!
 
2009-04-27 01:07:15 PM  
I read this before it went green, and emailed it to a few select friends, never thinking in a million years it would actually GO green...

/though it makes me happy that it did
//not subby
 
2009-04-27 01:19:52 PM  
I'd ask someone to explain this to those of us who don't understand WTF is going on here, but as for myself, I'd probably still not understand. I'll just go back to playing with sticks and rocks...
 
2009-04-27 01:30:25 PM  

Slaxl: Wait... jpeg is bad? Why? :(


Because it sacrifices clarity of reproduction for compressability.
 
2009-04-27 01:30:38 PM  

PenguinTheRed: I'd ask someone to explain this to those of us who don't understand WTF is going on here, but as for myself, I'd probably still not understand. I'll just go back to playing with sticks and rocks...


/* You are not expected to understand this */
 
2009-04-27 01:34:14 PM  

PenguinTheRed: I'd ask someone to explain this to those of us who don't understand WTF is going on here, but as for myself, I'd probably still not understand. I'll just go back to playing with sticks and rocks...


You want to butter your bread in the morning to eat with your morning coffee.

You wake up and then ask your wife to grab you a knife while you get the butter and bread.

On Monday, the butter is upside down in the freezer and your wife puts all the knives in the dishwasher and starts it instantly.

On Tuesday, the butter is out of the container and spread out on the kitchen floor and your wife takes a knife and stabs you in the heart.

On Wednesday, the butter is in the refrigerator with a knife in the container...but the lid is welded shut and you are unable to open it.

On Thursday, when you wake up, the butter and knife are already sitting next to you on the bed...but all the bread is moldy and green.

On Friday, you commit suicide.

That's what it is like using PSD.
 
2009-04-27 01:42:31 PM  
I too am confused by this - when you know a better way to code something AND YOU ARE FREAKING CODING IT, well, write better code.

It's like watching a ship's captain mutinying and making himself walk the plank.

- Maybe there is less individual input than I can envision.
 
2009-04-27 01:54:12 PM  

brap: I too am confused by this - when you know a better way to code something AND YOU ARE FREAKING CODING IT, well, write better code.

It's like watching a ship's captain mutinying and making himself walk the plank.

- Maybe there is less individual input than I can envision.


He's an independent programmer who has written an image viewer program. His viewer can display GIFs, JPEGs, and scads of other image formats.
He wants to allow his users to use his program on Adobe Photoshop data, which is stored in .PSD files.
To do that, he had to learn how Adobe's PSD file format works.
These are his personal observations.
 
2009-04-27 02:22:19 PM  

brap: I too am confused by this - when you know a better way to code something AND YOU ARE FREAKING CODING IT, well, write better code.


He's writing a French language interpreter complaining about the French language. He's not inventing the French language.

Comprendre?
 
2009-04-27 02:24:28 PM  

Control_this: I'd always assumed PSD was meant to be proprietary.


I always assumed PSD was meant to keep some aging programmer deep within Adobe in a job for the rest of his life. A bit like the Colonels Secret Recipe.
 
2009-04-27 02:38:13 PM  
with a psd you can save the layers of the photoshop, I guess you can do that in pdf format as well.. who knew it was a such a headache for someone...
 
2009-04-27 02:49:10 PM  
10 READ ARTICLE
20 LAUGH
30 GOTO10
 
2009-04-27 03:05:02 PM  

haemaker: He's writing a French language interpreter complaining about the French language. He's not inventing the French language.

Comprendre?


Not really, my French is limited to "More red wine please". And Please the "More Catherine Deneuve please". Oh and "grapefruit" and "umbrella."

Thanks for the clarification.

It has served me well.
 
2009-04-27 03:26:42 PM  
//really? threads about code,

</fark>
 
2009-04-27 03:43:43 PM  
GOTO PROGRAMING JOKE
GOTO LESS FUNNY THAN
GOTO AIDS JOKE
 
2009-04-27 03:44:50 PM  

DjangoStonereaver: Slaxl: Wait... jpeg is bad? Why? :(

Because it sacrifices clarity of reproduction for compressability.


You sound FLAC.
 
2009-04-27 03:46:03 PM  

albuquerquehalsey: GOTO PROGRAMING JOKE
GOTO LESS FUNNY THAN
GOTO AIDS JOKE


SYNTAX ERROR
 
2009-04-27 03:46:28 PM  
I like that right after that comment block is

dostuff() // sanity check
 
2009-04-27 03:47:15 PM  
Well the fact that this idiot uses 8-space tabs makes me disregard his opinion entirely.
 
2009-04-27 03:47:26 PM  

PenguinTheRed: I'd ask someone to explain this to those of us who don't understand WTF is going on here, but as for myself, I'd probably still not understand. I'll just go back to playing with sticks and rocks...


//Whatever is written after the slashies
//in a computer program
//Is not part of the program. It is only
//read by programmers who are working on the code
//You can put whater you want in here and the users
//won't see it
//Your boss probably won't bother to read it either.
 
2009-04-27 03:50:43 PM  
i177.photobucket.com

/obligatory
 
2009-04-27 03:52:39 PM  

bulldg4life: PenguinTheRed: I'd ask someone to explain this to those of us who don't understand WTF is going on here, but as for myself, I'd probably still not understand. I'll just go back to playing with sticks and rocks...

You want to butter your bread in the morning to eat with your morning coffee.

You wake up and then ask your wife to grab you a knife while you get the butter and bread.

On Monday, the butter is upside down in the freezer and your wife puts all the knives in the dishwasher and starts it instantly.

On Tuesday, the butter is out of the container and spread out on the kitchen floor and your wife takes a knife and stabs you in the heart.

On Wednesday, the butter is in the refrigerator with a knife in the container...but the lid is welded shut and you are unable to open it.

On Thursday, when you wake up, the butter and knife are already sitting next to you on the bed...but all the bread is moldy and green.

On Friday, you commit suicide.

That's what it is like using PSD.


So... PSD is cool to use on Saturdays and Sundays?
 
2009-04-27 03:57:02 PM  

Headso: with a psd you can save the layers of the photoshop, I guess you can do that in pdf format as well.. who knew it was a such a headache for someone...


Yes, but that isn't his real complaint. Mostly its problems of backwards compatability. Photoshop adds new features each version but maintains backwards compatability. Instead of just letting some really old features go, and maybe writing an interpreter for them. So in order to read the PSD file you have to understand years of bugs and stuff. To write something that would read 100% of PSD you'd need and effort similar to writing WINE. Though half-ass compatibility will generally do, even still you have to deal with some really weird standards.
 
2009-04-27 03:57:47 PM  
Ha ha, I don't know what that means
 
2009-04-27 03:58:04 PM  
Meh. I've written flamier.
 
2009-04-27 03:58:10 PM  
Shocker, a programer placed a rant in his commented code? Stop the presses!!!!!! this has to be the first time ever!

I would figure that as far back as computers had keyboards programers have placed "Unrequired" Comments in to their code. It is not original, and the rant in question was not even very amusing.

Headso: with a psd you can save the layers of the photoshop, I guess you can do that in pdf format as well.. who knew it was a such a headache for someone...


Dude it is a programer, they will biatch about anything, hell even their own code.

/got out of the work because I was just like this guy, Every other programer was stupid, everything everybody ever did was wrong and was done to upset me...... One hopes that eventually folks realise they do not belong in the feild and get out.......
 
2009-04-27 03:59:10 PM  
Pussy

This guy has obviously never worked with Government code.
 
2009-04-27 04:01:44 PM  
I've written comments like that.

I can sympathize with the programmer, though I don't recall messing with PSD as a format, I've written my share of code to handle bitmaps in a variety of environments and format. Image formats should be completely independent of the device's requirements - unless it requires the optimization to load it directly in a format that the graphics driver requires (i.e. DirectX).

We should be past byte-alignment, and byte-ordering should be a simple bit flag at the start (or do everything in network byte-ordering as a standard). Everything else should simply be a matter of compression and pixel color depth, and/or color mapping.
 
2009-04-27 04:01:52 PM  
I'd forgotten how awful programming in languages other than Python and Ruby is. That's wicked funny though.
 
2009-04-27 04:04:03 PM  
I've been stuck for the past week writing a chunk parser for IFF and RIFF containers, so I am not looking forward to handling PSD files later on in the project.
 
2009-04-27 04:04:27 PM  

The Icelander: //Submitter is a nerd.


Obvious nerd is obvious?
 
2009-04-27 04:06:10 PM  

solokumba: I'm pretty sure Thomas Knoll doesn't give a rat's ass how this programming hack feels


I love it when people get indignant on behalf of someone else that they don't even know. It warms my heart.
 
2009-04-27 04:06:40 PM  
A Google search for "best code comments" promises abundant entertainment.

//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 16
//
 
2009-04-27 04:06:45 PM  
PSD Appears as if it suffers from repurposing rather than reuse. It probably started its life 20 years ago as a very simple format, and instead of shooting it in the head at some point and making it extensible, they just kept adding stuff to it. Different developers adding different extension, all of whom had different backgrounds (the alignment requirement and non-requirement in the same file is good evidence of that).

Not that I've ever seen this before in practice. No, never. ;-) ;-)
 
2009-04-27 04:07:42 PM  

jfarkinB: Meh. I've written flamier.


Same here, especially if it was software that I felt was a stupid make-work task.
 
2009-04-27 04:08:22 PM  

DjangoStonereaver: Slaxl: Wait... jpeg is bad? Why? :(

Because it sacrifices clarity of reproduction for compressability.


isn't that exactly what it was designed for?

you want quality you get yourself a tif...or even better, a raw file.
 
2009-04-27 04:08:35 PM  
haemaker: Don't hold back. Tell us how you really feel.

/funniest comment in the thread by far
 
2009-04-27 04:11:08 PM  
Off the wall comments like this make me glad to be a programmer. Now I know that the dev team I'm part of is not as crazy as I originally thought.

* CCK 12/12/05 05:27:01 PM: What's this do?
* Looks like legacy 1.x/2.x stuff...
* We'll figure it out in testing, I'm sure,
* and write it some more logical way..


Gotta figure someway to keep from goin crazy I suppose.
 
Displayed 50 of 204 comments


Oldest | « | 1 | 2 | 3 | 4 | 5 | » | Newest | Show all



This thread is archived, and closed to new comments.

Continue Farking
Submit a Link »
On Twitter





Top Commented
Javascript is required to view headlines in widget.

In Other Media
  1. Links are submitted by members of the Fark community.

  2. When community members submit a link, they also write a custom headline for the story.

  3. Other Farkers comment on the links. This is the number of comments. Click here to read them.

  4. Click here to submit a link.

Report