|
|
|
|
|
by snazz
2094 days ago
|
|
Type inference is the usual tradeoff for being able to write statically-typed code efficiently. I think it's better than MyType something = new MyType(...);
like in old-school Java, is it not? IDEs and LSP-enabled editors are pretty much the standard nowadays, although I agree that it's nice to be able to read code without one.Also, that code you mentioned seems like bad style with the auto keyword; the type should be obvious. Do you have a better solution in mind? |
|
There are many places where you see code without IDE-like features. One that comes to mind is everything related to git. Web-based git tools like github, git GUIs, command-line git, you name it.
Besides, it's nice to be able to read and understand the code without needing to download the entire project and importing it into an IDE just for that.
My idea is that you almost always write in an IDE, but not necessarily read in one. Thus, for verbose languages, the IDE would generate most of that example for you (I know for sure IDEA does this exact completion) but it will be perfectly understandable in a git diff.