"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…
Why I use Object Pascal
71–80 of 235 posts
Re: Why I use Object Pascal
#72"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…
Nonsense. Lisp has a plethora of standard classes: T, NUMBER, PATHNAME, SYMBOL, SIMPLE-ARRAY, BASE-STRING &c. &c. &c. In fact, I just ran this on a pristine SBCL (no user or :
(let ((ch (make-hash-table :test 'eq)))
(labels ((pc (class)
(loop for subclass in (sb-mop:class-direct-subclasses class)
unless (gethash subclass ch)
do (progn
(setf (gethash subclass ch) t)
(pc subclass)))))
(pc (find-class t)))
(length (loop for class being each hash-key of ch collect class)))
→ 659
Yes, a basic running SBCL has six hundred and fifty-nine classes built into it. It all works remarkably well.> one can argue that CLOS isn't what we normally describe as OOP
Probably not, but it's better.
> Both normally have a global namespace.
CLOS classes are themselves instances, identified by a symbol which lives in a package — i.e., within a namespace. E.g:
(defclass foo () ())
→ #
(defclass swank::foo () ())
→ #
(make-instance 'foo)
→ #
(make-instance 'swank::foo)
→ #
Those are two different classes, both name FOO, but their names live in different packages.Re: Why I use Object Pascal
#73How 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.
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 software development switched to interpreted and VM-based languages, and language interoperability became a problem.
Re: Why I use Object Pascal
#74Earlier quoted context omitted.
From what I've read Object Pascal is just another name for Delphi but without the trademark hassle.
No need to speculate[0]. The name "object pascal" was firstly used by apple for their dialect of pascal. Then Borland came and evolved Turbo Pascal into Object Pascal(and brand it Delphi) and then fpc came and branded them a open source object pascal implementation. As for Pascal vs Object Pascal, Procedural vs OOP, Think C vs C++(not that I'm saying c++ is better). [0]: https://en.wikipedia.org/wiki/Object_Pascal
"Borland used the name Object Pascal for the programming language in the first versions of Delphi, but later renamed it to the Delphi programming language. However, compilers that claim to be compatible with Object Pascal are often trying to be compatible with Delphi source code.[citation needed] Because Delphi is trademarked, compatible compilers continued using the name Object Pascal"
You're still right that Object Pascal can encompass more than just Delphi.
Re: Why I use Object Pascal
#75What caused pascal to lose out to C? Seems like it was a good language that had developer uptake.
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.
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 Pascal there played a big role in Pascal's overall decline vs C.
edit: I think this is the article I'm thinking of:
https://books.google.ca/books?id=NZrPkWywRXgC&pg=PA75&lpg=PA...
Re: Why I use Object Pascal
#76"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.
> 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. I have been searching for it for 15 min now, but last month or so on hn there was a article comparing programming languages and compilers. fpc performance was comparable to c. Also a mvp production exe will be 2.5 MB, no stdlib/.net/qt needed.
This is a pro of Pascal then :)
I was also looking for the pros of Pascal in contrast to what we've come to expect of languages while skimming the article.
Re: Why I use Object Pascal
#77What caused pascal to lose out to C? Seems like it was a good language that had developer uptake.
Re: Why I use Object Pascal
#78I've tried picking up Free Pascal and, for me, the documentation is lacking. I come from C# where Microsoft has amazing documentation and small examples on how to use just about every single class in the .NET framework. I guess I'm just spoiled with the documentation I have had and need to get used to it.
Re: Why I use Object Pascal
#79Re: Why I use Object Pascal
#80I've lately been trying out FreePascal for building my indie games (which have in the past been in C, Python, Java, Objective-C, and finally JavaScript), and it's going well enough. There's certainly room for improvement, and the Lazarus IDE is not at all to my taste, but it's likely to be my next-ten-years language. https://mdhughes.tech/2017/09/02/pascal/ and a couple of followup posts https://mdhughes.tech/categor…