12 ms·
Adobe Photoshop 1.0.1 Source Code (2013)
- xaedes 8y agoMnnn... Light gray text on white background, so hard to read
- fredsted 8y agoThere's something called "Reader Mode" in most browsers now, if you click it, the text becomes readable.
- wierd0 8y agoI know, isn't the future great? To read a web page, just enter an url in chrome, once it has loaded go ahead and click "yes you may track me" then finally "reader mode" and the world is yours.
- chrisseaton 8y agoThe level of contrast of this text does actually meet the 'double A' standard of contrast for body text from the Web Content Accessibility Guidelines.
- sdrothrock 8y ago> His brother John, working at the movie visual effects company Industrial Light & Magic, found it useful for editing photos, but it wasn’t intended to be a product. John Knoll is a name that may be familiar to people who stick around after the credits; he was ILM's supervisor on Generations and First Contact, all the Star Wars prequels, some Harry Potter movies, as well as some of the Pirates of the Caribbean movies. His name comes up a lot in behind-the-scenes interviews etc. with directors about effects.
- irascible 8y agoHe is truly an artist. Some of the user interfaces for his graphics tools he did on the early mac were beautiful in ways I had never seen before.
- doomlaser 8y agoThere are some great interviews with him on YouTube about the original Photoshop: https://www.youtube.com/watch?v=ECgxt8YRHt8 https://www.youtube.com/watch?v=ECgxt8YRHt8
- thomasfl 8y agoJohn Knoll also came up with the plot for the Star Wars Rouge One film released in 2016. Versatile fellow.
- prewett 8y agoHave him write more Star Wars plots! I thought "Rogue One" was the best of all of them.
- boznz 8y ago"There are only a few comments in the version 1.0 source code, most of which are associated with assembly language snippets. That said, the lack of comments is simply not an issue. This code is so literate, so easy to read, that comments might even have gotten in the way." I also find comments do get in the way when they state the obvious, unless they add to the understanding of the code in some way it is best to leave them out IMHO.
- tzahola 8y agoif (status != 0) return -1; // return on error I always get angry when I find comments like this in our codebase.
- ak39 8y agoWhy would a comment like that make you angry?
- spacenick88 8y agoBecause it adds no value
- sudhirj 8y agoBecause it re-states what the code is saying, which makes it two things you wind up reading to absorb one fact. It also create two update points if that code needs be changed. I prefer that authors spend time to make sure the code is clear about what is happening, and use the comments to tell me why it's happening, and that too only when it's not obvious, or counterintuitive, or there for a special requirement. Just wanted to point out that comments are not to be confused with documentation as comments, like Javadoc, Godoc strings. These need to be complete and verbose, especially if they code is a library or public.
- deleted 8y ago[deleted]
- zeth___ 8y ago
- deleted 8y ago[deleted]
- therealmarv 8y agowould be cool to know the percentage of different codebase nowadays.
- dvfjsdhgfv 8y agoI bet there are some Adobe programmers reading HN; I don't think some rough estimates would be a violation of their NDA and I'd be curious to hear them, too.
- mschaef 8y agoMy guess is 100% different, given that they ported it to C++ at some point.
- MontagFTB 8y agoYou'd be surprised. While the code base has expanded on a geometric scale since 1.0 (we're now clocking in around 4-5M LOC), there are still routines that have survived all these years. While the implementation details have changed radically, a lot of the old architectural vestiges are going strong. The more things have changed, the more they've stayed the same.
- cyberferret 8y agoMy very first commercial app, (A pharmacy point of sale system in 1986), was written in Turbo Pascal 1.x. Nice to hear I share some similarities to the early days with a software system that is essentially a household name today. NB: I recently downloaded a copy of Turbo Pascal 1.x and been messing around with it in a DOS box on the Win7 laptop again. No idea where that source code I wrote 40 odd years ago is now, and no way of getting it off any sort of medium it might have been on either!
- rasjani 8y agoMy first work experience was for pharmacy pos system written in Turbo Pascal too :) Implemented stock ordering via modem calling into demodulator.
- xvilka 8y agoWhy not to try FreePascal and Lazarus then?
- mhd 8y agoIf someone's going for TP 1.0 instead of even newer TP versions, I guess nostalgia plays a big role. Up until TP 4 or 5, it didn't have things we take granted now (or heck, in the 90s). Like Units.
- linker3000 8y agoI found some of my old code among a bunch of floppies a while back and stuck it on Github... https://github.com/linker3000/Historic-code-PC-Pascal-and-ASM- https://github.com/linker3000/Historic-code-PC-Pascal-and-AS... I used Turbo Pascal at work in an electronics R&D lab - my biggest achievements were a staff time management program and one that 'drove' a Stag EPROM/PAL/device programmer, so a dev could just point to a device firmware text file in one of a number of formats (Intel Hex etc.) and it would be parsed for errors, sent to the programmer, the right device selected, programmed and verified - this saved a lot of fiddling with the programmer itself. Programmer was similar to this: http://matthieu.benoit.free.fr/Stag_PPZ_Zm2500_programmer_resources_page.htm http://matthieu.benoit.free.fr/Stag_PPZ_Zm2500_programmer_re... I don't have that source code any more but I somehow managed to use TP for some home projects too! Happy days!
- doomlaser 8y agoThe core underpinnings of the Mac, including QuickDraw, were written in Pascal, with some 68k assembly in critical speed sections. QuickDraw began life in 1979 written by Bill Atkinson in Pascal and still ships in MacOS High Sierra. Photoshop originally lifted its main design metaphors and toolbar icons from Atkinson's (and Susan Kare's) MacPaint. MacPaint and QuickDraw source code: http://www.computerhistory.org/atchm/macpaint-and-quickdraw-source-code/ http://www.computerhistory.org/atchm/macpaint-and-quickdraw-... Recent long-form interview with Bill Atkinson: https://www.youtube.com/watch?v=6tUWoy1tJkE https://www.youtube.com/watch?v=6tUWoy1tJkE
- pjmlp 8y agoThe switch to C and C++ only came when Apple decided to cater to the increasing UNIX market pressure. Which was actually C++, given that they tried to port MacApp to C++. While at the same time Metrowerks, which was the major compiler vendor on the Mac, introduced PowerPlant. https://en.wikipedia.org/wiki/MacApp https://en.wikipedia.org/wiki/MacApp https://en.wikipedia.org/wiki/PowerPlant https://en.wikipedia.org/wiki/PowerPlant https://archive.org/stream/ApplePascalHistoryDTC92/ApplePascalHistoryDTC92_djvu.txt https://archive.org/stream/ApplePascalHistoryDTC92/ApplePasc... Comments at http://blog.fogus.me/2017/07/20/pascal-at-apple/ http://blog.fogus.me/2017/07/20/pascal-at-apple/ So plain C always had very little place at Apple, even at NeXT it was all about Objective-C and Objective-C++, including the driver framework. Both A/UX and NeXTSTEP used UNIX compatibility as a means to bring software into the platform, but the goodies were in the platform specific frameworks.
- doomlaser 8y agoPascal had some annoying implementation features on the Mac: Fixed length string types, for example: Str31, Str255, etc. > So plain C always had very little place at Apple, even at NeXT it was all about Objective-C and Objective-C++, including the driver framework. That was at NeXT in the late 80s and only came to Apple after Amelio bought NeXT to use NeXTStep as the Classic Mac OS followup. Apple shipped their first C compiler with MPW 2.0, released on July 20, 1987.
- omegote 8y agoIt would be great if someone did a high level diagram of the source code to have a taste of the overall architecture without having to dig into the code, specially for those who, like me, don't speak Pascal.
- krylon 8y agoFWIW, Pascal, at least when it is reasonably well-written, is super easy to read, even if you have no or little prior experience with the language.
- patrickg_zill 8y agoDoes Pascal allow a programmer to shoot themselves in the foot the way that C does? Does it have safer memory handling?
- narag 8y agoWhat some younger programmers don't get is that allowing to do things is good, the real question is what style a language encourages.
- seba_dos1 8y agoYounger programmers usually believe that the best thing is the one that allows you to effortlessly do anything you want. Only later they start to see that some limitations and hurdles might actually be beneficial.
- narag 8y agoI was careful to qualify "some" programmers and avoid generalization. Some younger programmers like this, some others like that. The difference is in ancient times I don't remember so many people liking discipline languages. Funny thing is Pascal was seen as the constraints language at that time, while C was more liberal. Different times. In Pascal evolution (Delphi and Lazarus), a lot of automatic memory management, including proper gc but most often simple referemce count, has been incorporated over the years. Also the memory for a lot of standard library resources is managed hierarchically. In short: You still need to know how to deal with memory manually, but most of the time you don't.
- fetbaffe 8y agoIt is harder to shoot yourself in the foot with Pascal because you rarely use raw pointers.
- pjmlp 8y agoThe original Pascal not, but the ISO Extended Pascal and all dialects compatible with Apple and Borland ones, yes. The big difference with C is that you need to be explicit that you are going to do something that might go wrong. For example, arrays and strings have bound checking. If you want disable it, you can, either via compiler switch, or a pragma like {$R-} and {$R+} around a code section. Likewise you don't need pointers for out parameters, because references are supported as well. Pointer arithmetic is possible, but first you need to convert the address into a pointer type, then you can manipulate it like on C. Enumerations are their own type, instead of being implicit numbers, without any check if they can be converted back.
- gumballcough 8y agoGood that someone found a use for it. I studied it at Uni and then never used it again.
- laumars 8y agoThat's a weirdly dismissive tone given that Pascal was a massively popular and commercial language before C++ really took dominance. Also worth remembering that lot of early Windows software was also written in Pascal.
- pjmlp 8y agoYes, after using the compilers at my technical school classes, Turbo Pascal for Windows v1.5 was the very first I saved money for, buying it with student discount, about 150 euros on today's money.
- askvictor 8y agoSeems you never had the pleasure of using Delphi then. It was by far the most pleasurable experience I've ever had writing code - in generations to come it will be remembered as the peak of coding ease and efficiency.
- laumars 8y agoI had the opposite experience as I love(d) Pascal but I never did warm to Delphi quite as much. Borland's IDEs were amazing though - for a long time I preferred Delphi's IDE over Visual Studio. And as for Turbo Pascal; even now I look upon that as one of the greatest IDEs ever released.
- pjmlp 8y agoTurbo Vision on MS-DOS was already a good framework, even if it was targeted for TUI applications. Many modern frameworks still aren't as nice to use.
- 8y ago
- wila 8y agoWhat is weird is that it has the exact same acknowledgements as the Eudora article. Including: > Thanks to Steve Dorner, Jeff Beckley, and John Noerenberg for their encouragement and participation in this multiyear odyssey to release the code, and for creating Eudora in the first place. You should be very proud of what you did. edit: I mean it is weird because this was released in 2013 and it has acknowledgements of a another current release. Seems like a template change or something similar.
- m0dest 8y agoCopy pasta.
- buserror 8y agoeverything was written in pascal back then, not just Photoshop. I spent years writing pascal as a professional mac developer before Lightspeed C (which became THINK, then Symantec C later on) appeared... Then I never looked back. MPW (Macintosh Programmer's workshop) was pretty awesome, if slow as hell -- Turbo Pascal was a lot better to work with -- the only issue is that it 'tokenized' your source code, so it wasn't plaint text anymore... I still miss these 'one pass' compilers; I think it peaked with MetroWerks toolchain (which kept a Pascal plugin for a long time!) that was IMO the best compiler/linker/debugger toolset ever made.
- f055 8y agoPascal was a brilliant intro language, but Turbo Pascal IDE – at least for me – made it unbearable (yellow on blue...). It was a bliss when I switched to Visual Studio and C. However, MPW still holds one of my best programming experiences: I discovered it quite late, on an iBook, shortly before Xcode introduction. On MPW I wrote a simple cli math calculator, where you type your full equation like in a notebook – implementing an array walk with pseudo-regex. MPW was simple enough and clear enough that it was the first moment I thought I could really handle coding.
- xxs 8y ago>made it unbearable (yellow on blue...) I take you are not color blind (I never considered it bad at any rate). Also it was configurable, iirc
- f055 8y agoI actually am red-green colorblind – in the dot test, I see the dots are red and green, but I don't see the number in the picture. I just hated how TP looks.
- dvfjsdhgfv 8y agoFrankly, I really miss the Turbo Debugger. The TUI mode of GDB is nowhere near the clarity of the plain old TD. There were some efforts like cgdb but that's not it either.
- AriaMinaei 8y agoWhen I was making some Photoshop extensions [0], I slowly formed a general idea for how it works under the hood. Initially I was really excited to write some code and give Photoshop some super powers. Especially I wanted to make a panel for automatic layout, and another for generative art. But in the end I realised that Photoshop is just not designed to be extensible other than in some very specific ways (filters mostly). I was also convinced that even Adobe probably has trouble putting in new features. This was surprising knowing that most of Photoshop's features don't interact with other features in any way (unlike a word processor or a 3D design suit like Maya). They can even develop the features in silos if they want to. But still, the extension APIs give some strong hints that the whole thing is tangled and unwieldy [1]. I did try to tame the thing [2] but the whole process was so unstable that after a few months of part time work, I just gave up. My conclusion was that if you want to have a design tool with super powers, you can't build it on top of Photoshop (or any of its competitors for that matter). Anyway, this is where I shamelessly self-plug and say that I decided to start a company to build such a tool myself. Write to me [3] if you would like to learn more ;) --- [0] This was one popular extension I wrote: http://gelobi.org/griddify http://gelobi.org/griddify [1] I didn't care enough to document this, but I'm sure there are other extension developers who agree. [2] https://github.com/AriaMinaei/photoshopjs-com/blob/25c320f8304a29ddddacd9b571c921354b15caf7/src/comInterface/Desc.coffee https://github.com/AriaMinaei/photoshopjs-com/blob/25c320f83... [3] aria [at] theaterjs.com
- Retric 8y agoVery large projects like Photoshop need to be able to be worked on by mostly independent teams to cut down on communication overhead. How things work under the hood can end up very different from the API and that's a very good thing.
- AriaMinaei 8y ago> indecent teams I take it you meant independent teams? If so, I did acknowledge that. In fact, the whole interaction model in Photoshop allows it to be developed by independent teams that don't need to communicate much (this is at the expense of some major UX opportunities imho). > How things work under the hood can end up very different from the API I was lead to my conclusion despite knowing that.
- PeterStuer 8y agoThe THINK/Lightspeed Pascal IDE was awesome, way ahead of its time. Coupled with the Apple A4 portrait display it was heaven.
- zengid 8y agoReally cool bit of history! I keep coming back to the idea that studying Photoshop is a great way for learning about how to engineer desktop applications and GUIs. Discovering Sean Parent's _Better Code_ lecture series has been a dream come true!
- dvfjsdhgfv 8y agoThe original title "Adobe Photoshop was written in Pascal" has been changed, and it's a pity - what is important in this story is the fact that the first commercial versions of one of the most popular pieces of software were written in a language frowned upon by many programmers today. Moreover, it shows that you can successfully write the app in one language, then rewrite it in something else while maintaining a smooth continuity between versions.
- paradite 8y agoIndeed that seems to be the moral of the story for a lot of cases that I know of: - plain JavaScript/jQuery to React - Ruby on Rails/Node.js to Golang Many people might dismiss the former as an inferior language, but the point is, you might not have enough time to write a successful software in latter given the time and window of opportunity. And the initial boost of productivity with a simpler language might be important. Of course the reverse can be bad as well when you have an unmaintainable 50k lines jQuery app and nobody wants to rewrite that with a proper framework.
- rasz 8y agoOne of the biggest industry standard PCB design packages, Altium Designer, is written in Delphi (wiki is wrong claiming C#) https://community.embarcadero.com/blogs/entry/altium-designer-15-000-000-codelines-1600 https://community.embarcadero.com/blogs/entry/altium-designe...
- vintagedave 8y agoThere are many big and well-known software packages written in Delphi. Yet Delphi the language is not well known. I recently read an article on Flutter comparing to native Android layouts, and thought to myself: Delphi has had a x-plat framework that does all that, and more, in less lines of code, for six years. (*) Disclaimer: I work for the company that makes Delphi. I do that because I think it and its sister C++Builder are great products and want to see it better-known.
- purerandomness 8y ago
- guylepage3 8y agoAs a long time fan of Photoshop and the Knoll brothers, this is amazing.. Going to figure out a way to pay homage to this code base. Any recommendations are welcome.
- welly 8y agoPrint it out and make a suit from the listing
- todd8 8y agoWhile at Texas Instruments, around 1976, I was in the group trying to move the company to use a more modern programming language. I had learned Pascal while in grad school by studying Wirth’s compiler source so I was happy to be in this department. We had built a commercial, extended, Pascal that ran on the company’s own hardware, microprocessors though minicomputers. The goal was to move the COBOL, Fortran, JOVIAL, and assembly language programmers in the company to Pascal. My department built the compiler and because I had taught programming in grad school I ended up being one of the evangelists that taught innumerable one week crash courses to the company’s engineers, business programmers, and software people. It was actually a really fun job and I met a large number of people that worked in the company’s various branches. I discovered that there is no better way to learn every facet of something than to teach it, more than once, to grumpy students sceptical of the new fangled concepts. A couple years later I was back in grad school again, still programming in Pascal. It was interesting to realize that most fellow PhD students that go straight through aren’t really good programmers and don’t understand software engineering. (This was a long time ago so it’s probably very different now. CS students own their own computers and are able to program much more than we could.) I remember Pascal fondly like some friends remember their first car. Like cars though, the new languages are really much better (safer, faster, more reliable, etc).
- 0xffff2 8y ago>This was a long time ago so it’s probably very different now. As a recent CS undergrad and current software engineer in a research organization, I don't think it is. Most of the people I worked with on group assignments in my undergrad had, at best, a limited understanding of their prior coursework, much less any knowledge acquired on their own time. Furthermore, CS PhDs in my org don't know anything about software engineering and mostly don't care. They are really here to do math. They don't need to write good code because I can transform their mediocre (from an SE perspective) code that handles the base case of a complex algorithm into better code that is maintainable, handles error cases and integrates with the rest of our codebase.
- Msurrow 8y agoI don’t think its different for CS grads today, and I don’t it is supposed to be. CS at a university is not meant to educate software devs; software dev is just one tool of a CS researcher — and depending on research field software dev/languages can be the object og research. A CS grad at uni is meant to teach the student to do CS research, ie. stay in academia. But I think CS grads are very popular for software dev positions, because of their very heavy theoretical knowledge within the field, which provides the basis for becomming a very good software dev.
- mistrial9 8y agoPhotoshop is a MacApp framework project. Apple Inc. designed and built MacApp and was promoting it to the developers with stage time at the Developer's Conference, and by never mentioning or acknowledging other frameworks. Meanwhile, the Think Class Library (C) was designed and written by an individual .. a name given after the group behind Think-C / Lightspeed C got behind it.. The lone designer of the original Think Class Library is named Gregory H Dow. It is a subjective statement, but I believe that more than four times the number of big name Macintosh apps were written in Think Class Library, in C, than Pascal MacApp from Apple.. There was a big interest in C for the Macintosh, while Apple repeatedly pushed their own Pascal, until Apple could control their own C compiler in the Macintosh Programmers Workshop (MPW). (edit- MPW C existed internally at Apple for a long while, but there was some disconnect between that and the developer tools marketing) Gregory H Dow then designed and built a second generation framework using C++, called PowerPlant for Metrowerks CodeWarrior. PowerPlant was used for many, many more commercial applications after that. Pascal faded away on the Macintosh OS, even with the forceful support of Apple.
- deleted 8y ago[deleted]
- wallflower 8y agoThis is a great interview with Thomas Knoll from DDJ about making Photoshop. http://www.drdobbs.com/a-conversation-with-john-knoll/184410606 http://www.drdobbs.com/a-conversation-with-john-knoll/184410...
- bshanks 8y agoStrangely, i find the UI screenshots in the article to be clearer than some modern UIs (eg Gimp). Why? I'm not sure, but maybe: (1) there is less functionality, so less stuff on the screen. (2) Black and white means that the icons are all high contrast. (3) the icon shapes are simpler (compared to Gimp's toolbar icons). (4) the borders on the forms are higher contrast; in Gimp's color picker form, for example, the boxes surrounding places where you can type stuff in appear to be gray, whereas they are black in these early Photoshop pictures.
- neelkadia 8y ago#Help How to run this into latest Mac?