Live data from Hacker News

Why I use Object Pascal

dubst3pp4.github.io

141–150 of 235 posts

Re: Why I use Object Pascal

#141
post #134
post #40

Earlier quoted context omitted.

It's 21 years newer than the critical article he mentioned..

But that article was not 21 years newer than the first version of TP that was released in 1983.

The first version of Turbo Pascal didn't have object system or modules.

Re: Why I use Object Pascal

#142

Earlier quoted context omitted.

My High School programming class was taught in Pascal (Turbo Pascal version 3 IIRC). I remember liking it just fine, but when I went to the university I switched to C because everything interesting was written in C. Also, there were no Pascal compilers in the FreeBSD (2.0) ports tree back then. I had a notion that Pascal was a "toy teaching language" too, but for what I was doing that didn't really matter.

You must be 50... and you're still on HN! Are you still an engineer? If so, what stack are you using now?

I can't speak for jandrese, but I'm over 50, was taught Pascal in college, and of course I read Hacker News! (And Reddit, Fark, and Slashdot beforehand). I'm surprised you're surprised. (I'm in a Python stack these days).

Re: Why I use Object Pascal

#143

Earlier quoted context omitted.

Currently I'm learning Forth and I really like that language! It's a brain twist and that's reason enough to have a look at :-)

I've never done anything serious in Forth, but I was first exposed to it in the late 80s, and keep coming back to it. Over the past couple of years I've written, and thrown away, several implementations of Forth in C, C++, and Perl. I've even had it running, embedded, on ESP8266 devices. It continues to be something I enjoy toying with, but equally something I can't find a perfect use for.

Give it a try in Racket. Racket's macros is a dream to create another language in.

Re: Why I use Object Pascal

#144

As I get older, I'm strongly swinging into the camp that thinks languages should have strongly restrictive syntax. Object pascal is one of those languages which is both low level enough to cleanly map to efficient code, as well as high level enough not to feel really restrictive. Its a language that is completely misunderstood because far to many people read a couple critical essays, and believed everything they read…

> even though the strongest argument frequently was that its harder to type "begin/end" than "{/}". Which is a pretty lame thing

and it's not too different from Ruby, to boot.

Re: Why I use Object Pascal

#145

Earlier quoted context omitted.

My High School programming class was taught in Pascal (Turbo Pascal version 3 IIRC). I remember liking it just fine, but when I went to the university I switched to C because everything interesting was written in C. Also, there were no Pascal compilers in the FreeBSD (2.0) ports tree back then. I had a notion that Pascal was a "toy teaching language" too, but for what I was doing that didn't really matter.

You must be 50... and you're still on HN! Are you still an engineer? If so, what stack are you using now?

You are off by about a decade. FreeBSD 2.0 was released in the mid 90s.

I still skim Slashdot too.

Most of the time I'm working on ancient versions of RHEL that are never connected to the internet so I don't exactly get to use "stacks" or anything that wants to pull code from Github. If it doesn't come on the RHEL 5.5 disk it's not available. You might be surprised how much you can do with a modest CGI script, a touch of JS, and some basic styling CSS.

Re: Why I use Object Pascal

#146

As I get older, I'm strongly swinging into the camp that thinks languages should have strongly restrictive syntax. Object pascal is one of those languages which is both low level enough to cleanly map to efficient code, as well as high level enough not to feel really restrictive. Its a language that is completely misunderstood because far to many people read a couple critical essays, and believed everything they read…

I don't think anyone really disagrees with you -- most people have problems with the syntax of Perl, C, and C++. Sure, they can get used to it, particularly with C because it's small, but the syntax isn't why they use the language.

Somewhat surprisingly, I think Perl's syntax is one of the reasons that Python became popular. Perl can do pretty much everything Python can, and it came significantly earlier. Yet people gravitated toward Python.

I wouldn't call Python "strongly restrictive", but I would call it "just right". It's terse without being unreadable.

JavaScript syntax is also pretty sane (but there are many horrible parts to the semantics.)

Ruby seems to be pretty nice in the common cases, but there are apparently gremlins lurking in corner cases. Python has only 1 or 2 syntactic gremlins I can think of (trailing comma, etc.)

Re: Why I use Object Pascal

#147
post #146

As I get older, I'm strongly swinging into the camp that thinks languages should have strongly restrictive syntax. Object pascal is one of those languages which is both low level enough to cleanly map to efficient code, as well as high level enough not to feel really restrictive. Its a language that is completely misunderstood because far to many people read a couple critical essays, and believed everything they read…

I don't think anyone really disagrees with you -- most people have problems with the syntax of Perl, C, and C++. Sure, they can get used to it, particularly with C because it's small, but the syntax isn't why they use the language. Somewhat surprisingly, I think Perl's syntax is one of the reasons that Python became popular. Perl can do pretty much everything Python can, and it came significantly earlier. Yet people…

> Perl can do pretty much everything Python can, and it came significantly earlier. Yet people gravitated toward Python.

I don't think syntax is the main culprit here, and Perl is only four years older than Python. For about 15 years Python tried, unsuccessfully, to compete with Perl as the premier language for shell scripting and sysadmin tasks. It wasn't until around 2005 that Python finally caught on, its rise coinciding with Ruby. While I do personally find Python more readable than Perl, I attribute its ascent more to the combination of the Web 2.0 gold rush demanding dynamically-typed languages for quick prototyping, Perl's apparent mid-2000s limbo due to Perl 5 vs Perl 6, the then-declining reputation of PHP and the shared hosting services which first popularized it, and the quality of Python's standard library (which made up for CPAN).

Re: Why I use Object Pascal

#148
post #21

"You can also define your own types" , "classes can also inherit other classes" , "Pascal is modular" ... Not to say these are not valid reasons, or expectations one may have from a language, but - what exactly is Pascal being compared to? I mean, it's 2017.

C has no classes, and everything's in one global namespace. Scheme & LISP have no built-in classes, and one can argue that CLOS isn't what we normally describe as OOP. Both normally have a global namespace. Inheritance in JavaScript is possible but very hard to implement correctly before ES6. Node has namespaces (sort of) but client-side JavaScript generally doesn't. PHP in theory has namespaces, but the standard lib…

> Scheme & LISP have no built-in classes, and one can argue that CLOS

CLOS is built-in.

> CLOS isn't what we normally describe as OOP

There is no 'normal' description of OOP. Smalltalk, C++, Java, Self, Javascript, ... are all object-oriented programming languages and are widely different. If you look at the OOP literature you will find dozens of definitions of OOP.

CLOS has classes, instances, inheritance, dispatch, and other features of OOP.

> Both normally have a global namespace.

Namespaces for symbols in Common Lisp are called 'packages'.

Re: Why I use Object Pascal

#149
post #2

How do users of languages like Pascal get by without any/many libraries? Do they need to use the FFI to call out to C functions constantly? I mean, I certainly buy that $VINTAGE_LANGUAGE could still be great to develop in, but I'm curious the practicalities of working on modern systems without re-inventing every single wheel.

It is easy to create bindings to the C-libraries you need, see http://wiki.freepascal.org/Creating_bindings_for_C_libraries . But FreePascal has many native libraries for all kinds of stuff...

I haven't actually tried that, but my guess (even without checking that link) is that you are right, because:

1) C and Pascal are not too different as languages go (in some respects, both being sort of Algol-family languages), and:

2) I remember from earlier Windows API/SDK days that many Windows APIs had signatures/prototypes that went something like "long far pascal", and remember reading in computer magazines and source code listings about Pascal vs. C calling conventions (it may have been something like the order in which function parameters are pushed onto the stack before the call is executed, who cleans up the stack - caller or callee, etc.).

https://en.wikipedia.org/wiki/X86_calling_conventions

e.g. see the cdecl vs pascal conventions.

Re: Why I use Object Pascal

#150
post #147
post #146

Earlier quoted context omitted.

I don't think anyone really disagrees with you -- most people have problems with the syntax of Perl, C, and C++. Sure, they can get used to it, particularly with C because it's small, but the syntax isn't why they use the language. Somewhat surprisingly, I think Perl's syntax is one of the reasons that Python became popular. Perl can do pretty much everything Python can, and it came significantly earlier. Yet people…

> Perl can do pretty much everything Python can, and it came significantly earlier. Yet people gravitated toward Python. I don't think syntax is the main culprit here, and Perl is only four years older than Python. For about 15 years Python tried, unsuccessfully, to compete with Perl as the premier language for shell scripting and sysadmin tasks. It wasn't until around 2005 that Python finally caught on, its rise coi…

I have long thought Perl can do anything Python can, and then some. I still use Perl one-liners to find/change strings in code bases:

perl -pi -e 's/somestring/newstring/g' $(ag -l --python Foo)

Does Python have an equivalent?

I think the fabulous Python libraries for data science have really propelled the language to the top of the list, in terms of users.

Post reply on HN