On Jul 2, 5:38 pm, "David Marrs" <[email protected]> wrote: > On 2 Jul 2011 01:13, Jason Mulligan <[email protected]> wrote: > > > yes i am. extjs/jquery are fantastic examples of this paradigm gone > > > > wrong. the syntax ends up on multiple lines as you try to figure out
I think the issue is that general purpose libraries that try to be all things to all people so they try to allow for every possible case. In a well designed application an AJAX call may only require two or three parameters so you might take a basic AJAX function and wrap it in something that deals with the parameters. Different programs might need different things so a different wrapper is used in each one. A general purpose library needs that wrapper to take every possible combination of parameters so the same wrapper is used every time with a different set of parameters. > > > > what's what, and no IDE can accurately parse the docblock/expression/ > > > > literal to say Param1 is ..., Param2 is ... > > What do you mean, try to figure out? The property names tell you what's what. > Having the params spread across multiple lines make it easier to read imo. > I don't see why an IDE wouldn't be able to tell you what properties an > argument object takes, if you're into that kind of thing. Perhaps because there aren't any decent[1] javascript IDEs? The language seems to be a bit dynamic for most IDEs, perhaps they can cope with certain code patterns but trying to decypher all possible patterns in one program is likely beyond the limit of practicality. > Certainly I don't think an IDE's limitations are a good reason to stop using > a language feature. Choosing to use objects with defined property names instead of formal parameters isn't a language feature, it's a design decision. That IDEs don't support it likely means it is too difficult to do easily (incidentally, I don't use a javascript IDE, so maybe there are some out there that can handle it and I just don't know about them). 1. The term "decent" is purely subjective of course. I haven't found one I like enough to use, hence there aren't any decent ones for me. -- Rob -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
