よくあるコーディングの間違いとその解決策

DelphiCon 2023 で、Delphi は 28周年を迎えました。このビデオでは、Carlos Agnes が、 Delphi コンサルタントとしての10 年以上の経験を共有します。「You’re Doing it WrongYou're Doing it Wrong」と題されたこのプレゼンでは、コーディング時に多くの開発者が犯してしまいがちな一般的な間違いのいくつかを取り上げます。それが Windowsプログラム開発 の一部であるか、macOS、iOS、Android などの他のプラットフォームであるかに関係なく、明らかに誤った書き方であったり行儀の悪いテクニックが、予想よりも多くの開発者によって行われているのです。

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 無料 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


RAD Studio、Delphi、C++Builderを用いれば、開発時間を短縮し、より早く市場に投入可能!
Design. Code. Compile. Deploy.
トライアル版をダウンロードいますぐアップグレード!

Delphi Community Edition(無料)C++Builder Community Edition(無料)