Delphi celebrated its 28th anniversary with the much-awaited DelphiCon 2023. In this video, Carlos Agnes will share his personal experiences from being a Delphi consultant for more than ten years. Entitled “You’re Doing it Wrong“, this presentation will highlight some of the common mistakes that most developers do when coding. Whether it is part of a Windows program development or with other platforms like macOS, iOS, or Android, apparently, there are a set of common mistakes and bad techniques made by more developers than you might think.
What are some common mistakes in coding?
First on the list is the IfThen function. We have learned from some sessions of Coding Boot Camp 2022 how to properly declare a variable and how to effectively use them for Mathematics. Here, we have learned the different If Statements. IfThen, for instance, is a very useful function but some developers forget that IfThen is not necessarily a ternary operator, or at least not a real one. It means that IfThen is not resolved at the compiler level but as a function or a normal library. Regardless of the Boolean expression that will be used as the first parameter, whether the parameter is true or not, both the second and the third parameter needs to be evaluated before returning one or another. The common mistake is that some developers provide one or even worse two parameters that are complex to evaluate.
Another common topic highlighted in this presentation is the use of the Short Circuit Evaluation, a programming concept in which the compiler skips the execution or evaluation of some sub-expressions in a logical expression. Another common mistake tackled in this video is the unnecessary type-casting tests. Another example of a process that most developers are probably doing wrong is the relationship between creating an object with a try, finally, and then calling the libre inside of the finally block. Carlos concluded the talk with another common mistake that most developers tend to overlook. Here, Carlos is advising developers to establish a Zero Warnings and Hints Policy to prevent software bugs. This means the source code is compiled with a high warning level and no compiler warning is acceptable.
To learn more about these common mistakes and how the solutions to correct them, feel free to watch this video from the recently concluded DelphiCon 2023