Archive for September, 2008

Localizations for the Clientside code

September 24th, 2008 by Aaron N.

Thanks to the help of several users of our code base we now have translations for our FormValidator class for Chinese, Italian, French, Portuguese, Spanish, Dutch, and Catalan (!!). This is awesome stuff. While I personally haven’t worked on any projects that have been localized, it’s nice to see our code base gain greater flexibility and usability thanks to our users.

Today someone asked me to make it possible to localize the Date method timeAgoInWords, which returns things like “about a minute ago” (you can find this in Date.Extras). So we’ve added support for this too (though we don’t have any localizations for it). If you decide that you want to translate either of these things, drop us a line.

Anyone read the book yet?

September 18th, 2008 by Aaron N.

Ok. I’m dying to know. Who has read the MooTools book (or at least flipped through it)? I need some feedback here!

P.S. Anyone who writes a review on Amazon (positive or negative so long as it’s honest) gets top priority for the next change request they send in (sorry, that’s the best bribe I could come up with).

Stack Overflow (Q&A for coders) launches. Tres awesome.

September 15th, 2008 by Aaron N.

Joel (of joelonsoftware.com) writes of one of his latest endeavors: Stack Overflow, a Q&A style site for developers and, I must say, I’m excited about it. I want to go answer a bunch of questions right now! …except that they already seem to be answered (at least on the topics that I could answer…).

He writes in an announcement today:

You know what drives me crazy? Programmer Q&A websites. You know what I’m talking about. You type a very specific programming question into Google and you get back:

  • A bunch of links to discussion forums where very unknowledgeable people are struggling with the same problem and getting nowhere,
  • A link to a Q&A site that purports to have the answer, but when you get there, the answer is all encrypted, and you’re being asked to sign up for a paid subscription plan,
  • An old Usenet post with the exact right answer—for Windows 3.1—but it just doesn’t work anymore,
  • And something in Japanese.

If you’re very lucky, on the fourth page of the search results, if you have the patience, you find a seven-page discussion with hundreds of replies, of which 25% are spam advertisements posted by bots trying to get googlejuice for timeshares in St. Maarten, yet some of the replies are actually useful, and someone whose name is “Anon Y. Moose” has posted a decent answer, grammatically incorrect though it may be, and which contains a devastating security bug, but this little gem is buried amongst a lot of dreck.

Well, technology has gotten better since those discussion forums were set up. I thought that the programming community could do better by combining the idea of a Q&A site with voting and editing.

Would it work? I had no idea.

Every question in Stack Overflow is like the Wikipedia article for some extremely narrow, specific programming question. How do I enlarge a fizzbar without overwriting the user’s snibbit? This question should only appear once in the site. Duplicates should be cleaned up quickly and redirected to the original question.

Some people propose answers. Others vote on those answers. If you see the right answer, vote it up. If an answer is obviously wrong (or inferior in some way), you vote it down. Very quickly, the best answers bubble to the top. The person who asked the question in the first place also has the ability to designate one answer as the “accepted” answer, but this isn’t required. The accepted answer floats above all the other answers.

Browsing over on the site (stackoverflow.com) there are a bazillion questions on all topics imaginable (well, actually, now that I look, there aren’t any MooTools questions yet). Looking at the questions posted about JavaScript in particular, they range from stuff that people really should know if they are writing ANY javascript to stuff that would take too long to really answer well to that’s some esoteric stuff that I know the answer to and could be helpful if all these other smarty-pants hadn’t already answered it.

It all boils down to this though: it works, and it’s awesome. One place to tap into knowledge about any development platform out there and get the most relevant answer to your question. Seriously, go check it out, post haste!

Bandwidth and CPU issues here at Clientside

September 11th, 2008 by Aaron N.

Just a quick note. Over the last two days this site has been down off and on due to CPU/Bandwidth over-usage. We host this blog on a 3rd party server because, for the most part, it’s just easier. CNET has it’s own blog platform that’s built to handle a ton of traffic, but wasn’t the easiest place to be able to hack together quick code examples and demos. Given that all we needed was a wordpress install and some customized wiki software (for the tutorials), it just didn’t make sense to try and make it work on our enterprise servers.

We discovered today what we think the culprit was – some deep links to some of our images that were sapping our resources – and have that sorted out. Hopefully we won’t encounter any more outages. Thanks for your patience.

Thoughts on coding and new classes as a result…

September 4th, 2008 by Aaron N.

A short while back I was helping out a coworker who was working on a content management system with a very rich UI. In helping him work out some of the issues he was struggling with, I had one of those rare moments where I conceived of a better way to write my own code.

Some of his struggles were performance related – he had a LOT going on, but those were really an extension of the fact that his code was kind of all over the place. What started as an interface with some nice enhancements had grown into a behemoth of functions, namespaces, dom references and conventions that he couldn’t hope to keep straight anymore.

Part of what I suggested to him was that he start treating items on the page as widgets. Every portion of the interface could be broken up into little bits of functionality with a corresponding (MooTools) class and then larger items would be comprised of these smaller things. The larger items would have their own classes as well. These would act like controllers for the smaller ones.

Over the next few weeks he refactored his code and when I saw him it was aparent that he was much happier. Relieved even. The result is a structured family of functionalities that each correspond to little chunks of his UI. He can combine these in various ways for different use cases and work flows. He can extend the classes when he needs something that’s slightly different.

His sense of relief was so apparent that I began rethinking my own approach to my code. Read the rest of this entry »