+ 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;

13th Apr 2017, 3:51 PM
Edward
4 odpowiedzi
+ 8
I prefer Vb.net variable Declaration. Dim var1 as Integer var1=5
13th Apr 2017, 5:50 PM
Style Jr.
Style Jr. - avatar
+ 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
13th Apr 2017, 5:25 PM
Rrestoring faith
Rrestoring faith - avatar
+ 5
Well, i code in Javascript i can afford both 😀
13th Apr 2017, 3:53 PM
Ashwani Kumar
Ashwani Kumar - avatar
+ 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
13th Apr 2017, 4:00 PM
Edward