📜 ⬆️ ⬇️

How to stop programming in Delphi and start living

If you,% username%, barely read the title of this article, you feel butthurt persistent aversion to the author, if the words "TForm1", "circular reference" and "Access violation" are not an empty sound, if after another holivar in the corner of consciousness again stirred worm - this article is for you.

With enviable regularity, new articles appear for both supporters and opponents of Delphi, and invariably with new force the holivar flares up. And if 10–15 years ago, holivar was called “Delphi vs C ++”, now the front has moved close to the trenches of supporters of the former Borland and the dispute is already going on within the framework of “Delphi vs non-Delphi”. Even the most stubborn followers of N. Wirth sometimes wonder why they suddenly became outcasts and cranks in the community of programmers?
If you, the reader, still think that you do not need anything other than Delphi for work, compare at least salaries for Delphi jobs of the same Java. Have a desire to learn anything other than Delphi? I will tell you where to start based on my own experience.

Where do Delphi programmers come from


As a student, 7-8 years ago I got a job in a small company as a tester. Years went by, I mastered Delphi, on which all the desktop applications of this company were written, became a leading programmer. I do not consider myself a guru, but Delphi and VCL for me is a book that was read to the holes. All the holes had to learn to either bypass or close their own patches. In fairness it should be said that the VCL has very few frank failures. Much of what has been in Delphi a long time ago has recently begun to appear in other platforms, but at the moment Delphi has almost no advantages over modern development tools. Alas, this is a fact.

Some time ago, the big bosses invited me to a meeting and persuaded me to take up a new project. I had to put my beloved Delphi7 in the darkest and dustiest corner of the hard drive and, armed with the Internet, urgently master Qt. From the depths of the memory, tightened by the web, little by little the modest institute knowledge of C. emerged. Coupled with the popular books on C ++ and the Qt documentation, they began to give the first results.
')
When developing desktop applications in any programming language, sooner or later you will come across C syntax and C ++ elements. These are documentation and examples and painful "translation" of heders into your favorite language. With the advent of experience, the Delphi programmer can still reasonably understand C ++ programs, an abundance of “asterisks”, “anpersands”, “==” symbols no longer seem meaningless porridge and the plot of insidious Stroustrup to destroy your brain cells. In the end, you begin to see a certain beauty in some constructions. Further we will assume that the reader is able to understand C-syntax well.

So, the reader agrees to learn something new, but what to choose?

The first way. Simplest. C #


From modern C # languages, oddly enough, the most easily perceived Delphi-oriented brains. To switch from Delphi to C # it is not at all necessary to start with a thick book from Microsoft. Most things will be intuitive, the rest is in MSDN. All objects, as it should be, are pointers, methods and properties are always accessible through a “dot”, no to you "->". Automatic garbage collection, of course, will cause a reproachful shake of the head of a real Delphist, but you quickly get used to the good. It is worth noting that programming in C # is possible not only in Visual studio, there is a great SharpDevelop IDE. It is free , like Delphi . The threshold of entry is minimal - installed, launched, let's go! And in this and in another environment, you can grab computer programming with a mouse, as we used to do it in Delphi: the form editor is fundamentally no different, and double clicking on the button will create a click handler method. After half an hour, you can make the first helloworld, after a day roll out a working prototype of your own GPS-navigator for an old but beloved PDA on Windows CE, and in a week or two you will start a new commercial project on it.
Most importantly, do not forget, the comparison operator for equality is double equals "==". It is impossible to understand, you just need to remember.

The second path is thorny. C ++


Comparing Delphi and C ++, you can draw the following analogy: Delphi is a strong totalitarian state. Confess his ideology - and you will live happily ever after and even reach certain heights. To make a career easy and pleasant, the path is destined. But it is worth taking a step to the side - shooting!
C ++ is a democracy. Do you want to - do so, do you want - commercials. Or spit and do it your way. But for your actions, please respond yourself.

There will already have to read the special literature. Personally, I always prefer books for beginners. It is important to firmly understand the basic things, then you will reach the aerobatics more quickly. At the moment, I am finishing up reading C ++ for beginners by Herbert Shildt. If you are really an experienced Delphi programmer, you can not look through the first hundred pages very carefully. Particular attention should be paid to work with pointers and the object model.

Now you need to select IDE. You can take a proven Visual Studio, but I chose Qt. It is free, cross-platform, has a rich set of classes, an excellent IDE, as well as wide community support. We swing Qt, we put, everything! We must pay tribute, Qt does not bother the novice programmer with unnecessary questions, has built-in documentation, examples. All as at expensive commercial IDE. Mouse programming is no longer possible, although it may be for the better.
The first thing that does not fit into the Delphi-oriented brain is the absence of the primitive type string. This is hard to get used to, but it is. Secondly, in order to use our usual approach to working with objects, we will have to explicitly declare them as pointers. Third, the module interface is usually stored in separate header files. It seems superfluous at first glance, but, as is known, they don’t go to a foreign monastery with its charter. These are just first impressions. Having digested and interpreted them, we arm ourselves with books, manuals, google and start turning our ideas about programming. Qt to help you.

The third way. Winding. Web


Want to open new horizons - welcome to web-programming. Anarchy reigns here. Dozens of technologies, hundreds of implementations, thousands of mutually exclusive recommendations. There is no development environment in which the whole project could be done. However, it's worth a try, it's interesting. However, in spite of the abundance and simplicity of most web technologies, it is no easier to make a quality product than a desktop application.

Conclusion



What you choose is up to you, of course. Even if you stay true Delphi is your choice, and not the worst, I must say. In any case, the reader, remember: the quality of the product is determined by your abilities and skills, and only the very last thing depends on the tools.

PS: For what I really like delphi, after all, this is a quick compilation:
image

Source: https://habr.com/ru/post/112752/


All Articles