Hacker News new | ask | show | jobs
by lerno 2871 days ago
Interestingly generics seem to drive the addition of type inference in order to avoid having to write too complex types, losing the self documenting nature of the static type, but still not avoiding the problem entirely.

Consider the types of some template generated pointers, or just something like std::unique_ptr<std::vector<std::shared_ptr<Foo>>> (which isn’t a very far-fetched example).

This is ”the generics problem”, where it actually starts having an obscuring effect.

ObjC is immune to the problem since it lacks any need to do do the specialization. Unlike Java where you needed a lot of manually inserted casts without generics, ObjC doesn’t need them at all.

Like you say, dot notation, ARC, stricter resolution of dynamic messages etc were weakening the strong points of the language and would push the programmer towards a Java-like object model - which is very far away from how the language ideally should be used.