4 ms·
I used Turbo Pascal a lot as a teenager. Then I switched to Java and never looked back. For me the main reason was garbage collection. String size was limited
by Viliam1234 5y ago
I used Turbo Pascal a lot as a teenager. Then I switched to Java and never looked back. For me the main reason was garbage collection.
String size was limited to 255 (non-Unicode) characters, array size needed to be specified at compile time, everything beyond this required manually allocating and unallocating memory... okay for school projects, but too much work for anything more complicated. The standard library didn'd support some simple functionality I had to write in assembler, such as detecting when a key is pressed and when it is released (how can you write an action game without this?), or using 256 colors (the standard library supported 16 colors at most).
The "smart" marketing move to rename a successful product and company to something obscure also didn't help. Why not call it "Visual Pascal" instead?
- tankenmate 5y ago"Why not call it "Visual Pascal" instead?" Probably because the lawyers advised them that they'd get sued by MicroSoft.
- littlecranky67 5y ago> array size needed to be specified at compile time This also holds true for C until C99, I think.
- Turing_Machine 5y agoC had `malloc` and (real) pointers pretty much from day 1, and allows you to treat the result of `malloc` as an array. Pascal's `new` did not let you do this, as I recall (it didn't even allow you to allocate a chunk of memory of arbitrary size... meaning that you can write `malloc` in C, but you can't write `new` in Pascal -- edit: before someone starts jumping on me with the claim that "Golly-Gee-Whiz Pascal '92" lets you do this, I am talking about Pascal, the language as designed by Niklaus Wirth, not about some bastardized non-standard extension. And yes, I fully concede that arbitrary pointers are dangerous, and are prone to producing nasty bugs. They also provide a whole lot of power).
- littlecranky67 5y agoSurely there was a way in Pascal to execute system calls (which would give you access to malloc-like constructs)?
- Turing_Machine 5y agoNot that I recall, and even if it had, that wouldn't help, as there was no way to cast the resulting chunk of memory to whatever arbitrary type you needed it to be.
- foobarian 5y agoYes. My TP programs were more than 50% inside asm...end blocks and would break even if you switched out the graphics card let alone tried them on a different architecture.
- bjourne 5y agoAs I remember it, you could absolutely do all that in Pascal if you put your mind to it. But raw pointer manipulation was a bit more convoluted than in C so you usually resorted to inline asm. Today all that convolutedness might have been seen as "safety features" and the language marketed as a C-replacement. :)