8 ms·
Why Pascal is Not My Favorite Programming Language (1981)
- ww520 12y agoI remember first learning Pascal and hated it. It felt very restricted and difficult to get real work done. The type checks that are worshiped nowadays felt like a straitjacket in Pascal. C was a totally different experience. It was so open and free of restriction that I could hack anything with it. Pascal was a beginner learning language but C was hacker's language.
- xxs 12y agoTurboPascal had great inline asm, so you could hack in any way you please.
- laichzeit0 12y agoI wonder how many people learned graphics programming because of Pascal and inline asm. I wrote many a phong shader, raytracer, and other 3d graphic things back in the day using that. There was a cool Demo tutorial series by a guy called Denthor floating around on BBS's back then.
- Narishma 12y agohttp://archive.gamedev.net/archive/reference/listed82.html?categoryid=130 http://archive.gamedev.net/archive/reference/listed82.html?c...
- antimagic 12y agoYup. Moving from Pascal to C gave me the same sort of freedom rush as moving from C to Ruby. That said, I don't use Ruby anymore, apart from the occasional command-line tool, but I still use C a lot. I have done a lot of Javascript in the last few years though, and oddly it didn't give me that same feeling of freedom, but that might be because I'd already experienced Ruby.
- pjmlp 12y agoI never felt any restriction in Turbo Pascal and there wasn't a single C feature that I couldn't do with it. The Hacker's language, back when I was coding in Turbo Pascal was called Assembly. C was just for UNIX or when you wanted to do UNIX homework on your Atari ST/Amiga.
- gfody 12y ago33 years later, none of this is true of FreePascal, Delphi, or any modern variant. Except maybe the cosmetics. If you think {!@#$} is easier on the eyes than begin end; well that's like your opinion, man.
- tdsamardzhiev 12y agoI never understood all the Pascal-bashing. It's a pretty decent procedural language.
- kabdib 12y agoWhen I joined Apple in 1987 it was a Pascal shop that had just started moving to C. The Pascal they were using had been developed and was maintained in-house and had a number of extensions, and with the exception of a few things like different semantics for pointer arithmetic and the presence of nested procedures it felt in practice nearly the same as C, just with different keywords. I wrote a ton of code in it, and I really didn't think about the difference much. But in college I had to use unextended Pascal, and it sucked pretty hard. Maybe that's the point of a teaching language; make it stink to the point that students are encouraged to move to better languages. Maybe the current vocational approach of teaching a "Real Language" -- ahem, Java -- to beginning programmers is flawed because they're less likely to get experience with other, better languages. [I'm not sure how serious I am about this. I know that I hate Java, at least how it was circa 2001].
- arnsholt 12y agoAnother problem with teaching introductory programming in a Real Language, I think, is the temptation to also teach more software engineering-like things as well. When you start measuring your experience with programming in decades rather than years, it's hard to remember learning how to program is actually kinda hard. Thus, adding things like version control and IDEs to the mix gives you less time on teaching what should be the core of an introductory programming class: how to solve problems in code. Anything else is fluff that can be ignored until the foundations have been laid. An additional reason I think using something "weird" like Haskell or Scheme is that it's a very good equalizer (Haskell in particular). IME, this kind of class will have two kinds of student: those who already know how to program, and those who've never programmed. Those who already know how to program are mostly going to ignore the class, simply because it's known to them already; and this is a problem because the interactions between strong students and weaker ones is massively helpful, to both parties. Teaching things is, somewhat ironically, perhaps the very best way of focussing your knowledge of it. When you're explaining stuff to yourself (as it were), you can fudge the details you're a bit vague on (which is generally thue tricky bits), but if you're explaining it any vagueness is painfully obvious (I suspect this is also the reason simply explaining a problem to someone can be so helpful).
- abroncs 12y ago
- pjmlp 12y agoI was already familiar with this rant back in the day. It complains about the first Pascal version, not the later Extend Pascal standard. All the Pascal compilers target to professional developers had a common set of extensions mainly from USCD Pascal and Object Pascal (Apple), with Turbo Pascal being the one most compilers tried to be the most compatible with. C was also a mess outside UNIX with compilers only partially supporting parts of it. Worse, thanks to C lack of proper strings, arrays decaying into pointers and lack of reference parameters we have the current security situation that needs to fixed with tons of external tools.
- wirrbel 12y agoSome criticism about Pascal is kind of unfair, the one-pass compiler nature of the original language for example made Pascal compilers so much faster. When I tried to learn how to program I had played around with C, C++ and Basic without understanding much, but when I finally found a Pascal book and got a copy of FreePascal I really learned and understood how it works. Nowadays I am not using Pascal any more (I am not too sad about it), but the Borland / FreePascal Dialects offer some serious benefits. For one thing the unit system is still better than what C/C++ have to offer (text-include header files, nah) ;) Also it is worth remembering that C back then was not what it became with ANSI C and then C99. I would not like to write in that dialect, seriously. Thinking back I think Pascal was a nice intermediate level programming language between C and Basic that was implemented in its ways for proper reasons. The text provided has very valid points on Pascal, but the arguments that C is better are only partially convincing. C is different and I would argue that it has prevailed because it is more closer to the metal.
- toolslive 12y agoFunny how things change. Two of the deficiencies: - the absence of global state - array dimensions part of the type may have been considered defects back then, but are currently seen as a good thing. [For example, in Haskell, they consider it fancy that you can add dimensions to your type signature so the compiler can check if you're not doing something silly.] Also, I programmed extensively in Pascal using the Borland IDE in the early 90s and it was one of the best IDEs I ever encountered. As troll bait, let me just throw in this: the compiler had better inline assembly than what gcc provides 20 years down the road.
- habitue 12y agoC also has arrays with dimensions as part of the type. The trick is that the dimension must be determined statically. This is different than vectors in Haskell which allow the size of the vector to be determined (and even vary) dynamically, yet still guarantee memory safety statically (I.e. no runtime cost for bounds checking). You can think of an array with a static size of 10 as being like shorthand notation for a struct with ten fields (sans padding). It really is no more complicated than that.
- pjmlp 12y agoTry to use those arrays as function arguments.
- habitue 12y agoI believe that works fine (at least in C). You have to statically put the array size into the function signature, so it will only work on arrays of that size. I was simply pointing out the difference between dependently typed vectors which have the type checker prove you use the vector correctly, and arrays in c and pascal whose sizes are known at compile time. I am agreeing with the author that this makes it hard to create generic array bounds if you don't have the ability to make unbounded arrays (as c does). I was disagreeing with the gp, who was conflating these two different sorts of types.
- barrystaes 12y agoPascal and C are very much the same, and basically parents of C#. (both by Anders Hejlsberg, currently making TypeScript) Also if you are a Pascal/Delphi guy/gal and need to build web applications, check out the smart fellows at http://smartmobilestudio.com/ http://smartmobilestudio.com/
- adamnemecek 12y agoAnders Hejlsberg made TurboPascal. Pascal itself was created by Niklaus Wirth.
- pascalmemories 12y agoI was a huge fan of Pascal and still have fond memories - I'd still argue it is a good starting point for teaching programming principles. It's easy to pick faults in any language {Y} and compare it against {X} which is way better. I don't think that is really helpful as it ignores whatever practicalities for the time/place led to the choice of {Y}. Anyway, I always got a chuckle from the fortune cookie : Niklaus Wirth has lamented that, whereas Europeans pronounce his name correctly (Ni-klows Virt), Americans invariably mangle it into (Nick-les Worth). Which is to say that Europeans call him by name, but Americans call him by value. (http://www.j0zf.com/fortune_cookies.php?te_class=fortune_cookies&te_mode=view&te_key=2098 http://www.j0zf.com/fortune_cookies.php?te_class=fortune_coo...)
- xradionut 12y agoWirth also created successors to Pascal and co-created an operating system and the hardware it ran/runs on.
- pjmlp 12y agoI am a big fan of the Oberon family of languages. It showed me workstation OS are pretty doable in GC enabled systems programming languages. Sadly the industry hasn't yet decided to bet on it.
- V-2 12y ago
- V-2 12y agohttp://programmers.stackexchange.com/questions/114846/why-has-c-prevailed-over-pascal http://programmers.stackexchange.com/questions/114846/why-ha... - some interested insights in a discussion initiated by yours truly
- V-2 12y agoI meant "interesting" of course ;)
- vishnugupta 12y agoVery nostalgic :-). I learnt the concept of pointers in Pascal. I think it was taught for two semesters at Mysore and Bangalore university colleges. We however quickly moved on to C as that came during the final year of graduation. Fortran -> Pascal -> C was sort of general trajectory couple of decades ago in engineering colleges in India. And in all this there was Cobol; I wonder whether it's even taught now a days!
- Tloewald 12y agoLearjet vs piper cub? There are plenty of jets designed for training and small prop planes designed to "get things done".
- fredvs 12y agoPlease, would you read that new News ? http://wiki.freepascal.org/Why_Pascal_is_Not_My_Favorite_Programming_Language http://wiki.freepascal.org/Why_Pascal_is_Not_My_Favorite_Pro...