3 ms·
What's wrong with Object Pascal? "Plain" Pascal is about as efficient as C, uses slightly less memory, is safer because of its lower dependency on pointers, an
by rahen 4y ago
What's wrong with Object Pascal?
"Plain" Pascal is about as efficient as C, uses slightly less memory, is safer because of its lower dependency on pointers, and is easy to work with, especially with strings.
Then Object Pascal has classes, units, interfaces, generics and type safety. Is it still not enough?
https://castle-engine.io/modern_pascal https://castle-engine.io/modern_pascal
An alternative would be to build a Go program with a wish/tk frontend, which is also cross platform, native and simple to write. It's actually straightforward to do with go-pipes for the binding with wish, and provides a nice decoupling between the program and its UI. Also, it's fairly small and efficient unlike Qt, or worse, web technologies.
- alexvoda 4y agoIndeed, it is a modern language even if it is rather different from what we are used to today (mostly C descendants). It is a niche choice but it is not outdated.
- rcarmo 4y agoAs someone who wrote it 30 years ago, I have no interest in going back. And if any of my little tools become popular, I couldn't find anyone to pick them up after me.
- rcarmo 4y agoI find it clunky and verbose. I wrote Pascal and Modula-2 during my VAX years and honestly don't want to go back 30 years or so... But I do find go to be an interesting alternative, as long as no web components are involved.
- andy128k 4y agoLack of automatic memory management (garbage collector, smart pointers, ARC...).
- jstimpfle 4y agoA couple years ago I worked as a programmer in a 1-2M SLOC enterprise Delphi codebase for 6 months (I believe Delphi is basically Object Pascal). It let me do my work. Under the hood there is the same simple machine model as C and you can access it ok, but the ecosystem around it is considerably clunkier. 90's OOP craze is very present. The various container libraries are composed of different strata of types and classes that do the same things but with different philosophies that were popular over time. Mix of 0-based and 1-based indexing in various string and array types is one of the most annoying problems that I can recall. Syntax-wise, it was weird the we had to do a lot of "PFoo" pointer-to-foo style typedefs. Syntax has a few strange "addressing" models builtin, including out vars etc. Allocation using "SetLength" is weird, a function that takes a dynamic array can realloc it but the changes would not (or only when reallocation was required?) reflect in the caller. I resorted to plain pointers and manual memory management, because everything else was too confusing for me. To wrap up, it has a lot of fluff built in that doesn't scale because of non-orthogonality of features, and some OOP that is hard to use IMHO because it is too implicit. As a C programmer I am biased but I find that the usable parts are the C-like parts. The syntax is considerably more clunky compared to C, with all the keywords that tire the eyes and fingers after writing a couple hundreds lines of code. On the plus side, I'm not an ecosystem guy but I'm sure the ecosystem has a lot to offer functionality-wise, including extensive coverage of the Win32 API. And the compiler is really fast, I have good memories of it and the (Embarcadero) IDE. A big reason why it's fast is that the syntax and module system are better designed than C as far as allowing efficient implementation.