3 ms·
How's that redundant? In C# you would just "var something = new object()", so there wouldn't be any redundancy at all.
by iaskwhy 15y ago
How's that redundant? In C# you would just "var something = new object()", so there wouldn't be any redundancy at all.
- Peaker 15y agoI was replying to: "Visual Studio does it for me. I can see the point if you say it's longer to read but it's also much clearer," So he's saying that: Circle circle = new Circle() is typed by Visual Studio for you, and clearer to read. I don't think it's clearer to read.
- justncase80 15y agoIt's kind of a misnomer too, because only the second circle is typed for you so you had to type Circle at least once... which is the same as if you were typing var. So it's not only not saving you much effort it's uglier. And with more complex types it's downright evil (to not use var).