Spellify: How Not To Use Prototype

About two and a half weeks ago I wrote about jQuery being underutilized. That's nothing compared to Spellify, the absolutely perfect and horrendous example of how grossly unutilized Prototype is. Read on.

Mind you that this is a spellchecker we're talking about. Let's not pick on the Java-esque coding style. Let's not bash the 17 global variables that can be put in a scope. Let's only pick on library utilization, shall we? Couldn't be much underutilization, right? Or else why would Prototype 1.6 and script.aculo.us 1.8 be the minimum requirement for spellify?

Damn wrong I was. Spellify commits every possible offense you can ever imagine when you talk about any code that uses Prototype. It has its own XMLHttpRequest wrapper. It directly manipulates the style attribute. It has its own IE detection code. It has its own way of handling events. for loops are littered everywhere. It doesn't even use $().

How much does it use script.aculo.us? How much does it use Prototype? Out of 517 lines, only 2 lines call Effect.fade and Effect.appear. No other code calls any Prototype methods or objects whatsoever. Save for crappy for loops and code deletion, Spellify violates every Prototype principle you can ever imagine.

Maybe you can do this if this is your own site. Maybe the user wouldn't notice because they're not developers. Maybe it Just Works™. But when you're releasing this as a package for everyone to use, listing the latest version of Prototype and script.aculo.us as requirements and requiring anyone to include approximately 188 kilobytes of JavaScript just for a spellchecker, where 172 kilobytes of it are used for something like fancy fading effects, you're screwing your users and any newbies who want to start with Ajax. Ajax newbies who look at your code will think that it's perfectly fine to reinvent 99% of the wheel.

Sure, maybe it's 1.0. But that still doesn't justify it. Sure, I'm not getting anywhere near constructive criticism, but what's the use of being constructive when the only way you can make a building better is to tear it down and rebuild it? That's how bad Spellify is. This is Web 1.0 old skool JavaScript slapped on to a modern JavaScript framework. Maybe if I have so much time on my hands one day, I can rewrite it. It's open sourced and GPL'd anyway, so yes, ITFC still applies.

Spellify sucks. Simple as

Spellify sucks. Simple as that. The guy who made is known to me and his code blew. No wonder he was let go from where he used to work.