dynamic-walls-demo icon indicating copy to clipboard operation
dynamic-walls-demo copied to clipboard

Var

Open aloisdg opened this issue 5 years ago • 4 comments

Hello,

Is there a reason why you are not using var?

aloisdg avatar Apr 02 '20 16:04 aloisdg

Hello aloisdg :) I am in love with typing variables, that's why :D There is no other reason. I was PHP programmer and not typing variables was pain in the ass (in PHP 5).

keypax avatar Apr 02 '20 22:04 keypax

Also, I'm pretty new to C# (I have started this project on the end of September 2019)

keypax avatar Apr 02 '20 22:04 keypax

In C# it is quite idiomatic to rely on var nowadays. Note that var is not dynamic. The type is still here and your intellisense should treat it as the correct type. it is a sweet sugar. :)

aloisdg avatar Apr 10 '20 19:04 aloisdg

Coming from Groovy where variables can be defined with def, I still prefer using the type. This way the code is clearer from the reader's perspective, plus it is more compatible with static code analysers.

dosaki avatar May 30 '20 16:05 dosaki