3 ms·
In the examples, the parameters are value types. However, in the real world, they are usually either objects or functions. Also, when you write code this way,
by sirmarksalot 13y ago
In the examples, the parameters are value types. However, in the real world, they are usually either objects or functions.
Also, when you write code this way, you don't end up calling the constructors very often. You end up with a big up-front construction/wiring-up phase, after which your objects/functions go about their business handling user input and making server requests.
I've found that this, combined with an MVC or MVVM methodology, essentially breaks my code down into functions and data records, with the two rarely intertwining. You basically only use the "new" operator either at the start of the program's lifetime, or when you're converting data from one data type to another.