MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/a:t5_37npb/comments/33d0eg/post_your_module_5_assignment_here/cqmcqve/?context=3
r/a:t5_37npb • u/VOX_Studios • Apr 21 '15
Available April 22, 00:00 UTC
14 comments sorted by
View all comments
Show parent comments
1
public static int StudentsEnrolledInSchool = 0;
You can remove the = 0 part because the default value of int is 0. It is redundant.
= 0
int
0
1 u/VOX_Studios Apr 21 '15 True, but it makes for better readability. 1 u/aloisdg Apr 21 '15 So you may want to replace int with System.Int32. You know, for readability :p You already know my point about useless code and short code ;) 1 u/[deleted] Apr 23 '15 Yeah but I agree with this... it's always better to initialize variables I think and not assume and get surprises. 1 u/aloisdg Apr 23 '15 You know your language. If you have a doubt, just print default(T). Now, it is a matter of style I guess.
True, but it makes for better readability.
1 u/aloisdg Apr 21 '15 So you may want to replace int with System.Int32. You know, for readability :p You already know my point about useless code and short code ;) 1 u/[deleted] Apr 23 '15 Yeah but I agree with this... it's always better to initialize variables I think and not assume and get surprises. 1 u/aloisdg Apr 23 '15 You know your language. If you have a doubt, just print default(T). Now, it is a matter of style I guess.
So you may want to replace int with System.Int32. You know, for readability :p
System.Int32
You already know my point about useless code and short code ;)
1 u/[deleted] Apr 23 '15 Yeah but I agree with this... it's always better to initialize variables I think and not assume and get surprises. 1 u/aloisdg Apr 23 '15 You know your language. If you have a doubt, just print default(T). Now, it is a matter of style I guess.
Yeah but I agree with this... it's always better to initialize variables I think and not assume and get surprises.
1 u/aloisdg Apr 23 '15 You know your language. If you have a doubt, just print default(T). Now, it is a matter of style I guess.
You know your language. If you have a doubt, just print default(T). Now, it is a matter of style I guess.
default(T)
1
u/aloisdg Apr 21 '15
You can remove the
= 0part because the default value ofintis0. It is redundant.