by Chabsff · 3y ago · 0 comments
Ehh... not putting a return type in at all is a bridge to far IMO. Be friendly to the casual reader of the code, and help them understand what the function returns. (Yes I know IDE's can do this for you, but not everyone uses an IDE, and not everyone is reading the code in the context of an IDE... for instance code review, etc.)
Wrote this for myself, I’m a vim user :)
And you ignored any value that actually specifying the type can have.
You also ignored the age old wisdom that code is written once and read many times.