Hey there. I am bloody new to Ethereum and struggling with the Constructor/function thing when creating a Contract. I just read only to use the Constructor. But as i'm using the variable 'initialSupply' as in the tutorial recommended, initialSupply is unknown. So how do i declare the variable without the function? And where is the benefit for not hardcoding it?
Hi @AlexanderWelling what are you using to deploy your contract? Truffle o Remix?
You could hardcode without any problem or any consequence of any kind. Even, when you are doing test is maybe the most practical thing if you are in Remix. You don't have to pass argument for each deployment.
Then for elegance maybe people or when people share a contract as template, they create a contract with a constructor that take parameters.
Thank you @Chococoin for responding, I'm using none of them. I just wrote it in the Ethereum Wallet Software for learning purposes. But i suppose i will switch on Truffle when things become more serious.