Live data from Hacker News

Why use Pascal?

castle-engine.io

141–150 of 516 posts

Re: Why use Pascal?

#141
post #129

Earlier quoted context omitted.

"- there's no assignment operator in maths" There is no assignment but in math we use := to express that two things are equal per definition . I never said it was the same thing, just that it is the closest thing. From a math perspective it makes total sense, while singular = for assignment makes no sense at all. Especially when you want express the concept of equality as well and cannot use the obvious choice = anym…

Edit: In his Pascal report Wirth mentions math zero times: http://pascal.hansotten.com/uploads/books/Pascal_User_Manual... And in fact in 1971 he wrote that it was basically copied from ALGOL: https://oberoncore.ru/_media/library/wirth_the_programming_l... Edit2: Most relevant part from second link: "The syntax has been devised so that Pascal texts can be scanned by the simplest techniques of syntactic analysis". Tha…

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.

Re: Why use Pascal?

#142

Earlier quoted context omitted.

Strongly typed is orthogonal to dynamic and static typing. Python and Common Lisp are both "strongly" typed and dynamically typed. There's no reason to shun strong typing if you also like dynamic typing.

I would be curious to see references that claims that dynamic and static typing are orthogonal with strongly typed systems, as “strongly type” is rather ambiguous and the only reason I used the term was because that was how Pascal was promoted back in the day (or at least how was taught to me) From Wikipedia: In 1974, Liskov and S. Zilles defined a strongly-typed language as one in which "whenever an object is passed…

[deleted]

Re: Why use Pascal?

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

Depends a lot on the language does not it?

Re: Why use Pascal?

#144

Earlier quoted context omitted.

how can Python be strongly typed if it doesn't enforce types for declared arguments? What is the value of this supposedly "strongly typed" Python's type system? class Object: pass def f(arg:int): print("type of arg = ", str(type(arg))) f(1) f(666.0) f("kek") f(Object()) type of arg = type of arg = type of arg = type of arg = and not a single error/warning thrown

How is OCaml strongly typed if it doesn't have declared types?!?!? (EDIT: In case it's not obvious, I'm being sarcastic, I'm pretty sure some people in this discussion won't get that though.) let f x = x + 1;; (* What's the type?!?!? *) Turns out that "strong typing" is a shitty phrase that people should stop using because it means too many conflicting things, and, consequently, means nothing. Static and dynamic typi…

people on HN often claim that Python is "strongly typed" while PHP is loosely-typed, but I don't see the difference honestly. both are pretty loose.

re: 1 + "1"

I didn't get your point really. My reply was to counter claim that Python is supposedly "strongly typed" and I don't understand how this strong typing helps developers. I know that languages can infer types, which is tangential subject. I dont know why you brought this up

Re: Why use Pascal?

#145

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

You can since Delphi 10.3.

https://en.m.wikipedia.org/wiki/History_of_Delphi_(software)

Re: Why use Pascal?

#146

Earlier quoted context omitted.

Strongly typed is orthogonal to dynamic and static typing. Python and Common Lisp are both "strongly" typed and dynamically typed. There's no reason to shun strong typing if you also like dynamic typing.

I would be curious to see references that claims that dynamic and static typing are orthogonal with strongly typed systems, as “strongly type” is rather ambiguous and the only reason I used the term was because that was how Pascal was promoted back in the day (or at least how was taught to me) From Wikipedia: In 1974, Liskov and S. Zilles defined a strongly-typed language as one in which "whenever an object is passed…

"whenever an object is passed" clearly refers to run-time. An object is not being passed when we are compiling the function call.

"declared in the function" clearly means that the function has an internal type check.

An interface declaration (Modula-2 interface file, C header file with prototypes) is not "in the function"; it's compile-time meta-data about a function.

A function call between separately compiled translation units has no idea what is in a function.

Re: Why use Pascal?

#147
post #143

Earlier quoted context omitted.

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

Depends a lot on the language does not it?

we are talking about pascal

Re: Why use Pascal?

#148
post #87

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.

That's completely missing the point. While Pascal can be used for serious work, it is first and foremost a teaching language friendly to beginners meant for introducing people (who back in the day) likely started with something like BASIC to concepts of structured and objects oriented programming. The syntax is easy to learn, fairly clean and the language has very fast compilation (C++ really can't compete here). Whi…

Many years ago I learned programming that way. Pascal then C, Assembler and VB Script. I completely agree with the argument that it is a great teaching language. Our teachers even explained this to us. JS, C, C#, Python and Java syntax is just crazy for real newbies. Curly braces basically do not exist in normal life and scare people. And Go and the functional group of languages are just not understandable with their concepts. Imperative programming is much easier to understand.

Pascal is in a sweet spot.

Re: Why use Pascal?

#149
> modern, readable, fast, type-safe, cross-platform programming language

Let's assume this is all true (although I wouldn't say it's particularly modern, and I don't know about some of the rest). And let's forget that some of these adjectives are relative or subjective.

Even under that assumption - there are other programming languages which meet these criteria. Why would we prefer Object Pascal over them? Especially when it has existed for many years and not gotten a lot of traction?

Re: Why use Pascal?

#150

Pascal and Logo Turtle are programming languages I learned at school, but never used them outside of it. I hated them back then. I don't know if this was teacher or language fault, but these IT lessons couldn't be more boring and confusing.

Teacher and kids not being focused. I learnt using Pascal and it was perfect.
Post reply on HN