4 ms·
If you know C you 'know' Pascal. What the best thing about Pascal (and its successor Delphi) was the blazing fast compilation time and I am not sure that freePa
by andi999 6y ago
If you know C you 'know' Pascal. What the best thing about Pascal (and its successor Delphi) was the blazing fast compilation time and I am not sure that freePascal has that.
Also what I really hate about Pascal is it is dishonest. It tells you it is very structured and your code will be better because of limited expressiveness. But then the 'writeln' 'function' needs to be intruduced at the compiler level - you cannot write such a function in the Pascal grammar. (maybe with freepascal you can nowadays)
What I liked though is that it didnt have the empty statement ';' so you really had to understand the semantics. Sometimes you were not allowed to end you statements with ';' (since they were ended by the block, so this would require the emptystatement). I think freepascal does not have this feature anymore (which is the thinking changing).
And just one more thing: Personally I would try to learn ADA before diving into Pascal.
- memsom 6y agoNo, sets. Sets are amazing. I still miss them to this day. Pascal also had sub ranges long before C# and the type system was very good. Delphi dereferenced its object model be default, so you could use dots rather than the awkward ^. Of pascal (-> in c++ and C)
- JoeAltmaier 6y agoImplementations sucked. They were bit vectors, limited to one machine word in length. So they were 16, 32 or 64 limited depending on where your program ran.
- ac42 6y agoI'm pretty sure sets supported up to 256 elements (32 bytes) in Turbo Pascal on 16 bit systems, because you could manage ASCII characters with them. Yes, didn't scale. Yes, tons of use cases nonetheless.
- benibela 6y agoThat is always so in Pascal It has the best possible ideas, and then fuck up the implementation. Recently, I tried to use a set on a three valued enum. With three values it should have worked perfectly. But no, the set was not allowed. Because the values were -1, 0, 1 and FPC apparently only can create set on non-negative integers
- hsitz 6y ago> What the best thing about Pascal (and its successor Delphi) was the blazing fast compilation time and I am not sure that freePascal has that. I'm not sure how FreePascal compares to Delphi in compilation speed, but I expect both are blazing fast. The compilation speed is a result of the language design of Pascal, and the fact that compilation can use a "single pass compiler". Go is another language that has this feature. Compilation times are so fast that development can feel similar to using an interpreted language.
- yawaramin 6y agoOCaml has this compilation speed heritage too through its roots in Modula-2: https://dev.to/yawaramin/ocaml-interface-files-hero-or-menace-2cib https://dev.to/yawaramin/ocaml-interface-files-hero-or-menac...
- jonsen 6y ago> ... it didnt have the empty statement ';' ... > Sometimes you were not allowed to end you statements with ';' (since they were ended by the block, so this would require the emptystatement). Pascal has empty statements. They are exactly that - empty. In C syntax ; is a statement end token, so the empty statement is ‘;’. In Pascal ; is a statement separator token, so the empty statement is ‘’, and ‘;’ is two empty statements. So the typical error is to write “....... ;” where only one statement is syntactically allowed. Example: if x > y then x := y ; else ... Syntax error. Only one statement allowed between then and else. then { x := y ; } else ... is Ok. The blocking makes two statements into one.
- andi999 6y agothanks.
- 7thaccount 6y agoAda and Pascal have some syntactic similarities, but I'm not sure they cover the same kind of niche enough for someone to say "I'd learn Ada prior to Pascal". Today, Delphi is used in some shops the same way C# or Java is used in others. Free Pascal with Lazarus is kind of like a free version of that. You can quickly build desktop apps. Ada is nothing like that. It's almost exclusively used in the defense industry and others like aviation and infrastructure where the code is likely to be embedded and can NOT fail. One is for standard business and one for critical infrastructure.
- andi999 6y agoI agree, but then you wouldnt start new programs with Delphi these days, would you? (To me Delphi is the Cobol of GUI, will be still around forever, but less and less new projects)
- 7thaccount 6y agoI don't think many start new projects in Ada either unless you're working for Lockheed Martin or another contractor and even then, they've largely gone the C++ route. What do people use today? Java, C#, C, C++, Python, R, JavaScript, Php. What might become popular someday? Rust.
- andi999 6y agoYes, which worries me. I talked to a guy working in safety related software design (safety like car breaks), and they are going to C++, since there are not enough Ada/Spark developers. Which is a pity, since Spark allows you to prove correctness (in a special sense)