4 ms·
This might sound negative, but I'm really curious why this is needed if you have an IDE that tells your the parameter names as you're typing and in a mouseover.
by assignedM 12y ago
This might sound negative, but I'm really curious why this is needed if you have an IDE that tells your the parameter names as you're typing and in a mouseover. If you need it to be more visible, make that a feature in the IDE to show you the parameter names all the time. Why change the language?
Not only that, but why are you passing so many parameters like top, bottom, left, right? At least put them in a struct if you can't make them fields of the object itself.
This feature seems like "too little, too late". Maybe 30 years about it would have been helpful.
- wtallis 12y agoNamed parameters on their own are not all that helpful. (see Obj-C, where the verbosity often outweighs the potential benefits.) But when accompanied with having default parameter values allowing named parameters to be optional (as in Python), they can be very useful, allowing a whole family of functions to be consolidated into one fully general function that can nevertheless be called succinctly in a variety of ways.
- jws 12y agoOptional named parameters with default values can make nice clean calls in the common case while still allowing for the uncommon case. As far as the IDE goes, for the sort of code I write, reading is more important than writing. When I read the code I'd rather see what it does than what I think it does.
- assignedM 12y agoVB used to allow you to omit optional parameters by just leaving it blank foo(36,,,54) sure it won't do if there are dozens but for the odd ugly case where you naughtily use optional parameters it's OK. It sounds like there's a need for IDEs to show the parameter names all the time. They could just be inserted automatically into the display if you want to see them, or turn them off if you don't like that. Better than being always on like this proposal.