You work long hours, for an ungrateful organization wasting time programming around other peoples' mistakes and botched code. And that's in a commercial operation - never mind the unpaid effort that goes into community open-source projects. Venting in code comments, leaving hidden messages, and inserting the odd codified F**k- …
This is awsome!
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.
Very useful comments.
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
I love the next line.
which happens to be a sanity check...
@ David Wilkinson
There's enough bloat in Adobe's wares without packing the code out with comments, surely?
I really hope you're joking.
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.
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...
Should see ASN.1 x.680 and x.690
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.
... the featured rant is the only useful comment in the code. Otherwise, it's "self-documenting"
hindsight always has 50/50 vision
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.
Adobe: Serial code abusers
This site speaks volumes about Adobe's development team: http://adobegripes.tumblr.com/
can we really believe his words?
when he uses a goto statement on line 432 :/
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...)
Don't you mean the 'sanity clause'?
Everyone knows there ain't no Sanity Clause....
/with cigar and glasses
> 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
I particularly like the line "uint8 palbuf;" and the liberal use of the number 768 in general. Lovely stuff.
Paris, because she likes to buff up her pals.
Re: Mixed views
"...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.
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!"
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...
//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 !
@ Colin Barfoot
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.
"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.
@@ Colin Barfoot
I used to work with someone who had claimed to have acheived that self same task. You are he, AICMFP!
Power to the programmer :)
...aren't inherently evil. What do you think a JMP statement in Assembler is?
Paris, because she keeps insisting I'm misspelling "jump".
I loved the comment...
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."
Ixnay before I entray!
@ Andrew Shirley
Spent good chunks of the day laughing my ass off at what was posted there. Good stuff.
Properly used, goto is perfectly acceptable.
- YARR! Pirates walk the plank: DMCA magnets sink in Google results
- Pics Whisper tracks its users. So we tracked down its LA office. This is what happened next
- Review Xperia Z3: Crikey, Sony – ANOTHER flagship phondleslab?
- OnePlus One cut-price Android phone on sale to all... for 1 HOUR
- Ex-US Navy fighter pilot MIT prof: Drones beat humans - I should know