Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've never liked this language feature very much. I'm the one that's doing the inference when I read the code.


I 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.


That'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.


A good point, I didn't consider IDE support.


Good C++ IDEs do the same.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: