9 ms·
Why Pascal Is Not My Favorite Programming Language (1981) [pdf]
- pjmlp 7y agoThe historical rant against Pascal, where only ISO Pascal is taken into consideration lest not weaken the argumentation, most of the negative issues regarding strings, open arrays, pointer usage and procedure/function pointers were sorted out by UCSD Pascal, Turbo Pascal, Object Pascal (at Apple and later Borland) and ISO Pascal was later reviewed into ISO Extended Pascal.
- kragen 7y agoYes, they each sorted them out. (I'd mention VMS Pascal, too.) But they sorted them out differently, so if you were, for example, writing Software Tools in Pascal, as Kernighan had, you couldn't use their solutions; they were incompatible from one system to the next. ISO Extended Pascal did not solve this problem even when it was published in 1991, ten years after this paper, because even today it's not universally supported; for example, FreePascal still doesn't support it. In a few cases, like TeX and STiP, the solution was to write in standard Wirth and Jensen Pascal, despite the inconveniences. Most people instead resigned themselves to writing nonportable code. By the way, I see that the comment window has closed, but I'm still interested in your thoughts on https://news.ycombinator.com/item?id=22083468 https://news.ycombinator.com/item?id=22083468 — it represented a fair bit of effort on my part, and it's disappointing that you haven't answered at all.
- pjmlp 7y agoYeah that is the other typical argument, where it gets "forgotten" that outside UNIX in 1981, C was equally non-portable with dialects of K&R C everywhere like Small-C, RatC and plenty of others, taking yet another 10+ years for a standard to come up and respective compilers to catch up with it.
- AnimalMuppet 7y agoSo? Does that make anything kragen said untrue? This is just whataboutism, only on technical rather than political topic. [Edit: On reflection, you're addressing a different topic. The question the rest of us are talking about is "was Pascal that bad?". And the answer is, "yes". You want to talk about something else - Pascal vs. C. But in C, you could at least do "#ifdef Compiler_A" to achieve "portability". Yeah, it's not very good portability, but you could get to one source file that would compile with different compilers. For Pascal, so far as I know, you couldn't do even that much.]
- pjmlp 7y agoAll Pascal dialects supported conditional compilation.
- AnimalMuppet 7y agoThey did? I don't remember that. What was the syntax? Or was it that all post-Jensen-&-Wirth dialects supported conditional compilation, and I don't remember it because I was stuck on Jensen & Wirth?
- clouddrover 7y agoYou keep talking about what Pascal was. That no longer matters. What matters is what Pascal is today. Both Free Pascal and Delphi support conditional compilation and have done for a long time: http://docwiki.embarcadero.com/RADStudio/Rio/en/Conditional_compilation_(Delphi) http://docwiki.embarcadero.com/RADStudio/Rio/en/Conditional_... https://wiki.freepascal.org/Conditional_compilation https://wiki.freepascal.org/Conditional_compilation
- AnimalMuppet 7y agopjmlp said "supported", no "support". He and I were talking about the past. We're allowed to do that - to have the subject be what we want, rather than what you think it should be. In fact, the article was about Pascal circa 1981, so I'm not sure why you think the discussion ought to be about present-day Pascal.
- SideburnsOfDoom 7y agoI used to encounter this article _all the time_ in the late 1990s as an argument against Borland Delphi, which was by far the most widely used Pascal variant then. You can reply point by point about how it is factually wrong about Delphi: e.g. > There is no break statement for exiting loops. Delphi has a "break" statement. (1) > case statement ... there is no default clause Yes there is, the "else" case. (2) Many of these "extended syntax" features were likely added due to the criticisms in this paper. So in one sense the paper was valuable in causing that, in another sense it's usefulness was over by the late 1990s. And then the eventual fallback argument is: "Ok, then Delphi is not Pascal" which was technically true, but then this article is allowed to stand as "an argument against Pascal (not Delphi)" ... and is soon picked up again as an argument against Delphi (because it's "Pascal" ). Round and round it went. So tiresome and ignorant. 1) http://www.delphibasics.co.uk/RTL.asp?Name=Break http://www.delphibasics.co.uk/RTL.asp?Name=Break 2) http://www.delphibasics.co.uk/RTL.asp?Name=Case http://www.delphibasics.co.uk/RTL.asp?Name=Case
- mseepgood 7y ago> And then the eventual fallback argument is: "Ok, then Delphi is not Pascal" which was technically true, but then this article is allowed to stand as "an argument against Pascal (not Delphi)" It wasn't even true for Turbo Pascal before Delphi.
- BadThink6655321 7y agoOf all the nails that could be used to seal Pascal’s coffin, the one I use is that I can’t write ‘writeln’ in Pascal. Other than that, it was great in it’s time (mid 70’s for me).
- SideburnsOfDoom 7y agoThings such as "implement the 'writeln' function" fall under the umbrella of "operating system interop" or "Foreign function interface", don't they? Any general-purpose programming language, pascal or not, will eventually have that. But it might not be in a general language standard.
- ken 7y agoI think the point is that it’s not so rare that one might run into this type of situation. The article even mentions one. > It is unfortunate that there is no way to make this convenience available to routines in general.
- clouddrover 7y ago> I can’t write ‘writeln’ in Pascal Let's not talk about Pascal from over 40 years ago, let's talk about today's Pascal. Why can't you write "writeln" in today's Pascal?
- ken 7y agoAccording to Rosetta Code [1], “Standard Pascal does not allow variadic functions” — though specific implementations have proprietary extensions which allow this. [1]: https://rosettacode.org/wiki/Variadic_function#Pascal https://rosettacode.org/wiki/Variadic_function#Pascal
- clouddrover 7y agoWhich compiler are you going to use for "standard pascal"? The Pascal compilers you're going to use in practice are either Free Pascal or Delphi. They are what Pascal is today: https://rosettacode.org/wiki/Variadic_function#Free_Pascal https://rosettacode.org/wiki/Variadic_function#Free_Pascal
- xet7 7y agoThat is about historical Pascal that existed at 1981. I don't know does that Pascal version run on current computers anymore. Nowadays there is FreePascal and Lazarus, that support many platforms and have a lot of features.
- aequitas 7y agoMy programmer career started in my teenage years when my uncle lend me a book about programming serial/parallel ports on an IBM compatible PC. The book would explain a certain concept and then give different code examples in two languages BASIC and Pascal. However the variable names in the Pascal examples where in German, those from BASIC where in English. My teenage self therefore thinking Pascal was a 'German' programming language so I stuck with the BASIC examples, learning programming was complex enough without having to learn German as well. Only later in school when I got lessons in Pascal it struck me it was just as English as BASIC.
- deleted 7y ago[deleted]
- Jemm 7y agoI miss pascal. It was a language that was easy to read, unlike C.
- unnouinceput 7y agoAnd who's stopping you to write things in Pascal these days? Lazarus + Free Pascal has plenty of platforms as target. Heck you can run Lazarus on Raspberry Pi and create stuff for Rasbian right there on your RPi device.
- gmfawcett 7y agoThere's also Ada, which is not the same language but which was heavily influenced by Pascal.
- cure 7y agoI started on Pascal too. These days I like Go, in big part for its readability.
- mikewarot 7y agoI did too... but plowed forward with a project in Python... until it stalled.... took about 20 hours and re-implemented it in Lazarus/Free pascal, and haven't looked back since. It's not quite as solid as Delphi was, but then again I don't have $5k to dump on a compiler right now.
- albanread 7y agoI miss it too; Pascal (Delphi) used to be one of my favourite compilers; until Dennis in tech support refused to reset my version 10.2 license registration limit the other day.. Time to move on I guess.
- tpmx 7y agoTurbo Pascal 6.0 was a fantastic programming environment for DOS. The inline assembler feature (the "asm" statement) was awesome! It allowed you to build demo scene-quality effects for the VGA while doing most of the grunt-work in high-level Pascal. This is why e.g Fast Tracker, Crystal Dreams II (Triton) and Second Reality (Future Crew) were all built in a combination of Turbo Pascal and inline asm. IIRC Turbo Pascal 7.0 (aka Borland Pascal 7.0; I never unstood the difference) added syntax highlighting but mostly focused on adding Windows support (meh). I wrote my first web apps as BP7 win-cgi apps back in 1995.
- pjmlp 7y agoWindows support was added in Turbo Pascal for Windows. Turbo products were the "community/student", while the Borland were the "professional" variant with more tooling and compiler optimisations.
- tpmx 7y ago> Turbo products were the "community/student", while the Borland were the "professional" variant with more tooling and compiler optimisations. Ah.. Over here in northern Europe we'd typically just pirate everything from our school's installation so we weren't really aware of any marketing differences. Thanks for clearing up a long-time mystery :). (We ended up with an install that had both bp.exe/tp.exe and bpc.exe/tpc.exe, and they seemed to behave identically. bp/tp.exe was the IDE, bpc/tpc.exe was the commandline compiler.)
- tpmx 7y ago> Windows support was added in Turbo Pascal for Windows. I think Turbo Pascal for Windows was like a branch, but then TP7/BP7 brought it into the mainline. Just before the mainline was reworked into what became Delphi.
- pjmlp 7y agoNot sure about the timeline anymore, just that I bought TPW shortly after it came out.
- rsecora 7y agoLink for previous discussion (2014) https://news.ycombinator.com/item?id=8260694 https://news.ycombinator.com/item?id=8260694
- man2525 7y agoBased on the earlier discussion, I have to wonder why C requires forward declarations if it's using a compiler that performs 4 passes and has dependency checking that even other languages defer (and compile) to. Is it standardization?
- mamcx 7y agoThe damage this viewpoint was massive. Pascal could have been our present, but now we live the mistake of base so much on top of C/C++, and because we never learn, repeat with JS.
- AnimalMuppet 7y agoThis viewpoint? Listen, I've had the misfortune to work in a non-enhanced (Jensen & Wirth-ish) Pascal, and what this article says is true. And it's true that the problems describe get in your way, sometimes annoyingly, and sometimes really badly. The damage to Pascal was from Pascal, not this paper or the viewpoint it represents. (I'm not going to defend JS, though...)
- mamcx 7y ago> to work in a non-enhanced That is like to work in first generation C. But the viewpoint cause massive damage: Pascal get a reputation based in the first version with a limited scope, despite have very good points at his favor. In a modern example, is like dismiss GO because lack of generics and verbose error handling, and consider C better for some OTHER reasons, that is what actually happened with pascal and other langs. ie: Happens ofter that some critize lang/tool for X (could be truth) ignore Y (that is a good point) and still choose Z (for other reasons). In the case of C: Is more popular, can I do funky things with pointers, my OS is made on that.
- AnimalMuppet 7y agoI worked in C just before and just after my gig in Pascal. While C had flaws, it was a more usable language than Pascal. First version C, first version Pascal. That's what Pascal apologists never want to admit. They still, 50 years later, either don't understand it or won't accept it: C was more usable than Pascal. Pascal's story may have been better, it's theory may have been better, but when it came to actual ability to write programs, C was better. Now, Pascal improved. Various versions fixed various flaws in various nonstandard ways. But the same was true of C.
- musicale 7y agoWirth's languages are beautiful even if C-like languages won the syntax war for the most part. Nonetheless Pascal-like languages have had some moderate success over some 40+ years from original Pascal to Turbo Pascal to Object Pascal to Delphi (not to mention many other languages from Ada to VHDL.) Wirth's Oberon ecosystem is also beautiful and uses Pascal-like languages to describe everything from his RISC CPU (specified in Lola) up to entire operating system and user environment (written in Oberon.) Personally I enjoy reading Pascal/Delphi/Modula-3/Oberon code, and I'm fascinated by the Oberon system as an example of how things can be small yet also clear and capable.