Adobe PSD pushes programmer too far
Inachu
This is awsome! #
Posted Thursday 30th April 2009 19:47 GMT

Maybe more programmers like him will shame adobe coders to eat some humble pie and stop trying to meet deadlines when they still have faulty code.
I would fire those lousy coders at adobe and force them to wite in batch file programming for the next 20 years as punishment.
David Wilkinson
Very useful comments. #
Posted Thursday 30th April 2009 19:47 GMT
There is sometimes a period in which you are studying something and you truly can't tell whether you are just missing the big picture or if what you are working for is in fact a poorly designed, incomprehensible and incoherent mess.
Usually there is an ah-ha moment where you realize what the original designer was thinking, so you keep trying to wrap your brain around it, approaching it from different angles, all with the assumption that the designers choices were part of a rational, well though plan.
What would even be more helpful is if the creator(s) of the format would have dotted their code with comments such as
//This is an ugly hack, but I've been working 24 hours straight surviving on energy drinks
Dominic Kua
I love the next line. #
Posted Thursday 30th April 2009 19:47 GMT

which happens to be a sanity check...
Anonymous Coward
@ David Wilkinson #
Posted Thursday 30th April 2009 21:32 GMT
There's enough bloat in Adobe's wares without packing the code out with comments, surely?
Mr ChriZ
@AC #
Posted Thursday 30th April 2009 22:34 GMT
I really hope you're joking.
Camilla Smythe
Whimp #
Posted Friday 1st May 2009 00:06 GMT
I'd love to have his babies, from the hero aspect, but you just don't cut your salary, present and future, by doing that sort of stuff. Next thing I know he will be unemployed which rather messes with the future of my children.
Fortunately I am less impressed with God. The back I can cope with but not being able to fart, and the rest of the backup, is something else.
Steve
Mixed views #
Posted Friday 1st May 2009 00:06 GMT
While I can understand his frustration entirely, and his desire to rant about incomprehensible formats, I can't help but wonder whether if he had gone through the bureaucratic nightmare necessary to obtain the format specification and documents rather than presumably attempt to reverse engineer the mess, they might have actually helped understand it and made life easier? Probably not, but I can wonder...
Steve.
Brian Miller
Should see ASN.1 x.680 and x.690 #
Posted Friday 1st May 2009 00:06 GMT
While I was writing encoding/decoding software to this spec, I was reminded of The Holy Hand Grenade of Antioch, what with all of the "shall be" and "shall not" when encoding integer types.
The Microsoft implementation simply blew past all of that strict complexity and did it wrong.
Hayden Clark
however.... #
Posted Friday 1st May 2009 00:06 GMT

... the featured rant is the only useful comment in the code. Otherwise, it's "self-documenting"
Colin Barfoot
hindsight always has 50/50 vision #
Posted Friday 1st May 2009 11:41 GMT

The PSD format is very old. It has been forced to do things that were never intended for it and has to maintain backward compatibilty. I'm guessing that in the original version the development was implementation driven so that it would actually work on a machine with 256k of memory and the file format had to accomodate that. The programmer has also chosen to use a language that's more remote from the architecture than the original (probably C) would have been which can only make things more difficult.
Having said that Adobe produces some pretty abysmal formats (or one format rehashed): TIFF / PS / PDF.
Mike
Adobe: Serial code abusers #
Posted Friday 1st May 2009 11:41 GMT

This site speaks volumes about Adobe's development team: http://adobegripes.tumblr.com/
Michael Baldry
can we really believe his words? #
Posted Friday 1st May 2009 11:41 GMT

when he uses a goto statement on line 432 :/
Michael Baldry
spec? #
Posted Friday 1st May 2009 11:44 GMT
Maybe if he had the proper spec from Adobe, he'd have more idea of why things were done the way they were (not saying the format isn't shit, maybe it is...)
Juan Inamillion
@Dominic Kua #
Posted Friday 1st May 2009 11:44 GMT

Don't you mean the 'sanity clause'?
Everyone knows there ain't no Sanity Clause....
/with cigar and glasses
peter garner
@Inachu #
Posted Friday 1st May 2009 11:44 GMT
> I would fire those lousy coders at adobe and force them to wite in batch file programming for the > next 20 years as punishment.
Using edlin.. no sense in making it too easy
Mike Bell
palbuf 768 #
Posted Friday 1st May 2009 11:44 GMT

I particularly like the line "uint8 palbuf[768];" and the liberal use of the number 768 in general. Lovely stuff.
Paris, because she likes to buff up her pals.
Ken Hagan
Re: Mixed views #
Posted Friday 1st May 2009 11:44 GMT

"...if he had gone through the bureaucratic nightmare necessary to obtain the format specification and documents [...], they might have actually helped ..."
Well, as you go on to say, they might but they might not. It depends partly on whether the implementation matches the spec and partly on whether the spec really is the steaming pile of shit that it appears to be. When a company goes out of its way to make it hard to find out, I tend to assume the latter. This is the same company that makes (or certainly used to make) its products available only through a "download engine" that couldn't cope with a NAT, so they definitely have "form" on the clueless tossers front.
Anonymous Coward
@David Wilkinson #
Posted Friday 1st May 2009 13:05 GMT

But *all* my code is an ugly hack, written whilst sustained on Energy drinks! Maybe I should tage the one or two lines that aren't as "#yes. This is good code. Enjoy!"
Big Bear
@David Wilkinson #
Posted Friday 1st May 2009 13:07 GMT
I have been the recipient of such comments of the "Dear Dave, I owe you a proper fix for this hack but it will last through Rel 4.1 unit test. Must fix for 4.2. Cheers, Dave"
There are times when the man to blame and swear at is yourself...
Lionel Baden
ERMM #
Posted Friday 1st May 2009 13:21 GMT
//This is an ugly hack, but I've been working 24 min straight surviving on energy drinks
goes at the top of everything i make !
Anonymous Coward
@ Colin Barfoot #
Posted Friday 1st May 2009 13:45 GMT

Hey! PostScript is not bad. It's a computationally-complete language. Although, a heavy session of PostScript programming does tend to make it hard for you to program anything else except a HP calculator for awhile.
You should try writing a Perl script which generates a PostScript document, then spits it through ps2pdf. I have -- and every single person who has ever seen it thinks it's the DBs.
boltar
@Michael Baldry #
Posted Friday 1st May 2009 14:08 GMT
"when he uses a goto statement on line 432"
So friggin what? If you subscribe to the out of date "never ever use a goto anywhere" paradigm more fool you. If you look carefully you'll notice he was using it to jump out of some nested loops
before the inner loop was commented out. A lot more sensible than the idiotic "if (flag) break" nonsense to do the same I see from the brainwashed Knuth acolytes.
Andrew Shirley
See also #
Posted Friday 1st May 2009 14:08 GMT
http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered
Ed Blackshaw
@@ Colin Barfoot #
Posted Friday 1st May 2009 15:34 GMT
I used to work with someone who had claimed to have acheived that self same task. You are he, AICMFP!
Anonymous Coward
Nice one... #
Posted Friday 1st May 2009 19:12 GMT

Power to the programmer :)
Aaron
Goto statements... #
Posted Friday 1st May 2009 19:12 GMT

...aren't inherently evil. What do you think a JMP statement in Assembler is?
Paris, because she keeps insisting I'm misspelling "jump".
David Halko
I loved the comment... #
Posted Sunday 3rd May 2009 10:22 GMT

I love the comment, "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."
LOL!
Anonymous Coward
I always #
Posted Monday 4th May 2009 16:24 GMT

Ixnay before I entray!
Iam Me
@ Andrew Shirley #
Posted Tuesday 5th May 2009 00:06 GMT

Spent good chunks of the day laughing my ass off at what was posted there. Good stuff.
E
@Michael Baldry #
Posted Wednesday 6th May 2009 19:59 GMT
Properly used, goto is perfectly acceptable.