ObjectPascal: It's not Go, nor Python
If I told you that Delphi is still being actively being developed and sold, would you believe me? A lot of people believe Delphi, and to that effect the entire ObjectPascal language is entirely dead. Some people may have still heard of FreePascal in passing, but a lot of people probably thought Delphi itself stopped being developed in the 2000s. I originally had this believe, and thought that FreePascal and Lazarus were the only projects keeping it alive, I had no idea that Delphi was still being developed. That was until around 2016 or so, when I started to learn ObjectPascal again for side-projects. I soon saw that there were totally modern versions of Delphi still being developed and sold. At this time, there was no Community Edition of Delphi, and so I was unable to try it. Skip forward several years, and guess what? Delphi now has a community edition, which can be used freely for open source projects, and commercial software up to USD $5,000, after that you need to purchase a license and upgrade. This is very reasonable considering what it provides you.
Wait? Delphi is still around, doubt it can do this or that
You'd very be ignorant to assume that I'm afraid. With even the Community Edition of Delphi, you can compile fully native applications, not interpreted, and definitely not Electron. If you actually look at the feature of the Community Edition, you could probably see that it is actually a direct competitor to Electron, as it can compile completely native cross-platform applications to Windows, macOS, iOS, and yes, Android as well. All with... have you guessed it? One single unified code-base. Delphi is a direct competitor with Electron apps without neither of them even knowing they were competing. If you don't believe me, check out the specs of the modern Delphi, and tell me that doesn't sound like Electron's mission as well? It's that Delphi actually does it better, but people are falling for the more popular product, that is perhaps over hyped and over-marketed.
We shouldn't be finding ways to bring the web to native apps, we should instead be finding ways to effortlessly turn native apps into a usable web application. Delphi has fully solved that problem back in the late 90s with the original version of Delphi. The best idea they ever made when creating Delphi was the VCL, the perfect and extendable abstraction layer. It is through an evolved VCL that Delphi was able to make Delphi work seamlessly in the modern world, all while nobody was paying attention.
Delphi needs more credit
Delphi has already solved so many problems in programming, but nobody is paying attention, and instead all going off on their own to spin their own programming language. If you need good memory management that feels almost like a garbage collected language, or an interpreted language, Delphi actually has you covered. While the programming language is compiled to native binary code, it does not use the C runtime library, or depend on any of the C libraries in your system. Your binary only links to the system C library if you link in a third party library which was written in C, or you use the C Memory Manager instead of the Pascal one. ObjectPascal is it's own beast, with it's complete independent runtime. Much like you would see in an interpreted language. By using it's own memory management system, it is able to keep track of dynamic allocations by your application, and manage that memory effortless for you. However, if you do desire to manually manage some objects and memory yourself, you can also do that. You can use whichever makes sense in that part of your program, automatic memory management, or a quick allocation which will be freed very shortly for a buffer. It gives the programmer the power to choose from within their code, it's really bound to either type of memory management, and both can be mixed effortlessly.
Delphi also support modern exception trapping, and it's oddly similar to Python:
try
{ Some Code Here }
except
On EDivZero: WriteLn('Can''t divide by zero.');
end;
If you are using a class object for a quick single use, here is an example how it can be put together with the exception handling to effortless free the object after:
with TFPHTTPClient.Create(Nil) do
try
WriteLn(Get(url));
finally
Free;
end;
A bit too similar to Python sometimes
As I was learning ObjectPascal, I began to notice some similarities to Python, namely in how some included classes work, namely the TThread, which uses an almost similar API to that of Python.
Other than that one class, the only other syntax is how methods are called, but that's about the same in a lot of languages, so not really similar to Python.
Something you may also have not known, but Delphi has full Python integration, if you can believe that? No? Well, it's called Delphi 4 Python. Isn't that just incredible? Delphi will only continue to surprise you more.
Both structured and object-oriented
With Delphi, you can create either structured programs, or use classes. You aren't forced to use either, and can even mix them together in your program, if you feel that something should be outside of a class. This is also why it feels a bit like Python, is you can do that in Python too.
It is very easy to see an overview of a module in your program, as each Pascal program has a very specific structure, that IDEs can just generate code for now, so stop complaining about this feature. In the interface section, you can see an overview of all public classes, methods, variables, and constants. Furthermore, unlike say C, this is the header file and the code essentially mixed into a single file, when compiled it creates a binary object file, ready to be linked into the main program.
Conclusion
I believe that when choosing a programming language, there is a lot to consider. However, in a lot of cases choosing Delphi over say C for a project, could save you a lot of headaches when it comes to memory management and cross-platform development. However, due note the license, if you plan on using it within your organization, as you most likely will not be able to use the Community Edition, and instead could first try Lazarus, to get a better feel of the ObjectPascal language itself, which might make it easier to convince people in your company to consider it for a project.
If you wish to learn Modern ObjectPascal, then the Castle Game Engine's excellent Modern ObjectPascal Introduction is the first place you should start. Oh, and yes, someone made a full 3D game engine in ObjectPascal, and can you guess what one of the targets is? The Nintendo Switch, if you can even believe that! So, you can actually create a modern ObjectPascal game and have it sold on a modern gaming console, imagine that... And people all thought Pascal was dead. They are all dead wrong.