Know the Language, Now what?

Last week, I posted on knowing the language, in the context of it being a personal struggle. Since posting, I have had several conversations about the subject as well as receiving the first comments in quite some time.

I want to expand on my personal struggle of knowing the language. My focus continues to be jQuery, which is technically an API, but it has an explicit style and feels more like a language than an API.

I have been trolling the jQuery bug tracker for the past several days. It’s my personal goal to contribute to the jQuery core by the end of this year, which is ambitious to say the least. To me, the best method seems like reading bugs and trying to understand what’s going wrong inside the library. I am becoming intimately familiar with both jQuery and the Firebug debugger and profiler.

I have learned some amazing things already. One that I find most fascinating is that simple confusion on the API can lead to reporting mistakes as bugs. I don’t want to pick on anyone, but one of the first bugs I investigated was an issue with jQuery.ajax();. I setup a local test and started digging into the issue of why the error event was never being called for a 404 URL.

I spent almost an hour digging into the guts of the XML HTTP Request Object, only to realize that the bug was due to human error. I learned a very valuable lesson. Start at the beginning. Don’t assume anything. The bug has since been closed based on my recommendation. That probably seems mundane, but for me it’s very exciting to be contributing to something that I use every day.

Most importantly, investigating bugs is giving me a reason to dig deep into the inner workings of the jQuery library. When using the debugger, I can follow the exact path the code follows, which is sometimes very surprising. While investigating an issue with document.write and jQuery().wrapInner, I actually spent an hour and a half stepping through the code one time. It gave me a solid appreciation of the sheer number of convenience methods jQuery contains.

If you really want to advance your personal struggle of knowing the language, the first step is spending time working with it. Reading someone’s code is an amazing way to discover patterns and techniques. Trying to patch bugs, elegantly, is a crash course in a language. If you really want to know the language, you have to take a step beyond your comfort zone and don’t be afraid to fail.

  • juliomiy
    simple and excellent post - we should distribute this for all the FED to see. I can do that if the author gives me the rights to do so.
    Stepping through code as you describe is the true peeling of the onion that gives you the extra insight that is rarely found in a reference about the language or library in this case.
blog comments powered by Disqus