Hacker News new | ask | show | jobs
by h4l0 2346 days ago
I really don't want to sound cynical about this great initiative(!) but it saddens me that among many open modern languages and tools, they instead opted for Delphi.

I cannot think of a single positive reason behind this decision in 2020. All I can think of is that the people that came to this conclusion are the ones who graduated from Computer Science related studies in ~1998-2004~ and immediately got themselves in politics. I lost count of how many times have I heard that if you pay for it, it's just better...

Finally, I admit that I'm definitely highly biassed when it comes to Turkish Politics.

8 comments

All modern tools are really complicated compared to Delphi. I remember Delphi was so intuitive to design GUI and program its events so i could start making my own programs right after professor showed me how to make a button and handle onClick event.
Lazarus is pretty much a free and open source Delphi (yes there are differences but they do not matter much) and really not any different in terms of difficulty compared to it.

https://www.lazarus-ide.org/

You can see it in action under Linux here where i make a simple puzzle game:

https://youtu.be/s_01Xhd2EJM?t=692

(if the time stamp doesn't work, skip to 11:32, the previous ~11 minutes are me downloading, compiling it and configuring it - not 100% necessary on Linux and on Windows i never do that as the installer is a classic wizard-based one, but as i write on the video, i prefer to compile it when using it on Linux - also note that on Windows you do not need to install FPC as it comes bundled with Lazarus, it is really just running the installer, double clicking the desktop icon and you're ready)

Well, in all fairness, the same can be said about Visual Basic and all the <inser name here> .NET languages. And I'm not even a Windows programmer.
Delphi does however cross the stack better than VB - with inline assembler being available, and a pretty decent debugger with integrated disassembler.
Desktop development with current generation of Visual Studio is leaps and bounds better than Delphi ever was.
Positive reasons: 1) It runs out of the box without and Internet ocnnection. 2) The IDE is extremely good. 3) It teaches OOP and memory management (something often forgotten by today's programmers). 4) It is capable of giving very low level access to the host machine (like C). 5) You can even use (and teach) tricky things like pointers.
Last time i checked recent versions of Delphi have DRM that need internet connection. I even remember someone from the official newsgroups saying that he had to install a crack so that they can use it on foot in their laptop when they had no internet connection.
TBH, I found the low-level pointer stuff to be inaccessible. There is so much magic going on behind the scenes, and on the other hand it's hard to do pointer value arithmetic as well as pointer type arithmetic (you need to create aliases to no end). C is much more convenient for dealing with pointers, and it makes it much more obvious what happens from reading the code.

In Delphi culture, people say PChar instead of char* , and make tons of PFoo and PPFoo. And I think the reason is that some syntactical restrictions made Pascal easier to implement back in its time (last I checked there were still significant restrictions in Delphi)

Is it that Pascal is simply popular as a teaching language in Turkey? A bit of googling shows lots of universities offering programming courses in Pascal, e.g. [1]. It is a good pedagogical language after all.

[1] https://www.metu.edu.tr/tr/system/files/2015-2017_general_ca...

The only reasonable alternative is Qt, but C++ is more complicated than Pascal.

Assuming they would want to try their hand at making money out of what they learn, they could target the kind of companies which were served by VB6 or FoxPro in the past :)

Anything web-based is ridiculously complicated and has worse performance.

Actually a very good alternative would be Java and JavaFX, maybe using Eclipse as the IDE.
I used either. Not really good alternative IMO
Well why not? I've used Delphi for years and also Java/JavaFX/Swing. There's not much reason to use Delphi anymore when Java IDEs can do the same things, and much more, and with docs that are just as good or better, all for free.
In Delphi I do desktop applications that perform real time low level device control, talk over USB and some specialized radio gizmos, DirectX graphics and multimedia processing, real time data presentation, bulk data processing, game like communications over UDP etc. etc. All at the same time from a different threads. Good luck doing it in Java. I did try doing low level stuff with it per client request and it felt like masochism. Java was created with the different things in mind.
The only thing that you seem to be right about is the low level device control stuff. Everything else is pretty much already easy enough to do in Java. The language was designed with multithreading in mind.
Delphi can show the assembly code generated for every line.

That is important to actually learn how the computer works

I would suggest IntelliJ than Eclipse presently.
Agreed. I discounted that becuase of the cost but I guess there's the community edition!
Or html canvas and js.
There are Python bindings for Qt.
One reason I could see, based on teaching teenagers programming. They want to build GUI applications and Delphi allows that very easily.

Sure C# and Visual Studio makes more sense and they could get everything for free, but maybe Turkey doesn't like/trust Microsoft.

When I was in undergrad taking Data Structures and Algorithms, the course was in C (or C++, I don't remember). But by that time I had already started programming GUIs in Windows (MFC days). It was actually really nice to wire up the base classes and operations for a data structure (push/pop/etc...) and then be able to see the operations working with a GUI. At the time, it was really cool to be able to click a "pop" button and see the head of a queue get removed.

It was even better to visually see various sort algorithms in motion.

So, really, I could see the appeal for that kind of teaching... but I still don't understand using Delphi/Pascal.

(Our first CS class was actually taught with Pascal and that was painful)

I agree the impact of writing code and seeing something onscreen is very important.

> I had already started programming GUIs in Windows (MFC days)

MFC and Delphi's UI model are completely incomparable. One is statically built, often in code, inflexible, hard to iterate, hard to use custom controls... and one is modern OO, buildable visually (streamed to text, so editable in text), incredibly flexible, very fast to modify, and with thousands of custom controls.

And these days it builds for macOS, mobile (iOS and Android), and Linux too. So it's a decent choice.

Well. If they went for a free, open solution, someone would say they went for the "cheap" option. Buying a million of commercial licenses sounds like a big investment, it sounds like someone cares.
Could just be most of Turkey's software i sin Delphi, or they plan on it being delphi. How much of other nations are similar with cobol etc? Except that no one is teaching it.
Define modern please. There is not a single thing about ObjectPascal language that relegates it as non-modern. Lack of new jobs - sure but that is a bit different subject.
The licensing model is straight out of the 80s.
How so? You mean that you can actually buy it and have permanent license instead of money being sucked from your account every month? Or get Lazarus for free and forget about pauing at all.
I'm not aware of Rustc leeching anything from my bank account. Or Scalac.

> Or get Lazarus for free and forget about pauing at all.

I wouldn't mind if the article was titled "Turkey preinstalls Lazarus on school computers".