31

I don't think Objective C was in use from the beginning of Apple hardware development. What languages did app developers use for the earlier Apple computers, such as Apple II or Mac Classic?

JoelFan
  • 7,025
  • 4
  • 38
  • 53

4 Answers4

36

In 1985 Larry Tesler developed a Pascal flavour for Apple, Object Pascal, that became the standard language for System 6. It was based on Clascal, a 1983 Pascal variant for the Lisa, also developed at Apple.

Object Pascal was used in MacApp, Apple's primary application framework at the time. MacApp 3.0, released in 1991, was re-written in C++ and Apple subsequently dropped support for Object Pascal in favour of C++ when they moved from Motorola's 68K chips to PowerPC.

Borland's Object Pascal, that today lives on as Embarcadero Delphi, started out in 1986 as a set of extensions to Turbo Pascal, that were intended to be similar to Apple's Object Pascal. Niklaus Wirth, Pascal's originator, was consulted by both Apple and Borland for their respective variants.

Conversely, Objective C was NeXTSTEP's main language and was introduced at Apple only after they purchased NeXT in 1996.

yannis
  • 39,547
  • 40
  • 183
  • 216
  • 4
    Good answer, but since it's the accepted one you should really add mentions for both Pascal and C. From the very beginning, the Mac Toolbox and OS used Pascal calling conventions and was documented largely with Pascal. There were a number of Pascal compilers available; the most popular was probably Lightspeed Pascal. C was also popular from the beginning, and by the time Think purchased both Lightspeed C and Lightspeed Pascal, C was probably the "standard" choice for indie developers. Also, metrowerks C++ and PowerPlant deserve a mention. – Caleb Dec 03 '12 at 07:01
  • 1
    This answer seems to lean more towards what _frameworks_ were used for development as opposed to which _languages_. The OP's question was about Objective-C (the language), not Cocoa (the framework), but the answer has a paragraph on MacApp (the framework) and little mention of C/C++ other than the fact that MacApp was ported to it. A _lot_ of applications were written directly against the Mac OS Toolbox in Pascal, C, and/or C++. Good answer otherwise, but needs broader coverage of C/C++. – morgant Dec 03 '12 at 18:02
13

The Apple ][ was generally programmed in either BASIC or 6502 machine code.

The Lisa was generally programmed in Pascal.

Early Macintosh apps were written in Pascal, first on the Lisa and later on the Mac itself.

Think Pascal was the most popular development environment for a time and then Think C. Think C had lightweight objects, sometimes referred to as C+-, and later C++. It also had its own class library called, appropriately enough, the Think Class Library.

MPW from Apple was also popular since it allowed you to mix languages (generally Pascal, C, C++, and assembler) and script builds similar to a unix environment, though the syntax was very different.

MacApp was written in Object Pascal, and as someone said, later moved to C++. With the move to PowerPC systems, many programmers switched to Metrowerks CodeWarrior as a development environment and its C++ class library, PowerPlant.

Objective-C was used at NeXT and then for Mac OS X, although Mac OS X applications could also be written in C/C++ via Apple's "Carbon" API. These days most Mac and iOS apps are written in Cocoa/Obj-C, although many have C or C++ libraries underneath.

gnat
  • 21,442
  • 29
  • 112
  • 288
EricS
  • 231
  • 1
  • 4
  • 1
    The Apple /// was also programmed in Pascal (ISTR there was also a variant of BASIC available). I think we used the UCSD pSystem, but there was an Apple Pascal compiler also. – TMN Dec 03 '12 at 20:12
  • The Apple /// was the only Apple computer I never programmed. I do remember a UCSD pSystem for the Apple ][ as well, but I don't think there was a good way to distribute apps written in it. – EricS Dec 04 '12 at 02:49
9

The standard language of Mac OS Classic was Pascal. The OS's API documentation was all written for Pascal, and as much of the OS as was not written in hand-optimized ASM was written in Pascal.

After transitioning to the PowerPC architecture, they rewrote the OS in C++, accompanied by a very noticeable decrease in system stability, which will not be surprising to anyone familiar with Pascal and C++. API documentation continued to be written primarily for Pascal, though, until Steve Jobs came back and started trying to force Objective-C down everyone's throats.

Mason Wheeler
  • 82,151
  • 24
  • 234
  • 309
  • 4
    "accompanied by a very noticeable decrease in system stability, which will not be surprising to anyone familiar with Pascal and C++": Having worked with both languages I can easily believe this. I still sometimes wonder why Pascal (or any object-oriented extension thereof) is currently less popular than C++: after all, development and bug fixing time costs money. Maybe it is because Pascal failed to build a strong and compact community similar to that of C++. – Giorgio Dec 02 '12 at 14:18
  • 1
    Borland was pretty much the only company promoting Pascal. – dan04 Dec 02 '12 at 17:00
  • 4
    Pascal failed mostly because there was no standard (well the standard came too late) and the common subset was too restrictive (you had to rely on extensions to do separate compilation, you had to rely on extensions to write a subroutine able to accept arrays of varying length, you had to rely on extensions to... you name it) – AProgrammer Dec 02 '12 at 17:34
  • 4
    Brian Kernighan wrote ["Why Pascal is Not My Favorite Programming Language"](http://www.lysator.liu.se/c/bwk-on-pascal.html). – Keith Thompson Dec 02 '12 at 20:56
  • @Keith: And what Kernighan wrote ought to be taken with a grain of salt, seeing as how he *also* (co-)wrote the definitive language guide to Pascal's biggest rival. A lot of his gripes are purely stylistic issues, and the ones that were objective problems no longer apply to modern Pascals, and haven't for decades now. – Mason Wheeler Dec 02 '12 at 21:10
  • @AProgrammer, that may have inhibited a language to become the **most** successful, but not otherwise. – acelent Dec 02 '12 at 21:12
  • 4
    @KeithThompson, unfortunately, many people quote that essay as an argument against any Pascal extension. It's like quoting an hypothetical article called "Why C is Not My Favorite Programming Language", which would hypothetically talk about the lack of proper classes and inheritance, and use it as an argument against either C++ or Objective C. – acelent Dec 02 '12 at 21:13
  • 2
    @Paulo: Heck, I'd argue that C++ still doesn't have proper classes and inheritance. If an object is a value type, not a reference type, you've broken LSP, the core principle of inheritance and of OOP itself, from the outset. That's why all the other major object-oriented languages (including Simula, which originated the concept, and Smalltalk, which originated the term "object-oriented programming) *did not do it that way.* – Mason Wheeler Dec 02 '12 at 21:16
  • 2
    @MasonWheeler, but you get the point. Do you have a quote that it was Steve Jobs himself pushing Objective C? As much as we can get from any current or former employee of any company he headed, he was a boss with lots of attention to detail, but not a technical guy, so it's hard to imagine that. – acelent Dec 03 '12 at 00:19
2

... and prior to the Mac (Apple II), most programming was in BASIC. (For all variants of Apple II to the IIgs)

I also recall doing C++ development on System 7 using Metroworks CodeWarrior - this was (of course) post PowerPC.

Chad Thompson
  • 359
  • 1
  • 2
  • 5
    Not really. The old Apples came with BASIC built in, but even by the standards of the day it was regarded mostly as a toy language due to its poor performance and minimal support for sounds and graphics. There were exceptions, of course, but most serious programming on the Apple II systems was done either in Pascal or ASM. – Mason Wheeler Dec 02 '12 at 16:06
  • 2
    Ah - thanks. My programming experience on the Apple II was all BASIC as it was my first exposure to programming in general. (Hence we stuck with BASIC and that instruction set.). I also recall doing "Logo", but I don't know if anyone did any serious work with it. – Chad Thompson Dec 02 '12 at 16:11
  • UCSD Pascal was the only "real" language available for the Apple ][ that I remember, but few if any applications used it. If BASIC was too slow for you, you generally went straight to assembly. – Gort the Robot Dec 02 '12 at 18:10
  • Despite its limitations, I wouldn't doubt that "most programming" those days was done in BASIC. – dan04 Dec 02 '12 at 18:13
  • 1
    @dan04: As far as I can remember assembly was commonly used for programming Apple ][. Switching to monitor mode was one of the first things hackers learnt. – Giorgio Dec 02 '12 at 19:17
  • I use CodeWarrior on my Quadra 700, so it was definitely available on the 68K Macs as well. – TMN Dec 03 '12 at 20:15