Closure Tools — Google Developers

I’m thinking about in which tech areas I want to develop myself (“להתפתח”, for which I have not found a suitable English translation) and JavaScript (with a capitalized “S”, as any decent spellchecker shall correct you) seems to the first on the list. It’s on the server, it’s in the browser, developing in it has super-fast iterations and feedback, etc. Hopefully I’ll expand on this dilemma in another post, but for now the main issue was a heap data structure.

For various reasons I’ve found myself with some spare time on my hands and decided it would be a good time to read up on and practice my data structures. My last job (JS SWE @ NDS [♥ acronyms]) sadly included little practice with advanced data structures, so I was kind of out of practice. Thinking in a testable mindset (which is something I should do while coding, btw) I decided to practice it in Java. Sadly, both my own Java skills and the language itself make that an annoying experience with frustrating debuggers, slow response, and lots of boilerplate oh no that’s not the proper way to instantiate a non-Generic abstract type — curmudgeons, we’re not here to practice syntax, we’re here to practice theory! This is why I fell in love with JS in the first place. It took me a while to break a surprising mental barrier and decide to just get on with it and implement it in JS anyway. It would be faster, funner development iteration doing it, and I might as well just focus on JS anyway, seeing as I would probably not be looking for Java work anytime soon. 

Happily, I had the rare presence of mind to check has anybody done this before me? (The answer to which, surprisingly or not, seems to almost always be a resounding ‘yes’, and this fact is not stressed enough with young programmers) Reading through a couple GitHub implementations, I stumbled across the how-have-I-not-heard-of-this-yet Google Closure Tools library. It is a “broad, well-tested, modular, and cross-browser JavaScript library”, made by the folks at Google, and familiar to you if you’ve ever used Gmail, Google Docs, etc. Standard very high-level implementations of the various JS widgets you’re all-too-familiar with. A dizzying array (snicker) of them, in fact. And top of all of that, a JS data-structures library with complete (read: documented, tests-included) implementations of your favorite CS 101 friends, re: our friend the heap priority queue.

I was/am amazed at the folks at Google continuously raising the bar. I do need to point out this project seems on the lower end of Google’s what-we-care-about ladder; the documentation contains some typos and the demos (or perhaps the library itself!) contained some easy-to-spot bugs. Well, this less-than-complete-perfection is only noteworthy by Google’s standards anyway, I guess.

I was also happy/impressed to see JS getting some full-fledged 3rd-party support for major operations. A decent 3rd-party implementation for data structures and major operable classes (including UI widgets, as JS is heavily used in View context) was to be expected, and I’m surprised I haven’t heard of it before. (Wikipedia says Closure is around since 2009, which isn’t that long ago, but isn’t exactly yesterday either). Perhaps I’m the only one new to the game, and these are my standard first steps in entering the web development world.

Check it out yourself (link below). JavaScript is so non-verbose that reading the docs on the data structures (and making sure you understand what’s going on) is not a bad way to just practice the CS theory itself.

Via: Closure Tools — Google Developers.