Recent

Author Topic: Precautions related to absence of a garbage collector  (Read 3605 times)

rnfpc

  • Full Member
  • ***
  • Posts: 101
Re: Precautions related to absence of a garbage collector
« Reply #30 on: May 15, 2023, 03:07:49 pm »
Very interesting and insightful writeup by @Warfley !

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: Precautions related to absence of a garbage collector
« Reply #31 on: May 15, 2023, 03:22:44 pm »
Many students of programming avoid Pascal when they read that it does not have a garbage collector, since garbage-collected languages are generally safer.

That is what they say, but the reality is more that intuitively most student take a trial-and-error to programming and thus end up with more forgiving languages. That is not just GC, but touches every aspect of programming

To really see the benefit they must first be given a problem that is hard to solve the trial and error way (e.g. embedded), or see that it is really hard to make really sizeable programs that way. But many students only encounter that near the end of their studies.


Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Precautions related to absence of a garbage collector
« Reply #32 on: May 15, 2023, 07:02:33 pm »
That is what they say, but the reality is more that intuitively most student take a trial-and-error to programming and thus end up with more forgiving languages.
This kindof assumes that people try out multiple languages, but from my experience, most people are very simple in that regard, they usually start with one language they want or have to learn and then stick to it for their first few years and projects. If that happens to be C# because they learned it to make a game in Unity or Unreal Engine, then chances are high when the next project came around, they would be using C# again.

Most people I met in Uni usually first really learned programming when they had a big University project (most often for Bachlors Thesis), where they did not really have a choice of the language, but afterwards when they had some knowledge about that language, they usually resorted to it for all following projects until they are "forced" to use something else.
People ususally start switching between languages to find what they are most comfortable with much later when they already have experience with a few languages.

From my personal experience, I've started learning Pascal when I was 8 or 9, but when I lost my Delphi license I decided to start with a free language that is similar, so I ended up with VB. From VB I then moved onto C#, then when I discovered Lazarus back to Pascal, while simultaniously learning C as this was the "King" of programming languages (i.e. the by far most popular programming language) back then. That was around the point where I realized that most languages are kinda samey anyway (at least those Algol decendents) and you can learn a language to a sufficient degree to use it in a project within one week.

But at first it takes a reason to learn a new language, because as a beginner new languages seem scary. When it took years to learn basic programming in one language, it's often hard to believe that you can then just switch to a new language within a few days. So if you want new students to learn your language, simply give them a reason to use it. It can be as simple as the professor requiring them to use the language for some courses, but a more "voluntary" approach is to simply be really really good in something.
Pascal is IMHO great for two things, first educational, as being a hybrid of a low level and a high level language allows you to explore everything, from low level memory faults like buffer overflows, to high level concepts like OOP design patterns and advanced software engineering techniques.
And the second thing Pascal excells at is native GUI development. When I've reverse engineered a game recently, where I needed a tool to just decode a binary file and display the fields of the data records, I've used Lazarus for it, because I could just start right of with a GUI and add new Edits and fill them with values as soon as I decoded one of the data fields. It's something I wouldn't want to do in Javascript (and I actually did do that because this tool should be integrated on a website and the Pascal version was just a proof of concept, so I can tell with certainty that it us much much harder to do this with Javascript, even if you already know everything beforehand), and because it needed to run on Linux, things like C# also were no alternative.

And while I'm not in university anymore, from my knowledge the current hot topic is still AI and potentially App development (even though that has cooled down a little since 2016ish) and maybe Game development (theres currently a bit of an indy games boom), and all of those things are technically possible with Pascal, but Pascal wouldn't be the first language that comes to mind for such things

 

TinyPortal © 2005-2018