77

My understanding is that in the 1980s, and perhaps in the 1990s too, Pascal and C were pretty much head-to-head as production languages.

Is the ultimate demise of Pascal only due to Borland's neglect of Delphi? Or was there more, such as C being a more robust language? If the latter, what were the perceived advantages of C over Pascal?

I'm interested in historical facts and observations one can back up, rather than likes and dislikes.

Tom Au
  • 893
  • 7
  • 17
Konrad Morawski
  • 9,721
  • 4
  • 37
  • 58
  • 12
    If you basically only have one bankrupting company that supports the language you are working with, it definitely doesn't help (I'm talking about the pre-.Net Borland). – Šimon Tóth Oct 18 '11 at 08:40
  • 52
    One word answer: Unix. – SK-logic Oct 18 '11 at 10:52
  • 1
    I think SK-logic is probably right. My understanding about why MS switched to C from Pascal very early on was because it was easier to find C programmers - due largely, I suspect - because Unix was taking hold in universities. – GrandmasterB Oct 18 '11 at 18:50
  • 4
    Huh. What is `C`? – Lieven Keersmaekers Sep 04 '12 at 11:16
  • 11
    ultimately pascal lost because it uses 1-based strings. – Pieter B Sep 04 '12 at 11:30
  • @PieterB strings being 256 chars was much more of an issue IIRC – jk. Oct 05 '12 at 12:02
  • 7
    @jk: Not to mention that in ISO Pascal, strings could have any length, _but_ strings of different lengths had different types. To uppercase any string, you'd need 256 functions. To append two random strings, you'd need thousands! – MSalters Oct 05 '12 at 13:12
  • 1
    Is it really true that they were ever head to head? I suspect this is a very PC-centric view. I'd guess that C was always way ahead in terms of actual use in production Unix systems right from its invention, and Pascal never got close in terms of number of lines of production code or working programmers. – interstar Feb 12 '13 at 06:27
  • 3
    There's a [similar question on retrocomputing.se](https://retrocomputing.stackexchange.com/questions/6717/what-caused-the-downfall-of-pascal) (also closed) which may have useful answers for anyone researching this question. – Jules Jul 20 '18 at 18:25
  • 1
    And I'll put the same comment here that I did there: I don't believe C had anything to do with the death of Pascal. My personal suspicion is that most of the Pascal programmers moved on to Java. Java has a similar philosophy to Pascal, but launched with a better implementation of object orientation and a broader standard library than Pascal ever had, a situation that only improved over the years. – Jules Jul 20 '18 at 18:43
  • 1
    This is not a subjective question! But most of the answers (including the accepted one) are just list of things they personally don't like about Pascal, which *is* subjective. – JacquesB Aug 17 '20 at 18:14

10 Answers10

52

C is the base of Unix. In the 80s and 90s, Unix got more and more attention. Today some flavour of Unix is in your smartphone.

mouviciel
  • 15,473
  • 1
  • 37
  • 64
  • 19
    Not only UNIX. Windows and its kernels were written mainly in C. Not to mention C++ coming up strong, which also must have made C at least a bit more popular. – Yam Marcovic Oct 18 '11 at 10:06
  • 1
    @Yam, Windows happened when C had already taken over the world – SK-logic Oct 18 '11 at 10:53
  • 2
    @SK-logic It came out in 1984. I wouldn't say C had taken over the world by then. You had Smalltalk, Pascal and others used pretty much everywhere (not to mention COBOL). – Yam Marcovic Oct 18 '11 at 11:08
  • 3
    @Yam: Unix and C were already widely spread in the 80's. When I studied at University (beginning of the nineties), Unix and C was "the platform" every serious developer would have liked to work on. Unix was implemented in C so there would have been no Unix without C. Smalltalk, Pascal and COBOL did not play such an important role. – Giorgio Oct 18 '11 at 12:37
  • 1
    @Giorgio UNIX was actually first fully implemented in Assembler. It still is "the platform" for many people, including myself. But my point was that, while acknowledging it was popular, it hadn't "taken over the world" per se, and other languages were just as widely used back then, with COBOL leading most development (which was more business-oriented rather than personal at the time). – Yam Marcovic Oct 18 '11 at 12:50
  • @Yam Same here: UNIX is my favourite platform and I find developing on other platforms pretty painful. :-) As far as I know, by the 80's UNIX implementations were (mostly) written in C, and a C compiler was available on any UNIX system. – Giorgio Oct 18 '11 at 13:05
  • 1
    Unix hadn't taken over the world at that time, but it had already spread the seeds with early Internet before the 90s and modern Internet since then: WWW dates back early 90s. – mouviciel Oct 18 '11 at 13:08
  • 2
    @Giorgio Indeed after Dennis Ritche and Brian Kernighan had made C stable they re-wrote UNIX in C, hence making it much easier to port to other types of machines. – Yam Marcovic Oct 18 '11 at 13:23
  • @Yam - I thought most of the early 16-bit versions were written in Pascal, and that was the reason for all those pascal calling conventions in the API. –  Oct 18 '11 at 13:55
  • @Steve314 See the [article here](http://en.wikipedia.org/wiki/Windows_API) and have a look at "Wrapper libraries" – Yam Marcovic Oct 18 '11 at 14:00
  • 1
    I don't think the issue is really the existence or popularity of Unix. Because C was developed for and used for Unix proved it could handle serious low-level and systems programming. That is, it was more about image management and the ideals of programmers at the time. Even the inventor of Pascal, Wirth, probably never promoted Pascal for O/S development - he went on to design Modula and Modula 2 for that kind of thing. –  Oct 18 '11 at 14:01
  • 1
    @Yam - actually, it turns out I'm wrong. Search for "Thursday, October 18, 2001" on http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=319 - apparently, the Pascal calling convention was used because it was more efficient, but Windows 1 was written in C. –  Oct 18 '11 at 14:22
  • 2
    @Steve314 Good points. However, as far as I could see, the earlier Windows kernels were developed with Assembler as well. In Assembly, a calling convention is by definition not enforced in any way (hence the word "convention"). So it seems like the fact that it got the name "Pascal calling convention" doesn't necessarily mean that it was pioneered by the inventor of the Pascal programming language, or that Windows was developed in Pascal. EDIT: I just read your recent comment. I guess we don't have anything intelligent to add here at this point. :) – Yam Marcovic Oct 18 '11 at 14:37
  • @Yam - it *certainly* wasn't pioneered by Wirth. Wirth invented a language - not the Application Binary Interfaces (calling conventions etc) for the Microsoft Pascal compilers for DOS. He presumably invented an ABI for his own original Pascal compiler, of course, but only to implement things like function calls within a single program - there was no support for libraries in standard Pascal. –  Oct 18 '11 at 14:50
  • @Yam Marcovic: I think it was C popularity that made C++ popular, not the other way around. – Giorgio Jan 23 '13 at 11:12
  • @Giorgio C made C++ popular indeed, but I don't know about "not the other way around". I'm pretty sure that many people have learned C++ in order to get a job in an OOP era, without ever really working with idiomatic C. But by doing that, they got to know a lot about C itself, hence making it more popular. It's not an argument, by the way, just a humble opinion. :) – Yam Marcovic Jan 23 '13 at 11:36
  • @Yam Marcovic: Maybe you are right. My impression, having started to program at the end of the 80-ies and having learned Pascal, C, C++ (in this order), is that C++ has rather reduced the popularity of C because certain programming tasks that were previously done in C were later done in C++. On the other hand, I am not sure if a C++ programmer today would decide to switch to C. So "C++ making C more popular"? I am not sure (but this is also my humble opinion). – Giorgio Jan 23 '13 at 12:11
  • Please elaborate, what flavor of unix is in my smartphone? – simon Aug 18 '20 at 07:42
  • 2
    @simon - According to [Unix History](https://www.levenez.com/unix/), iOS is derived from BSD and Android is derived from Linux. Their combined marketshare is about 99% (source Wikipedia: [Comparison of mobile operating systems](https://en.wikipedia.org/wiki/Comparison_of_mobile_operating_systems)). – mouviciel Aug 25 '20 at 12:07
48

Pascal has lost the battle mostly because of:

  • Verbosity (if ... then begin ... end, var A: array[0..15] of Integer)
  • Mutually incomprehensible dialects and the official standard
  • Less than impressive object-oriented extensions
  • The most successful and practical dialect - Turbo Pascal - has never been ported to platforms other than DOS/Windows. Plus Borland never opened the sources of the compiler.
  • Pascal's "last hope" - Delphi - was positioned by Borland as a database development platform targeted at corporate environments. This was an unfortunate marketing move (made by marketing people I suppose), because creative engineers hate both databases and corporate environments. Then the failure of Delphi for Linux, Kylix.
  • Apple switched to C and subsequently to Objective-C and thus it killed Pascal as an OS language
mojuba
  • 5,583
  • 2
  • 24
  • 32
  • 20
    Apple's switch to Objective-C came long, long after it stopped using Pascal. The original Macintosh operating system and libraries were written using Pascal, but Apple offered good support for C soon after the Mac's introduction, and had switched over to C by the early 90's. Apple adopted Objective-C when it acquired NeXT, which happened after the return of Steve Jobs in the late 90's. – Caleb Oct 18 '11 at 13:49
  • 40
    I don't think verbosity is a relevant argument. As code is read more than written verbosity has benefits. – johannes Oct 18 '11 at 18:21
  • 3
    Small correction, there was a Turbo Pascal for Mac. And for @Caleb the *API was developed for Pascal*; significant parts of the code were in assembly because some constructs are un-natural in Pascal. There is a portion of the original QuickDraw code floating around out there. It's an interesting read. – dmckee --- ex-moderator kitten Oct 18 '11 at 19:38
  • 3
    @dmckee, There was also Think Pascal, TML Pascal, MPW Pascal, metrowerks Pascal, and probably some others that I've forgotten. You're right about the code -- I didn't mean that it was all necessarily written in Pascal. I'm sure quite a bit was written in assembly, but system calls generally used Pascal-style calling conventions, strings were usually length-prefixed, etc. C compilers on the Mac had extensions for dealing with these kinds of things, such as the 'pascal' keyword that indicated Pascal calling convention. – Caleb Oct 18 '11 at 19:53
  • 1
    *::gets all misty eyed::* I think I still have a MPW golden master disk floating around somewhere. Alas the remains of my pb190cs went into the recycling bin last spring. – dmckee --- ex-moderator kitten Oct 18 '11 at 20:23
  • 15
    Isn't verbosity exactly what is advocated in languages today (python vs. perl)? – Rook Oct 18 '11 at 20:46
  • 6
    Verbosity (I find) is a personal preference. Some people like their languages sparse, other like them a bit chatty. For instance, at the heart of the debate of C# vs. VB.NET is verbosity. C#ers hate VB's verbosity while VBers love it. – System Down Oct 18 '11 at 21:25
  • @System Down irrespective of whether verbosity is good or not, it's a fact that begin...end drove a lot of people away from Pascal to C/C++; also newer languages adopted the { } and none of the languages of the 90's to my knowledge adopted begin...end. Simply less typing (and less reading) is what most programmers want. – mojuba Oct 19 '11 at 07:16
  • 8
    I don't think the verbosity was a cause, on the contrary it is one of Pascal's strengths. –  Oct 19 '11 at 08:55
  • 7
    @mojuba I would be hesitant to throw around the word *fact* if all I had was anecdotal evidence – System Down Oct 19 '11 at 14:49
  • 1
    @System Down OK, but then you have to explain why newer languages use curly braces. Isn't it because we simply like to type less in the end? – mojuba Oct 19 '11 at 15:05
  • 6
    @mojuba perhaps. Or it could be the influence of C. They don't call them C-like languages for nothing. Or maybe something else entirely. The age old adage that is most appropriate here is "correlation is not causation". – System Down Oct 19 '11 at 16:03
  • 10
    This is incorrect. Turbo Pascal was widely successful. The major problem was you could _only_ use it on DOS/Windows. –  Sep 04 '12 at 10:55
  • 1
    @Thorbjørn Ravn Andersen I never said it wasn't successful. (In fact, I used Turbo Pascal and later Delphi throughout almost a decade in the 1990s.) – mojuba Sep 04 '12 at 12:43
  • 2
    Delphi was positioned as it was because Borland's management team had decided that the company would shift its focus from the independent programmer and small shops to "the enterprise". For "the enterprise" Delphi would be a great tool, if Borland had only remembered that decision makers in "the enterprise" are unlikely to embrace something new and radical (the reason a lot of new and radical products with a lot of potential failed in the 1990s) and would rather continue using their old mainframes and minis than invest in "untried technology" (meaning Windows based servers). – jwenting Oct 05 '12 at 10:02
  • 4
    IMHO verbosity such as "var", "then", "end" is not bad, but "i := i + 1", "then begin", and "do begin" are a major nuisance. C increment operators (++, +=), multiple assignment (a = b = 0), "break", "continue" and powerful "for" are a breath of fresh air compared to the rigid and inexpressive Pascal constructs. – marcus Oct 05 '12 at 19:32
  • 5
    Pascal was originally made for teaching purposes, so verbosity was intentional. Still I prefer it for teaching as the code is more readable for beginners than Java or C or Obj-C. – Sulthan Jan 23 '13 at 10:45
  • 1
    A correction : I used Turbo Pascal on my Mac in 1985. It *was* ported. – Denys Séguret Jan 23 '13 at 11:58
  • Turbo Pascal was also closely related to Compass Pascal (released under at least CP/M), sharing a main developer and Turbo Pascal 3 was effectively a UI clone. – Vatine Jan 23 '13 at 14:48
  • 1
    There was also at least at one point [Watcom](http://en.wikipedia.org/wiki/Watcom) Pascal. – user Jan 24 '13 at 09:52
  • 4
    The answer seems to imply that C has a better than "less than impressive" OO extension. :) (scnr) – musiKk Jan 29 '13 at 10:40
  • 1
    There are many reasons, most of them presented in responses here. The big one is library friendliness. Pascal was initially library unfriendly. This was a deliberate choice, to enhance its mission as being a vehicle for teaching beginners how to program. C was library friendly at the outset. Over time, the library can become larger than the language. Witness Java. – Walter Mitty Jul 31 '13 at 11:59
  • 3
    I wonder why this is the accepted answer, as most of the "facts" in it are wrong or at least strongly debatable (I think verbosity was irrelevant, for example). The wording is also odd, as it seems to imply C had a better object-oriented extensions than Pascal (!?). UNIX is the most likely answer and is not even mentioned here. – Andres F. Sep 19 '14 at 12:43
  • 2
    This is all revisionism. Verbosity was never a reason to leave pascal, the users actually loved it for it. The main answer is Unix as a template for OS and toolchain development and the tool C standarization and proliferation that came from it combined with the fact that this happened in the US which was not a Pascal stronghold (Europe was) – Marco van de Voort Sep 06 '16 at 08:06
  • Turbo Pascal was also available on CP/M, as well as Mac. UCSD Pascal, which has a similar set of extensions and is broadly compatible with most programs written for Turbo Pascal that don't use OS-specific calls, was available for almost all common systems from the early 80s into the 90s. I don't think availability of good implementations was a factor. – Jules Jul 20 '18 at 18:36
42

The essay Why Pascal is not My Favorite Language by Brian W. Kernighan covers the main points of critique. (PDF)

C is much more versatile and extendable. Some people even found out how to do (a kind of) object-oriented programming with C! Also, the inline assembler and other low-level features made it an important language for systems programming.

Felix Dombek
  • 2,109
  • 1
  • 16
  • 24
  • 10
    If I remember well, Turbo Pascal (my first programming language, by the way) supported in-line assembler. I've seen Kernighan's essay before. But didn't his criticism outdate soon? – Konrad Morawski Oct 18 '11 at 10:38
  • 2
    @Morawski, TP is from 80s, C is from 70s. It came more than a decade late. – SK-logic Oct 18 '11 at 10:55
  • 10
    @Morawski: Moreover, Turbo Pascal was only one implementation of Pascal. The standard described a language that wasn't particularly useful, so implementors had to put in their own little extensions so people could write useful programs. The fragmentation was likely an issue here. – David Thornley Oct 18 '11 at 14:49
  • @SK-logic, PASCAL was first defined in 1970, and the first compilers were available then. Turbo Pascal showed up ca. 1984, after Jim Tyson went bankrupt when demand for JRT Pascal FAR outstripped his ability to deliver product. Turbo Pascal was initially viewed with considerable suspicion because everyone remembered JRT Pascal, and a *LOT* of people had gotten burned by it. – John R. Strohm Oct 04 '12 at 22:49
  • @JohnR.Strohm, I've been answering Konrad's comment regarding inline assembler in TP. – SK-logic Oct 05 '12 at 04:27
  • 1
    @SK-logic: PASCAL was in commercial use (defense industry) in the mid-to-late 1970s. BBN was using it for the Key Distribution Center for an experimental network crypto system. (They went through two major design iterations that I knew of, the first using raw PASCAL, the second using PASCAL plus a multitasking kernel.) TI-DSEG did a pilot project in 1988, writing a 6DOF simulation in PASCAL. They guys who did it said that the maintainability was SO much better than FORTRAN that they were happy to live with the slight performance hits. – John R. Strohm Feb 06 '13 at 10:44
  • @KonradMorawski: Turbo Pascal never supported inline assembly language, but it did have an "inline" directive which could include symbolic labels as well as raw bytes. There was a popular utility called "inline assembler" which would take a text file written using x86 mnemonics and translate it into a form which could be `{$included}` into code for Turbo Pascal version 2.x or 3.x, or copied into the source for later versions which did not allow use of include directives between a function's header and its code. – supercat Sep 15 '14 at 21:36
  • 2
    That article is from long before the question became relevant, and treats dialects from way before it became relevant. Not relevant. – Marco van de Voort Oct 31 '18 at 16:02
25

Although it wasn't the exclusive use, Pascal was designed for teaching programming, not to be actually used as a primary language.

Delphi and Object Pascal changed that. But at that time, it was already to late.

dns
  • 103
  • 5
Šimon Tóth
  • 882
  • 6
  • 11
  • 4
    However BASIC wasn't designed for professional purposes either, yet it is alive and kicking – Konrad Morawski Oct 18 '11 at 08:48
  • 11
    @Morawski: Really? Apart from VB? –  Oct 18 '11 at 08:51
  • @MarkBannister not that I'd know of, but VB is fairly popular. – Konrad Morawski Oct 18 '11 at 08:53
  • @Morawski Basic maybe wasn't designed for professional use, but it was definitely designed for mainstream usage. Plus Microsoft Visual Basic is 4 years older than Delphi. – Šimon Tóth Oct 18 '11 at 08:53
  • @Morawski VB is from 1991. – Šimon Tóth Oct 18 '11 at 08:54
  • @Morawski: "popular" maybe isn't the right word. The feedback I get from people who work with it, is the most colorful swearing you could imagine. VB is used, because there's legacy code, much like COBOL. Microsoft simply hit a sweet spot with its release. It was a relatively clever move to cater all the kids coming from C64 and Atari, who all programmed BASIC already. BASIC itself is long dead and is no more than long gone ancestry to VB.NET. – back2dos Oct 18 '11 at 09:09
  • 5
    @Let_Me_Be I remember quite a few Windows applications written in Borland (Object) Pascal or Delphi. It was *much* easier than writing them in C/C++. I think that C# and Java serve this domain now. – quant_dev Oct 18 '11 at 09:55
  • 2
    @back2dos There is new VB code written all the time. Banks still love it for Excel-based applications. I've seen complex financial models being prototyped in VB. It's far from dead. – quant_dev Oct 18 '11 at 09:58
  • 11
    Pascal quite soon became a real general-purpose language. Nobody had to wait for Delphi. I don't see how teaching (or being able to teach) many people a programming language when they're young entails its ultimate demise. Quite the opposite. – Yam Marcovic Oct 18 '11 at 10:04
  • @quant_dev: Banks still use it, because they don't see a point in spending a lot of money to train their inhouse IT in other languages/technologies and either pay up for a rewrite (which is close to suicide) or live with a split code base (which is close to self-mutilation). So yes, there is new code written in VB, but still in the scope of old (and therefore stable) systems. – back2dos Oct 18 '11 at 10:10
  • 1
    @quant_dev: Java and C# replaced VB, but they didn't replace Delphi's use case. Delphi is still the only RAD tool that creates native executables. – Joeri Sebrechts Oct 18 '11 at 10:49
  • 11
    @Morawski The only reason BASIC (well, VB) is still talked about and used today is that Microsoft's first product was a BASIC interpreter (pretty sure it wasn't a compiler) and they've kept shoving it down our throats. If they had picked Pascal instead, we'd be talking about VP.Net. The world would also suck less. – MetalMikester Oct 18 '11 at 11:36
  • @MetalMikester: I guess Microsoft picked BASIC because (as back2dos pointed out) a lot of people had gathered some experience with it on the first PC's (IBM, IBM compatibles, C64, Apple ][, and so on). BASIC is a simpler language than Pascal (I do not imply that it is better, of course), and for writing small applications where you mostly have to assemble pre-built library components, it did the job. It allowed programmers with very "basic" ( :-) ) knowledge to develop applications. I do not think that BASIC is good for doing any "serious" development, though. (Maybe I am wrong?) – Giorgio Oct 18 '11 at 13:47
  • @Giorgio: Microsoft's first BASIC was in 1975 or so, several years before the PC, and even before the first Apple and Commodore or TRS-80. The BASIC available on PCs (GW-BASIC, or BASICA if you had PC-DOS) was Microsoft's. It gave a lot of bad habits to people, and continues to do so nowadays, though with the .NET variant it's nowhere near as bad as what it used to be. Its support for the Microsoft.VisualBasic namespace needs to die. – MetalMikester Oct 18 '11 at 15:16
  • @MetalMikester: I forgot to specify I meant Visual Basic. I know there was Basica and GW-Basic before (and other dialects for other PC's). I guess one of the reasons was that the language and the interpreter were smaller than, e.g., a Pascal compiler. I remember UCSD Pascal needed two floppies to work on Apple ][, while the BASIC interpreter fit in the ROM. I think this is one of the reasons why BASIC was so wide spread. Pascal and C were for advanced programmers. :-) – Giorgio Oct 18 '11 at 16:37
  • 2
    You are too young. Turbo Pascal was _extremely_ successful –  Sep 04 '12 at 10:56
  • @ThorbjørnRavnAndersen - It was still popular in the late 90's considering my little old high school was teaching it as an elective. I almost didn't become a programmer because of that class. The good news is I was introduce to an actual programming language 2001. – Ramhound Sep 04 '12 at 12:30
  • People have used C beyond telephone switch software too, which was what Unix (and thus C) was originally aimed at Bell labs. – Marco van de Voort Jul 22 '19 at 11:21
20

I don't think C prevailed over Pascal. For the majority of programmers, Java prevailed over Pascal. The category of programmers who used to program in Pascal, would now pick Java (or C#) for the same job. Those who used to program in C stuck with C (and C++).

The demise of Pascal is IMHO mainly caused by Borland sticking to it's GUI way of working, while its customers moved on to the Web. Borland never had a really attractive offer for server-side development. Only in the last few years, with Delphi dead for all practical purposes, have those who stuck with Delphi moved on to C#. C/C++ has always been a different crowd than the Pascal/Java/C# crowd I think, with the C(++) guys much more technical/low-level in their focus.

Jaap
  • 2,295
  • 16
  • 21
  • 23
    Borland's demise was long before the need for web development. Their mistake was simple: They forgot about what made them a leader in the first place (cheap, fast, efficient compilers available to the masses) and jumped into expensive, corporate tools (where Microsoft and others already had a good head start.) Borland's traditional crowd had to move to something else. – MetalMikester Oct 18 '11 at 16:02
  • @MetalMikester, thats some Grade A truth right there. They tossed aside the small, independent developers while chasing the 'big money' in corporate sales. And unfortunately, there's still some of that left, even with new owners. – GrandmasterB Oct 18 '11 at 18:07
  • that said, they had to deal with their lack of a good option for webapplication development at the same time (stemming from the long insistence on client/server everything in their product line). – jwenting Oct 05 '12 at 10:23
  • 3
    Java and C# have C syntax and are very alike with C, rather than Pascal... also Java was addressed to C++ programmers. – Random42 Jan 24 '13 at 09:30
  • 1
    C totally prevailed and is alive and kicking on small embedded (microcontrollers), running on raw iron. Vast majority of serious development for small embedded is done in C. It's a flavor considerably different from ANSI C, full of `__register` and `__interrupt` and assignment of magic numbers to pointer variables, something that would leave a typical desktop app developer completely clueless, but it's the absolute industry standard. Meanwhile, I don't think I've ever seen Embedded Pascal. – SF. Aug 18 '20 at 14:18
13

To dumb it down: C is a portable assembler, PASCAL is an educational language.

This section on the wikipedia covers it well in fact.

edit:
It would seem, that some here misunderstand my answer. Or actually rather the question.
This question is about popularity. And the reason why C is ultimately more popular than PASCAL is, that one was designed and marketed as a portable language runnning close to the metal, while the other one was designed and marketed as an educational language, enforcing a lot of safety and clarity.
Ultimately, it doesn't even really matter, whether either language failed the goals set for it, or made unanticipated achievements. And anybody trying to deduce the difference in popularity from superiority of C over PASCAL is just plainly wrong.
The key to this question lies in history and the hysteria involved in it.

back2dos
  • 29,980
  • 3
  • 73
  • 114
  • 2
    But even the Wiki entry you are linking to admits that `many major development efforts in the 1980s, such as for the Apple Lisa and Macintosh, heavily depended on Pascal (to the point where the C interface for the Macintosh operating system API had to deal in Pascal data types).` – Konrad Morawski Oct 18 '11 at 08:47
  • @Morawski: Despite the fact that Apple may have undergone tremendous development efforts at the time, and may have created products largely ahead of alternatives, their market share was titchy. Neither Apple or PASCAL is bad (in fact PASCAL was my first language and I still like it). But both failed to meet the needs of the industry's reality. – back2dos Oct 18 '11 at 09:01
  • *C is a portable assembler* seems like a "cargo-cult" argument. I hear this a lot, But I don't think it has any meaning or truth. Care to expand your opinion? – Tamás Szelei Oct 18 '11 at 11:36
  • 1
    @TamásSzelei: "I don't think it has any meaning or truth"? Why not? It is assembler written without resorting to hardware instructions. Specifically, operators like `++` and `--` are direct features of the PDP-11 instruction set. The "pre-increment" and "post-increment" subtlety is entirely a feature of the PDP-11 and the semantics are derived from the hardware. – S.Lott Oct 18 '11 at 12:12
  • 4
    @S.Lott Great, so it's a portable PDP-11 assembler. What is the relevance now? Why should I care about PDP-11 in 2011? C is not a portable x86 assembler by any means. – quant_dev Oct 18 '11 at 12:19
  • 1
    And Lisp is a language for AI research, so what? – mojuba Oct 18 '11 at 13:12
  • 1
    @TamásSzelei: It *is* a cargo cult argument. This question is not about whether PASCAL or C is better, but which is more popular, which is exactly about cargo cult in the first place. – back2dos Oct 18 '11 at 14:56
  • @mojuba: So in comparison to C, it is not widely used. I would go as far as claiming, that it's for that very reason. – back2dos Oct 18 '11 at 15:01
  • @quant_dev: How is current relevance of the argument relevant to the question? PASCAL "lost" to C about 20 years ago. – back2dos Oct 18 '11 at 15:10
  • @back2dos: my point was, the original purpose of a language may or may not be relevant. Lisp is fairly popular now but not because it was meant for creating AI. I'm pretty sure nobody even remembers (or cares) about that these days. Likewise, I didn't care that Pascal was meant for teaching programming when I coded in Turbo. The faith of C in this regard though is pretty straightforward, just like the language itself ;) – mojuba Oct 18 '11 at 15:14
  • 1
    @mojuba: "the original purpose of a language may or may not be relevant" - that's something I totally agree with. My point was, that in this case *it was relevant*. ;) – back2dos Oct 18 '11 at 15:31
  • @quant_dev: "C is not a portable x86 assembler by any means" Funny. It sure appears to be. I can write portable assembler code for an ancient PDP-11 just as well as a modern X86. I need to be cognizant of the underlying hardware so that I can make C code which is both portable and performs as if it was assembler. – S.Lott Oct 18 '11 at 18:19
  • @S.Lott I can write portable C++ code as well, and it doesn't make C++ a "portable assembler". And no, you can't write pure C and expect it to perform as if was assembler. Such things like `malloc` make it impossible. – quant_dev Oct 20 '11 at 11:44
  • @quant_dev: I'm not sure anyone has ever describe C++ as portable assembler. Where did you see that? – S.Lott Oct 20 '11 at 12:42
  • @S.Lott What does it prove? C is not described as portable assembler because it's portable (it isn't), but because it's relatively simple. C++ isn't so simple. – quant_dev Oct 20 '11 at 13:07
  • @quant_dev: "What does it prove?" You're right. At this point, your comments no longer seem to be addressing this answer to this question. – S.Lott Oct 20 '11 at 14:02
  • @fish C is named "portable assembler" because that is why it was designed - to replace assembly code when Unix was to be ported to new cpu architectures. –  Sep 04 '12 at 10:58
  • @back2dos Lisp was originally a desktop exercise too. Somebody else just made it useful. –  Sep 04 '12 at 10:59
  • @ThorbjørnRavnAndersen: Well, if we allow ourselves to take the TIOBE index as an indicator for language popularity, Lisp isn't doing so well either, which would only support my argument. Unfortunately determining language popularity is a little harder than that ;) – back2dos Sep 04 '12 at 14:15
  • 1
    @back2dos "Observe that the TIOBE index is not about the best programming language or the language in which most lines of code have been written" - in other words volume and NOT usefulness, so it doesn't apply here. Similarly Tunnel Drilling Machines are very few, but that does not mean they are not useful - rather the contrary. –  Sep 04 '12 at 20:35
  • @ThorbjørnRavnAndersen: I agree with what you say, but I fail to see how it is related to the question. Usefulness is clearly out of its scope. – back2dos Sep 05 '12 at 07:19
7

During the 70s and into the early 80s, C compilers were relatively easy to come by for personal computers, although most only did a subset of C (which is why you'll see so many different "tiny C" compilers adverts in the older magazines). Pascal was a larger more cumbersome language back in the days when only the wealthiest computer hobbyists had hard drives (and a 5 meg hard drive was several hundred dollars). For the Apple 2 (my first computer, and it wasn't even a "plus"), running Pascal required purchasing an extra memory card (it needed 64k of RAM!) and took several floppies to load up, while "tiny C" compilers fit on a single floppy (and could get by with 16k of RAM).

Pascal was taught in computer science curricula, while C was mostly self-taught (sometimes taught in electrical engineering curricula). Pascal got a reputation among the cowboy coders for being a "bondage and discipline language", which I thought was undeserved as they never met ADA.

The major drivers of Pascal in the 80s were Apple (because the APIs used Pascal calling standards) and Borland. Borland's "Turbo" compilers were probably the best available ones in the marketplace, and the "like a book" license made them a lot more popular than companies with more vicious licensing.

Borland lost their lead in the development market when Microsoft hired away their lead developers and project managers (such as Hejlsberg, Gross and more than 35 others), eventually developing .NET and Visual Studio. Borland and Microsoft settled the lawsuit a couple years later, but Borland never recovered from the loss. In my opinion, Delphi started withering at that time (as the folks who gave it focus and drive were hired away), and the change in CEO at the same time took Borland away from a compiler company into an ALM (application lifecycle management) company, changing their name to Inprise a couple years later. The ashes of Borland are now owned by Micro Focus.

Tangurena
  • 13,294
  • 4
  • 37
  • 65
  • Micro Focus? When did that happen? I thought it was owned by Embarcadero (whoever they are), for the past few years at least. If Delphi is owned by a company that's "famous" for it's COBOL tools... –  Oct 18 '11 at 23:07
  • @Steve314, The "codegear" division was sold to Embarcadero in 2008, and Micro Focus bought the rest of Borland in 2009. http://en.wikipedia.org/wiki/Borland#Later_Borland_years – Tangurena Oct 19 '11 at 13:45
  • 1
    OK, but Borland developed compilers, libraries and IDEs (Delphi, the Builders) and it developed some blah blah blah that no-one ever cared about. Are you telling me that someone cared enough about the blah blah blah to cremate it? –  Oct 19 '11 at 14:12
6

Holy smokes this is a one sided load of hooey, where are all the folks who started out on this site who had Delphi as their favorite language?

Nearly everyone mentions Borland and 2/3rds of the folks consider Delphi to have kicked the bucket. Well, sorry folks, Embarcadero bought the CodeGear unit of Borland a few years ago (for money, not charity) and they've been doing some pretty amazing things, amalgamating some pretty amazing tools into their pretty amazing IDE and creating a pretty amazing platform for cross platform development IN OBJECT PASCAL. Not to mention Lazarus and FreePascal on the open source side of things.

So, if this is a historical question why C prevailed over Pascal, then OK, that's an acceptable claim to start a question. But authorship of code in Object Pascal has been growing, I don't know that the TIOBE index means a whole lot for it, but it should be clear that people are still writing code in Object Pascal and interest spikes whenever Embarcadero releases new tools, therefore actual humans interested in writing new (not just maintaining old) code are interested in Delphi.

I'm not sure you can say the same for anything related to C.

Peter Turner
  • 6,897
  • 1
  • 33
  • 57
  • 3
    It should be dead. The only people who still have a reason to use it are those like me, who are stuck with it because of lots of existing VCL apps. The whole Delphi/C++ Builder IDE has decayed from state of the art into a crappy, buggy mess during the past 5 years. Help files and documentation are non-existant. The debugger is plain embarrassing. If you put the IDE aside, there is really no reason to use the Object Pascal version over C++, unless you need backwards compatibility. The main advantage for C++ in this case is that it will allow you to port your code to escape the crappy IDE. –  Oct 19 '11 at 09:05
  • 1
    Regarding C, first of all it is the completely dominant language in the whole embedded sector and all new tools there are made for C. The whole of Windows _and_ Linux is C. All smart phone fluff is written in C flavours. C or C++ dominates in almost every area of application where programming is used. The C++ standard is getting a major update. The new safe MISRA subsets of both C and C++ are successful for embedded apps, the former turning into industry de-facto standard. So no... there's no interest spikes, there is a constantly high interest. –  Oct 19 '11 at 09:14
  • 2
    @Lundin, are you kidding, I've been using Delphi 7 for the past 4 years, finally updated to 2009 and working in XE2 as well. Finally I don't need to restart the IDE every 5 or 6 builds to keep my breakpoints. Futhermore, Embarcadero has created a way to use Delphi Code for Android and iOS programs which, is new, but is pretty cool, the advantage is that it's wholly managed by a privately held company so the improvements actually make it into the hands of the developers. – Peter Turner Oct 19 '11 at 12:19
  • 1
    Although I'm not really a PC programmer, I've been using Builder to and fro since the mid 90s. It was steadily improving until somewhere around where it turned Codegear, then some gear apparently broke, because it is worse now than it was 10 years ago. Anyway, this is off-topic, since Delphi/Builder started to die out long before the Codegear/Embarcadero fiasco. –  Oct 19 '11 at 12:25
2

My take is that C and major languages derived from it, C++, Java and C#, were embraced by the largest software companies, such as Microsoft and Sun/Oracle, and across the various development stacks. As a result, it became the 'mother language' of Windows, Apple OS's and Unix.

Pascal, in spite of Borland's best and often misguided efforts, didn't achieve that level of market penetration.

jfrankcarr
  • 5,082
  • 2
  • 19
  • 25
  • 3
    This seems to beg the question: why did C take over in the largest companies? MacOS started with Pascal, and became more C-friendly. What was the reason for that? – David Thornley Oct 18 '11 at 14:44
  • 1
    @DavidThornley - I think a lot of it had to do with hiring top notch experienced programmers. C, blended with assembly, was the language of choice for mainstream PC applications starting from the mid-1980's. By adopting a C base, it made hiring of skilled programmers much easier and cheaper (no retraining, etc). – jfrankcarr Oct 18 '11 at 17:28
  • 3
    But you've just pushed the question back one layer. Why did top-notch experienced programmers switch? Why was C the language of choice? Knuth did his first literate programming stuff in Pascal, then switched to C. Why? Finding out exactly who led the switchover may be useful, but the question asks for reasons. – David Thornley Oct 18 '11 at 19:38
  • I worked at two software companies back in the 80's, not in a programmer role but a support role. Based on what I can recall, I suspect that the transition from MASM to C was easier for those already deep into MASM programming. I remember a dislike of Turbo Pascal, which the programmers I worked with called a toy language, and you didn't want to get them started on QuickBasic. I learned MASM and C first because of that peer pressure. That could also be a factor although that doesn't get to the actual genesis of it. – jfrankcarr Oct 18 '11 at 19:58
  • At the end of the 80-ies, beginning of the 90-ies, C was already very popular. You could find a compiler as a standard module in any UNIX implementation (and UNIX was THE operating system most programmers wanted to work on). I am not saying that it was more popular than Pascal, but it was very popular. So C++, Java, and C# are popular because C was, not the other way around. – Giorgio Jan 23 '13 at 11:17
1

Pascal only ever became popular in a single rather limited environment PC/DOS.

Even then there were as many MicroFocus COBOL applications running on PCs as there were pascal applications.

C was the basic of the UNIX operating system and all the MS/Windows operating systems.

The combination of efficient execution on limited hardware, and, native access to the underlying OS and GUI libraries were probably the main reasons for C's success. Pascal never really hacked it on windows, and, Delphi arrived too late to make a difference.

James Anderson
  • 18,049
  • 1
  • 42
  • 72
  • I think that your comment ".. and all the MS/Windows operating systems" may be factually incorrect. Windows was originally designed and coded in PASCAL. From http://en.wikipedia.org/wiki/Talk:X86_calling_conventions: "Just thought I would weigh in here. I looked up the __pascal keyword in the Watcom C/C++ User's Guide, and its clear that: __pascal calling convention was used for OS/2 1.x and Microsoft Windows 3.x APIs " – John R. Strohm Jan 23 '13 at 17:08
  • @JohnR.Strohm Calling conventions and implementation languages are not necessarily one and the same. Microsoft had been using C likely for some time already in 1993 (Windows 3.1 was released in 1992). [Source of a kind](http://www.amazon.com/Writing-Solid-Microsoft-Programming-Series/dp/1556155514) – user Jan 24 '13 at 09:56
  • IIRC in the early 80s Microsoft used Xenix a lot internally, and probably got started on C this way. That, and (Turbo) Pascal after all was the killer product of a dangerous competitor, Borland. Back then the difference in size between Microsoft and other large software companies such as Lotus, Borland... wasn't enormous yet. – wazoox Sep 03 '14 at 14:42