6 ms·
Pascal was the first language I learned in college. It is an excellent language for CS students, because it has clear syntax and it easy to figure out when some
by coliveira 6y ago
Pascal was the first language I learned in college. It is an excellent language for CS students, because it has clear syntax and it easy to figure out when something goes wrong (unlike C). Unfortunately it lost space to C and similar languages.
- bicolao 6y agoMy first too. The first time I looked at a C example it was soo cryptic! I wonder if we could compare the first time impression of C and Pascal though.
- vidarh 6y agoI once reverse-engineered a C program by compiling it and disassembling it, as I found it easier to read M68000 assembler.
- WalterBright 6y agoWirth's Pascal as described in User Manual and Report is nearly impossible to write non-trivial programs in. I know, I tried. It required a lot of extensions to become usable. In 1982 or so a friend loaned me his copy of K+R, I read it, and was instantly hooked. Never wrote another line of Pascal. I had written a lot of PDP-11 assembler at the time, and C's PDP-11 heritage made it very easy to pick up C. I saw how the PDP-11's semantics mapped right on to C. But some good came out of my experience with Pascal. D's nested functions are inspired by Pascal's nested functions. Simple and easy, including the ability to reach back on the stack and access the callers's variables (all the way up to main()). C should have had nested functions.
- badsectoracula 6y agoAnd typesafe enums and sets of said enums and ranges of ints and enums and arrays addressable by said ranges and the ability to pass values by reference to functions :-P
- rootbear 6y agoAgree on nested functions. Gcc has them as an extension but the last time I looked, clang did not. A pity.
- notacoward 6y agoThere are also some pitfalls in gcc's implementation. On one project we found that nested functions used as callbacks didn't play well with green threads, and it was a pain to deal with.
- raister 6y agoThe only thing I disliked was the `begin ... end` and the `begin ... end;` (notice the semicolon) structure on if-then-else C (and many others) has simplified employing brackets.
- andi999 6y agoSo you never tried to write a function that accepts strings with different length?
- raister 6y agoThis was 'solved' with pointers, didn't? (symbol ^) Well, we're talking about at least 25 years ago, so I clearly not remember this hiccup whatsoever
- andi999 6y agoTurbo Pascal didnt have that hiccup, only the original language.
- badsectoracula 6y agoYou can work around this - Turbo Pascal's strings are essentially syntax sugar for type string = record Length: Byte; Chars: array [1..255] of Char end; You can use this to make your own string handling procedures, the hardest part would be passing arbitrary string literals but that could probably worked around too with conversion functions.
- peter303 6y agoC and C++ were free. Free crap often wins over purchased quality.
- hojjat12000 6y agoC was ported to any platform. Free crap (when it comes to programming languages) win, because they can be used everywhere therefore a better thing to learn. For example, Borland never opened the sources of the compiler, and Turbo Pascal has never been ported to platforms other than DOS/Windows. Free crap in other areas (such as computer graphics) did not win over purchased quality. For example graphics designers even choose their Operating System based on available (non-free) quality software.
- badsectoracula 6y agoDelphi was ported to Linux with Kylix (using Qt as a backend for the GUI) but didn't saw much use. However the issue with Delphi was really that Borland got greedy around the turn of the century, started chasing enterprises and jacked up the prices considerably. Turbo Pascal originally costed less than a game yet you got both one of the best compilers and a book to learn from and Delphi until around 5 or 6 or so (do not remember the exact version) could be bought for around $99 at its cheapest version (AFAIK upgrade was cheaper) which was still affordable even by highschool students and provided a very high quality package. And during the 90s Borland Pascal and Delphi had a TON of mindshare - something they lost as they moved away from being affordable to everyone. People wouldn't mind much if Delphi wasn't free as long as it was still affordable to everyone and good quality. Sadly not only it became unaffordable to the most important segment of programmers (the new ones who want to experiment with stuff) but it also degraded in quality.
- AnimalMuppet 6y agoCrap that works wins over stuff that sounds good in theory. If you ever had to work with an as-defined-by-Wirth Pascal, it was painful. Another data point: Turbo C wasn't free, either. How did it sell compared to Turbo Pascal? (I don't actually know; does anyone have data?)
- 6y ago