Hacker News new | ask | show | jobs
by pasas 3849 days ago
+1 on this - it's really annoying when overused.

It's great when writing code, but really annoying when trying to understand code written by someone else using it and then having to bounce round code to work out what a function's actually returning.

Well named TypeDefs are much better IMO.

2 comments

Don't you have to bounce around code to figure out what the TypeDef refers to anyway? Instead of using a well named TypeDef, wouldn't you get the same effect with a well named variable?
Sometimes, but PassengerVec at least gives you a lot more indication (including whether it's a pointer or reference as they have to be declared along with it) than:

auto passengers = getPassengers();

Woah, that line immediately reminds me of JavaScript at work, and one of the reasons why I don't like it.
+1 on the typedefs