Live data from Hacker News

Why use Pascal?

castle-engine.io

191–200 of 516 posts

Re: Why use Pascal?

#191

Does Pascal still require all variables to be declared at the top? I did a quick search and that seems like the case, but I want confirmation from someone that knows the language. If so, that's a immediate "no" for me. We know by now that keeping variable declarations close to their usage is a big boost in readability, and at times even in performance (you only declare variables you actually use). I know Pascal has e…

If that's the worst thing you can find about Pascal (and it's just a style issue) then Pascal must be the best thing ever :)

Re: Why use Pascal?

#192

Unless you want a C++ with a different syntax and less features then there's no reason to learn Pascal in 2023. And the syntax is much worse, you can't even declare variables in the middle of a function it has to go before the function. This slows you down from real work (art code comes later). It also makes worse code as declaring near the usage point makes code more clear.

>"And the syntax is much worse, you can't even declare variables in the middle of a function it has to go before the function."

I wish people would bother to check the facts before posting. It's been available for quite a while along with many more modern features.

Re: Why use Pascal?

#193

Earlier quoted context omitted.

They are both used to define blocks. Eg Begin … End in for loops https://wiki.freepascal.org/For From what I recall, Pascal doesn’t support variables scoped within a specific block. But then neither do some languages with C-style curly braces too. So {} and Begin…End are pretty much the same thing. BASIC (and Visual Basic especially) often get a lot of criticism for their syntax but the End Thing style block terminat…

i do not think you understand the concept of scope.

Would you explain it? I'm self taught, have programmed in Python, C, and am looking at Pascal, and I don't understand the difference.

Re: Why use Pascal?

#194

Earlier quoted context omitted.

Yeah. weinzierl has his/her syntax preference, and that's fine. As the ancients said, "There's no disputing about tastes." But the attempt to provide a rationalization for why the taste is correct is complete nonsense.

It's not about taste, really. We all learn mathematical notation in primary school. It is an universal language. Programming languages support many concepts that are either the same in math or very similar. Using the symbols for the same concepts in both worlds is the obvious and sensible choice. The reason why C did choose a different convention was that it preferred similarity with FORTRAN which is so old that it w…

> Using the symbols for the same concepts in both worlds is the obvious and sensible choice.

Yeah, but has already been established in this conversation, you're not using them for the same concepts. So your argument doesn't work. Repeating it over and over isn't going to make it work, either.

> The reason why C did choose a different convention was that it preferred similarity with FORTRAN which is so old that it was punched on cards that did simply not have a : character.

I'd be interested in seeing your evidence for this assertion that you make so confidently. From my understanding, the logic was this: Assignment happens twice as often as comparison, so assignment gets the shorter symbol. Perfectly reasonable from an information-theory point of view.

And, C didn't avoid := because the proper character wasn't available. They used : in the ternary operator, so they clearly expected it to be available.

So all in all, your data is suspect, and doesn't support your argument.

Re: Why use Pascal?

#195

I'm finding myself using Pascal for fun these days due to resource constraints. The old release of Borland's Turbo Pascal, version 3.00A, runs under CP/M and provides an editor, compiler, and libraries all under 64k. It's fast enough to use interactively, and produces code that is good-enough to implement low-level utilities, simple games, and other random hacks. I've not used Pascal on anything larger, or more moder…

Oh Pascal!, oh the nostalgia. I saved up the princely sum of $80-$100 back in TRS-80 Model III days to buy the Pascal 80 package, the New Classics version, which was basically a proto-IDE, and a pretty sweet one at the time. http://www.trs-80.org/pascal-80/ I recall it being a huge step up from the M-III BASIC dev environment and the games and utilities I wrote ran well enough in the 48K of RAM that was available. I…

Anyone can check out Oh! Pascal! [1] just like a library book.

Even now, it's one of the best introductory programming books for any programming language.

[1]: https://archive.org/details/ohpascal0000coop/mode/2up

Re: Why use Pascal?

#196
post #163

Earlier quoted context omitted.

I saw a talk that touched on this recently: https://www.youtube.com/watch?v=Tml94je2edk He explains that dynamically-typed languages like Python, Ruby, and JS became popular in the 90s because they offered a fast feedback loop for website building, and they didn't need an IDE or compilers, which were slow (and often not free). It ended up not being worth trading your development time for the performance increase when…

Do not forget Pearl.

Perl or Rakudo?

Re: Why use Pascal?

#197
post #111

I used to use Delphi/Pascal as my main language. In the last decade or two I have been on a bit of a journey looking for a language that feels right to me. I used Haxe for quite a while but I felt Haxe fell into the trap of 'There's a Macro for that' (Macros can do anything, but ultimately enough macros make everyone programming in their own macro augmented language). JavaScript developed decent improvements (but cou…

> Begin End vs { } doesn't really bother me. but they don't really mean the same thing - {} defines a local scope, begin...end doesn't.

They do: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Inli...

Re: Why use Pascal?

#198

Earlier quoted context omitted.

They are both used to define blocks. Eg Begin … End in for loops https://wiki.freepascal.org/For From what I recall, Pascal doesn’t support variables scoped within a specific block. But then neither do some languages with C-style curly braces too. So {} and Begin…End are pretty much the same thing. BASIC (and Visual Basic especially) often get a lot of criticism for their syntax but the End Thing style block terminat…

i do not think you understand the concept of scope.

Perhaps you're being a little short here? Explaining what you mean would go a long way to fostering good will.

Re: Why use Pascal?

#199
post #189
post #5

I used Delph professionaly for several years in the 90s, and liked it, but really got tired with Borland (and subsequent owners) mis-managing the product and the language, as did Anders Hejlsberg, who left Borland for Microsoft, where he created C# - IMHO a much better language & architecture to invest your time in.

Reliably deploying C# desktop app is total nightmare in comparison to single exe generated by Delphi's / Lazarus.

I've found .Net deployments to be rock solid and easy. What problems do you hit?

Re: Why use Pascal?

#200
post #189
post #5

I used Delph professionaly for several years in the 90s, and liked it, but really got tired with Borland (and subsequent owners) mis-managing the product and the language, as did Anders Hejlsberg, who left Borland for Microsoft, where he created C# - IMHO a much better language & architecture to invest your time in.

Reliably deploying C# desktop app is total nightmare in comparison to single exe generated by Delphi's / Lazarus.

C# can generate single executables now.
Post reply on HN