3 ms·
I think it's simply a flawed design to use reflection to read function parameter names and then use that information to apply semantics. I think parameter namin
by nawitus 12y ago
I think it's simply a flawed design to use reflection to read function parameter names and then use that information to apply semantics. I think parameter naming is something that shouldn't directly be semantic, as that's what most developers except. If, for example, I'm supplying a callback function to a library, I don't except the library to read the parameter names and then do stuff differently depending on the variable naming I happened to use.
I think your point about the minifier being "broken" is a good one, but the real problem is with AngularJS in my opinion.
- arnarbi 12y agoI agree, it's flawed design and a crutch that comes about due to the lack of a better type system. But the cited reason (that it doesn't work with a minifier) is bogus.
- general_failure 12y agoIsn't this exactly what Active Record in Rails does?
- bronson 12y agoNo, ActiveRecord never looks at argument names. (unless you're talking about Ruby's named parameters, which is nothing like Angular's DI and not AR-specific)
- general_failure 12y agoWhat I meant is db tables and field names get converted into ruby class names and properties/methods. This is basically convention over configuration. It's the same with angular.