4 ms·
So you can't give an example and are evading. So I just don't take you seriously anymore until you give an example here. Because this is a typical defensive att
by bero1985 4y ago
So you can't give an example and are evading. So I just don't take you seriously anymore until you give an example here. Because this is a typical defensive attitude of those who have no real arguments in the end.
- moloch-hai 4y agoYou want me to write you a list of modern language features? Besides destructors? 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.
- bero1985 4y agoSorry, but Object Pascal has been providing most of this for everything. So this shows that you haven't really informed yourself. 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.
- moloch-hai 4y agoI am corrected. 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.