by crazygringo · 6y ago · 0 comments
They're absolutely critical to writing code that is easy to read. The name of a function tells you what it does, arguments equally need names to tell you what they do.
Even if I have a great IDE, I don't want to hover/cursor over the line to see what each argument does, each random "0" or "null" or "1" or whatever. There are also plenty of times I'm viewing code that isn't in an IDE, like a diff.
Obviously they're not always needed, like in functions that take only one or two required obvious parameters.
But otherwise, they can make the intent of a line of code obvious at a glance, and are a huge step toward making code self-documenting.
I just can't believe this is a change that's only picking up now, rather than 20 years ago.