3 ms·
Alright, sooo... Pascal kind of seems like the holy land of "get shit done" that isn't C or C/C++. At least as far as cross platform UI development goes that is
by rubyn00bie 6y ago
Alright, sooo... Pascal kind of seems like the holy land of "get shit done" that isn't C or C/C++. At least as far as cross platform UI development goes that isn't _electron_.
How is it maintaining a Object Pascal project in 2020? What are it's weak points? Anyone have some examples of "modern" apps written in Object Pascal or problem spaces it's still vastly better than the competition? Are there any like magical libraries, frameworks, or patterns?
- badsectoracula 6y agoThe main magical part is largely Lazarus and LCL for desktop application development. The slightly less magical part is that the language has many features that you often find in languages targeting a VM but instead it generates native executables (pure Free Pascal executables can be less than 50KB) with no mandatory external dependencies outside what comes with the OS. It also target a ton of platforms. But TBH outside of GUI development there isn't anything particularly special about Free Pascal that you wont find in any other language, especially if you do not care about requiring a VM (in which case something like C# will probably be the closest equivalent). One thing that it has though and personally i find it very important when it comes to maintenance is that the developers care a lot about backwards compatibility - existing code you wrote even 20 years ago will keep working either as-is or with very minor changes. Personally two issues i remember having were in one case when character encoding aware strings were introduced, i was treating a string as a byte buffer (prior to that change they were basically byte buffers) so i had to change a declaration from using "String" to use "RawByteString" (which behaves as a byte buffer) - that was a single line change. The other change was when at some point some years ago (i think it was when Delphi-compatible generics were introduced) the ClassName of a specialized generic class changed format. One issue Free Pascal and Lazarus have is that sometimes they feel a bit "messy" and unorganized or unpolished. But they are projects that are 100% community driven by many people, going back decades (especially FPC) so i guess that is to be expected, especially when they do not want to break people's code in pursuit of some ideal purity.
- brnt 6y agoMain thing holding me back is very small online community, most is using Delphi Pascal, not Freepascal, on very corporate and closed source projects, usually old codebases thus no new nice features, and those nice new features are often different between Freepascal and Delphi. So if you manage to get to see someone's code, it may be using features not implemented in or coded in modern Freepascal. And old Delphi Pascal suffers from similar things as 90ies C or C++: it skips modern features and uses a style that is contrary to what people now learn, expect or even enforce. Also, there are a few incompatibilities/differences in stdlib between Delphi and Freepascal, and it was very easy for me to run into them.
- badsectoracula 6y ago> And old Delphi Pascal suffers from similar things as 90ies C or C++: it skips modern features and uses a style that is contrary to what people now learn, expect or even enforce. Eh, even Delphi 1 has a lot more features than modern C and while there are new features added in Free Pascal over the years, the old stuff never got outdated or obsolete the same way that (theoretically) nobody writes C++98 (though in practice many do anyway, but they do it at night, hidden from all eyes :-P). Pretty much all Delphi-like Object Pascal compilers (Delphi itself, Free Pascal, Oxygen and i think a couple of others) use Delphi 7 as a common denominator and the main thing missing from Delphi 7 as a language is support for generics (but it still has a few collection classes). If you read a book about even, say, Delphi 3, most of it (outside the Borland-specific database stuff) will be valid in Lazarus. You'll just miss some additional features modern Free Pascal and Lazarus provides, but the older stuff aren't really obsolete or invalidated (this is also a neat thing about Free Pascal and Lazarus - the time you invest in learning them won't be wasted because the developers decided that now they'll try to do the same stuff but in a different way).
- brnt 6y agoI meant, from a modern day perspective of the respective languages. Oh and people write old dialects, the old Delphi geezers at the previous workplace also wrote pre C++98 C++, today. Impressive isn't it ;) Bigco's are all about decades old code bases.