Hacker News new | past | comments | ask | show | jobs | submit login

> I on my part (in spite using C myself) think that typing code is not that problem, but typing the right code.

What do you think of the auto keyword in C++? I've personally never found typing out the types to be a problem.

Hi, I must admit, that I am not totally up-to-date when it comes to C++, since I am not hopping on the newest standards as soon as they are there. And I am not actively programming in C++ currently.

But I don't think, that "auto" was specified to reduce typing. I see it more as a possibility to follow the "DRY" principle (don't repeat yourself).

There might be cases, where for example the return types of functions might change and you don't want to change every caller.

Templates are of course an other example, because the return types of templates oftentimes are depending of the input types. You of course can use those template declaration stuff, but it is very ugly and oftentimes clumsy.

I also found a nice example, where it really can help to make things more easy to read, here:


I think, the real usages are rare, that is also the reason, it was specified rather late.

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