Delphi Best Practices For A New Project In 2021 And Beyond
The goal of this tutorial is to describe the Delphi development ecosystem. It can be helpful for someone coming to Delphi from another programming language. Delphi is really easy to learn – the programming language syntax can be learned in hours. Pascal, from which Delphi’s Object Pascal language has evolved, has long been a very popular language in colleges and education for teaching the basic concepts of software development. Knowing the fundamentals of programming is a crucial part of programming. But there lies a whole ecosystem of terminology and techniques. It is always overwhelming for someone coming from a different background in technology. The other trouble is that there are so many different Delphi components, examples and libraries available and it can be quite daunting to decide which ones are the best for any given purpose. You’re spoilt for choice and sometimes too much choice can bring its own headaches. So to try and ease this small learning curve this article brings together a list of some of the most popular tools, libraries, best practices in Delphi. You may find more interesting demonstrations, tips, and tricks on our blog. How to start Delphi development? The first thing to do is to download Delphi from www.embarcadero.com. You can find the latest Delphi 10.4.2 Community Edition which is free for everyone. Be sure to install Delphi IDE with samples and help files that might come for help sometime in the future. How to work with Delphi programs in another code editor like VS Code? There is an official extension for Embarcadero Delphi in VS Code marketplace which provides you to work with the Delphi code in VS Code smoothly. Note that you need an active license (paid or trial) for Delphi 11 in order to use the DelphiLSP VS Code add-on. It will not work with the community edition. Yo use the DelphiLSP VS Code Add-In you just need to have the latest version of Embarcadero Delphi installed on your machine and generate an LSP config file. How to write readable and maintainable code in Delphi? Embarcadero Delphi compilers ignore any whitespace and allow for a lot of flexibility for writing code. But for the readability and maintainability purpose of the source code, Embarcadero has defined the style guide for Delphi’s Object Pascal. I recommend you to check out and learn how to write beautiful code with Object Pascal – or at least code that others find fits in with the generally accepted layout styling which is important if you work with a team or contribute to an Open Source project. How to format Delphi source code? Every developer writes code in their style. Since the Embarcadero compilers ignore any whitespace in which you can write the same code in hundreds of different ways, this can lead to unreadable source code. We can prevent this by applying default source code formatting or generate our formatting config file. While coding in the Code Editor, you can apply the Format Source context menu command to format the source code. Moreover, you can define your custom formatting style and save it to a config file. Then other team members can also utilize the same formatting style to make the source code maintainable. Check out the official documentation to learn more about this. Does Delphi have a package manager? If you have been […]
