If you write very short programs (for example, simple algorithms), it may seem more convenient to simply add your main method to a class containing some basic program logic. However, for large projects, it is very useful to separate your main method from business logic / database access / everything else, which should work as an encapsulated object.
The main method should simply give you the beginning of the chain so that you can easily follow the workflow of your program from the very beginning. Enabling logic (even simple number / string conversions) in a class containing the main method can lead to unnecessary chaos, try to separate everything that you really don't need, and put it in helper classes.
Niemand
source share