I realized the difference with regards to constructors. In OOP, you can compile your classes, no problem. Then, when you want to instantiate a class, you use the new
keyword which calls the class constructor.
In contract-oriented programing (COP), the constructor performs a similar function. Per solidity docs: When a contract is created, its constructor (a function declared with the constructor keyword) is executed once. This is where you can run contract initialization code.
So I believe the constructor function is run on deployment, e.g., when you run truffle migrate
. Thus, you need to supply contract arguments. I designed my contracts in an OOP mindset, and so my constructor had args that were to be provided by user input. So having args for contract deployment didn't make sense.
This made me realize that a contract has quite a few nuances from an OOP class.