Why Object Pascal Is More Than Meets the Eye: Exploring the Power and
blog.rosseaux.net
blog.rosseaux.net
(Turbo) Pascal was the second programming language I learned (starting programming with ActionScript 2.0 to make Flash games) and I remember really enjoying it. I still miss how good it felt to instantly compile code.
That was 15 years ago. Looking back, it's funny how my dev experience is not really better than what it was back then.
I nearly choked on my coffee.
Well, that's a completely different language category. Object Pascal is rather comparable to C++ than to Rust; the latter is more an option for languages with automatic memory management in that the memory management is moved from runtime to compile time, thus e.g. gaining performance.
If it had destructors, there would be something to build on.
Destructors are a huge game-changer. I don't think GP was joking at all.
Btw. Object Pascal has descructors as well, and destructors by themselves have nothing to do with object-orientation; they can be implemented also in a non-OO language. But C - in contrast to Object Pascal - is definitely not an OO language (not in this nor any other universe); since every child knows this, it must be a joke.
As I said, that's how I read it. But it could be that your reading was correct...
Inheritance is just not often useful, unless you have nothing else to organize with. Sometimes it is just the right thing, but not often enough to need to be built into the language. If your language is expressive, you can make an inheritance library and use it to make your base and derived types on those occasions when they actually are useful.
Namespaces, generics, lambdas, pattern matching, collection literals, destructured bindings, exceptions, sum types, smart pointers, type inference, ...
I could go on. You are anyway welcome not to take me, or anyone else you choose, seriously.
Even smart-pointers can be implemented in Object Pascal quite fast with a Generics class together with a Reference Counting interface, because, admittedly, such a thing is >not yet< implemented in the Object Pascal Standard Library itself.
Exceptions have ObjectPascal (try finally end; try except an; TException etc.), namespaces too (unit Foo.Bar.Thing.Stuff; TClass.TSubClass.TSubSubClass etc.), generics too (type TClass<T>=class ... end; function Func<A, B>(Foo: A; Bar: B):Boolean; etc.), lambdas (anonymous functions, BlaVar := function:integer begin result := 123; end; ) also, collection literals also (BlaVar := [1, 2, 3]; BlaVar := BlaVar + [42, 23]; FooTValueArray := ['v', 2, 3.14159]), destructured bindings also via RTTI magic, sum types also in the form of Variant or TValue, and so on.
Only type inference a la C++'s auto is not, but in my opinion this is a bad anti-pattern anyway, because Object Pascal code should always be readable, where something like "auto Foo := Bar;" would only interrupt the reading flow, where you would have to think about what data type it is in the end.
Here one sees again what I wrote in my blogpost, that people like you don't really know Object Pascal or because of their arrogant attitude don't want to know what it includes and what not.
But the importance of type inference (which does not, BTW, originate in C++) is that it enables declarations in circumstances where the type cannot be named, or even just not conveniently.
But honestly - neither C nor Object Pascal are considered obsolete by folks including me.
Some of the most productive people I know write most of their code in Object Pascal.
Really big companies still use Object Pascal, even if they could have switched to a different language a long time ago; but they don't. Because Object Pascal is a proper language with a lot of useful features, but without all the bloat.
Obsolescence is, when no one is using it any more, not when some people think it is.