Live data from Hacker News

Why use Pascal?

castle-engine.io

181–190 of 516 posts

Re: Why use Pascal?

#182
post #69

Earlier quoted context omitted.

They are pretty much everywhere when statically allocated.

well, not in c.

I believe they are in C, but arrays degrade to pointers when you look at them wrong, and _those_ don't have length as part of their type.

At least I'm seeing: `array type 'int[3]'` in messages when I tried to do something wrong with it quick to get an error message (using llvm), maybe that's a compiler specific thing.

Re: Why use Pascal?

#183

Earlier quoted context omitted.

we are talking about pascal

About pas Al in comparison to languages using {} for blocks, where some have block scoping and some don't.

no idea what you are talking about here - what is "pas Al" - post an example of what you mean.

Re: Why use Pascal?

#186
post #182

Earlier quoted context omitted.

well, not in c.

I believe they are in C, but arrays degrade to pointers when you look at them wrong, and _those_ don't have length as part of their type. At least I'm seeing: `array type 'int[3]'` in messages when I tried to do something wrong with it quick to get an error message (using llvm), maybe that's a compiler specific thing.

> when you look at them wrong

no, almost whenever you look at them. it is very hard to carry around the size of an array in C.

> At least I'm seeing: `array type 'int[3]'` in messages when I tried to do something wrong with it quick to get an error message (using llvm), maybe that's a compiler specific thing.

post some code that illustrates what you are talking about

Re: Why use Pascal?

#188

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.

> you can't even declare variables in the middle of a function

Yes you can:

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

Re: Why use Pascal?

#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.

Re: Why use Pascal?

#190
post #58

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.

Can’t speak about Object Pascal, but the old Pascal was objectively better than C. You can like or dislike the differences in syntax, but Pascal’s type system was pretty solid which can’t be said about C

Strong agree. I used the old Turbo Pascal for many years. It was quite routine to produce substantial programs where the compiler (and type system) had caught ALL the bugs.

Meaning: you used sensible types (and had sensible libraries) and once the obvious compile-time errors were fixed, there would be zero bugs found in testing or in live!

I like the flexibility of python, but I know that every substantial program has untested pathways that will fail when they come to be exercised :(

Post reply on HN