3 ms·
I've never liked this language feature very much. I'm the one that's doing the inference when I read the code.
by nsxwolf 11y ago
I've never liked this language feature very much. I'm the one that's doing the inference when I read the code.
- wmu 11y agoI totally agree, type inference speed writing a code, nothing more. For easy cases reading such code is OK (var path = "/usr/bin/whatever" - obvious), but with a more complex code it becomes awful. I'm a C++ programmer, and quite often I have to dig through dozens of headers to find out what this magic "auto" really means.
- icebraining 11y agoThat's because C++ combines type inference with a gnarly compilation process. In a language like Java, editors will support it and you'll just be able to "mouse over" (or press a key combo in Vim/Emacs) and it'll tell you the inferred type.