Live data from Hacker News

Why I use Object Pascal

dubst3pp4.github.io

91–100 of 235 posts

Re: Why I use Object Pascal

#91
I know C# borrowed heavily from Pascal. (So much that a lot of its improvements over Java were overlooked.)

What's the advantage of using Pascal over C# or Java? Is it that Pascal outputs true compiled programs instead of requiring a VM?

Re: Why I use Object Pascal

#92
post #86

What caused pascal to lose out to C? Seems like it was a good language that had developer uptake.

Pascal was great when you were coloring within the lines, but C was more flexible. I don't think I was ever able to do image processing in Pascal, and I shudder to think what it would take to do a device driver. Pascal was my primary language from about 1980 to 1990, then I transitioned to C and from there to C++. I missed the whole Delphi train.

I was not programming in Pascal in the 80s, I started with BASIC around 1990 (in grade school). But I did use Pascal some in college (early 00s). I'm curious why you say you couldn't do image processing in Pascal, because that was an exercise we had in college and it wasn't difficult at all (though at the moment I could not recreate what I did, it's been too long since I've looked at Pascal). Was this a difficulty with early Pascal?

Re: Why I use Object Pascal

#93
post #91

I know C# borrowed heavily from Pascal. (So much that a lot of its improvements over Java were overlooked.) What's the advantage of using Pascal over C# or Java? Is it that Pascal outputs true compiled programs instead of requiring a VM?

Yes, it compiles native code, typically in a standalone .exe file, avoiding the framework dependency hell.

Another advantadge is that it compiles very fast (several orders of magnitude faster than C# (or C++)), so it's convenient.

Re: Why I use Object Pascal

#94
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…

C++ has namespaces. Yikes, I looked C namespaces. People are suggesting that you can put things in a struct. https://stackoverflow.com/questions/4396140/why-doesnt-ansi-...

Re: Why I use Object Pascal

#95

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…

Regarding those essays, I consider myself lucky to have learned and used Pascal and Basic compilers before learning C.

Then I just had fun showing to disbelivers how to do in TP stuff that apparently only C was capable of.

Re: Why I use Object Pascal

#96

What caused pascal to lose out to C? Seems like it was a good language that had developer uptake.

Things are different today I hope, but back in the 90's when I was teaching CS, Pascal was not very portable or standardized. Even some basic operations like opening a file were not standardized. Turbo Pascal and AIX's Pascal (the two variants I dealt with back then) did this operation differently.

Re: Why I use Object Pascal

#97
post #17

Earlier quoted context omitted.

At work, I maintain an in-house application written in Delphi/ObjectPascal. In my case I do not need anything beyond what is supplied by the environment. The UI library is part of the environment, so is the database interface, ... basically, that is all the application needs. Generally speaking, applications that basically are a UI on top of a relational database probably don't need any external libraries. And those…

I don't know about Object Pascal to C++, but calling C libraries is a no-brainier. There is a bit of a definition wrapping, and then the C library looks like a pascal one, and unlike most interpreted/JIT/GC/etc languages where the programmer or wrapper has to jump through hoops to transform the data structures to match an in memory C structure, pascal just goes ahead and uses the same datastructure. This yields a far…

In Delphi is quite easy if you make use of C++ Builder, since they share parts of the tooling.

With another C++ compiler on Windows, COM is a better approach.

Anywhere else than the usual plain C like APIs.

Re: Why I use Object Pascal

#98
post #73
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.

Curiously enough, C still has native means to call Pascal functions. At least in the past, the interoperability between languages was taken very seriously, because the industry used to abhor the idea of having to rewrite things just because of the need to use a different language (e.g. PL/I instead of Fortran); the object module format was designed to be language-independent. As computers became faster much of softwa…

This is visible in the surviving IBM and Unisys mainframes.

Re: Why I use Object Pascal

#99
post #25

I feel kind of sheepish to admit that "Why Pascal is not my favorite programming language" had a huge impact on me and caused me to avoid Pascal until I was forced to deal with it because a coworker quit and dropped maintenance of an in-house application in my lap. I was happy to realize that most of the criticism in that essay no longer applies to relatively recent versions of the language/IDE (Delphi 7 in my case).…

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.

Re: Why I use Object Pascal

#100
post #75

Earlier quoted context omitted.

1) The popularity of UNIX where C was the standard language 2) The fact that, much like BASIC, most implementations of the language didn't follow the standard. In practice, Turbo Pascal was more of a standard than the official one.

It was more than just the popularity of Unix. A while back, I ended up following a link on HN and reading a bunch of old computer magazines. I came across an article by Peter Norton (in PC Magazine) from around 1986 or 87. In it, he discussed why C was rapidly displacing Pascal among DOS programmers. Not that Unix didn't have an effect, but as DOS and then windows exploded in popularity in the 80s, C displacing Pasca…

In those days without Internet and expensive dial-up access to BBS limited to 5 simultaneous users, it depended very much where in the globe we are talking about.

On my area in Portugal, using C was mostly for university projects.

For anything else we were using Turbo Pascal and Assembly, with Clipper for business applications.

Actually many MS-DOS systems programming books had code listings in C, Pascal and Assembly.

Post reply on HN