+ 1

how var keyword decreases the readability?? i think it is bttr to use,for faster working..

12th Apr 2016, 7:08 PM
Piyush Singh
Piyush Singh - avatar
3 Answers
+ 2
yes it is much easier to use than other data types. So if you know what is the right data type to use then why don't you use it instead of always using var? It seems like your making yourself an idiot if other see your program! Haha and it is very irritating to see a source code full of var. Just explaining :)
14th Apr 2016, 7:40 PM
a l l y z a
a l l y z a - avatar
0
var result = _carService.GetCars(); // What is in the result variable? Can you tell it on the first sight? How would you work with it? IList<Car> cars = _carService.GetCars(); // Now I know what to do. I see I can iterate through the cars. :)
9th May 2016, 9:16 PM
Milan JaroĆĄ
Milan JaroĆĄ - avatar
0
adding to that, var cud be used like, var employee = new Employee(); here right hand side clearly says what type the employee is going to be, so quite readable.
26th Nov 2016, 6:14 AM
AASHISH KUMAR
AASHISH KUMAR - avatar