I can't believe all that code for jQuery was done by hand.
Edit. Just to be cleaeer
Script # has a set of libraries that wrap jquery. This allows me to call jquery functions in natural c# way. But they are large long winded. But they also look neat and consistent. Looks like a tool generated them. But there is no tool in the scripts arp package. Hence the q
Unfortunately there is no magic tool... and I did hand-write the jQuery code.
If you look at it you'll see one really has to look at all the "quirks" ... ummm ... features accomplished by varying parameter sequences/counts etc. to get different behaviors, as well as the possible different return values etc. All of this information is simply not there in the script to be able to create a nice wrapper.
Furthermore there are places where you have to think about what a natural/useful c# experience will be ... for example, use of enums to represent string literals, numeric literals. How to represent different behaviors as overloads or differently named c# APIs that translate to same call at runtime. Same goes for where some generics would be useful.
Its not rocket science, but requires a bit of work. It also depends on the size of the API you're trying to wrap. jQuery core is a fairly large surface area, compared to other jQuery plugins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With