MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/it9lw9/java_15_released/g5grtfl/?context=3
r/programming • u/[deleted] • Sep 15 '20
130 comments sorted by
View all comments
Show parent comments
12
My colleagues are still afraid of using var
Look on the bright side. Better than that having colleagues who just sprinkle var everywhere.
var
17 u/Programmdude Sep 15 '20 Var is good when you already know the type.var x = 0; // Good var y = new FooBar(); // Good var z = ProcessRequest(); // BadPersonally I use resharper (or intellij, webstorm) and so it just inserts the type anyway. 7 u/eeperson Sep 16 '20 Why is the last one bad? The type should just be a mouse over away. 2 u/irishsultan Sep 16 '20 You can't copy/paste text in a mouse over, a mouse over hides other parts of your screen, it takes more time to get your mouse in position than it would take to read it, I could go on.
17
Var is good when you already know the type.
var x = 0; // Good var y = new FooBar(); // Good var z = ProcessRequest(); // Bad
Personally I use resharper (or intellij, webstorm) and so it just inserts the type anyway.
7 u/eeperson Sep 16 '20 Why is the last one bad? The type should just be a mouse over away. 2 u/irishsultan Sep 16 '20 You can't copy/paste text in a mouse over, a mouse over hides other parts of your screen, it takes more time to get your mouse in position than it would take to read it, I could go on.
7
Why is the last one bad? The type should just be a mouse over away.
2 u/irishsultan Sep 16 '20 You can't copy/paste text in a mouse over, a mouse over hides other parts of your screen, it takes more time to get your mouse in position than it would take to read it, I could go on.
2
You can't copy/paste text in a mouse over, a mouse over hides other parts of your screen, it takes more time to get your mouse in position than it would take to read it, I could go on.
12
u/Certain_Abroad Sep 15 '20
Look on the bright side. Better than that having colleagues who just sprinkle
vareverywhere.