+ 3
Survey
Do you guys prefer your variables with a type, like c++, or without, like python? e.g. c++ int i = 5; e.g. python i = 5;
4 Réponses
+ 8
I prefer Vb.net variable Declaration.
Dim var1 as Integer
var1=5
+ 6
I prefer the type, seems more optimal. Declaring the type allows the compiler to know how much memory may be used at runTime. Also, error checking be ezpz.
ps: You don't have to declare a type in c++, you can use auto:
auto a = 5; // int
or
auto b = "test"; // string
+ 5
Well, i code in Javascript i can afford both 😀
+ 5
yea sometimes its easier to just say var = "hello";
but sometimes i think putting the specific data type is better for code debugging and maintaining