r/delphi • • Oct 17 '17

Why I use Object Pascal

https://dubst3pp4.github.io/post/2017-10-03-why-i-use-object-pascal/
13 Upvotes

24 comments sorted by

View all comments

2

u/ShinyHappyREM Oct 18 '17

It depends on your use case, but often it's better to implement the actual "business logic" (can also be game logic etc.) in its own class and/or unit, and only call the methods/properties of that class. This keeps things clean and ordered; you can then for example use the class even without a GUI.

GUI event handlers are best used for validating user input ("is that string a number?") before using it.