Hacker News new | past | comments | ask | show | jobs | submit login
JQuery is for Noobs (bobremeika.com)
40 points by rmurphey3 on March 3, 2011 | hide | past | favorite | 31 comments



Apparently, keeping your server running is for noobs.

Anyone have a cache?


jQuery is for n00bs

Posted on March 3, 2011, 10:23 am, by Bob Remeika, under Uncategorized.

So the CEO comes to you and is all like “I wanna build the next Facebook killer”, and your all like “Fuck ya! I’ve been waiting for this chance ever since I learned PHP!”. So forget the massive backend infrastructure and that you didn’t even know what graph theory was until they hired that PHD who kept talking about O-n-squared like it’s a bad thing. Your job is to build the front end.

So how do you do it?

Well John Resig and Doug Crockford are your Jesuses (or Jesusi? How do you pluralize Jesus… the guy is a fucking God), so you’re all like, “Well jQuery worked on awesomepetsbyphilandphillis.com… so $(function(){}) this bitch”. So you start coding like a bat out of hell. Before you know it, you’ve got a login form and a dialog box and shit is all peaches and cream. You are a God! All you had to do was grab a plugin here and there… you didn’t have to do shit! And then BLAM! BETA!!! Valleywag is now following your CEO on Twitter and Michael Arrington is pleading with you to enter the Techcrunch 50. You are going to be RICH!

So now you’re feeling pretty good about yourself and that PHD is thinking, why the fuck did I spend $150K on college when I could have just read “Javascript the Good Parts” and been the next internet hero? Not so fast sparky.

The Rails Developer

You’re a startup so you are inevitably going to be a Rails shop and you will hire a “Ruby Rockstar”. Don’t argue with me on this.

So like I was saying… you hire this “Rock Star” and then all of a sudden he’s dissin’ your shit. “What the fuck is this inline Javascript?” and your response is “Dude, I’m gonna clean it up, we’re a startup YAGNI… Agile… cough cough”. So you start cleaning up your Javascript and then you realize “Oh, there’s some common patterns here”. So you start making some classes, cause that’s what Doug said to do. Then you’re like, “Wait, Javascript doesn’t have classes” (or inheritance…. at least not the kind you read about in Learn Java in 21 days), but dude it’s cool. Class.js

So you add class.js into your growing number of dependencies and off you go again. You have classes now and life is starting to make sense, but your app continues to grow, and all of that shit that was starting to make sense is now falling apart. jQuery UI will get you an awesome fucking date picker but the CEO is talking about going international and adding some consistency to the user experience. You want to be everywhere… mobile, desktop, web and beyoooooooooooooooond! The CTO is annoyed about the lack of keyboard controls in the FriendPicker plugin you wrote, but that’ll take a week… and then another week. “She just doesn’t have the power, Captain” you say, but if you don’t get the fuck out of this Romulan tractor beam then you’re fucked. Wait… whaaaaa?

So now what?

Your job was to build a full fledged app, but there’s no way you could have seen this massive shitpile of shit coming down the ephemeral pike (is it pike or pipe? People disagree). Your solution is to build a widget rendering system, some core Javascript utilities, some abstactions upon abstractions (he said mobile didn’t he?). All of a sudden you have a directory tree that looks like this:

public/javascripts/app — Rails BRTCHES!

- application.js — Rails BRTCHES!

- prototype.js — Rails BRTCHES!

- core.js

- core.seriously.js

- util.js

- jquery.1.4.2.js

- underscore.js

- mobile.bitch\!.js

- plugins/

- lightbox-0.5.2.js

- thickbox.js — Cause lightbox didn’t do everything

- gallery-1.1.1.js

- rating-1.23.4.js

- carousel-1.23324234354354353453453453.23.js

… eight hundred or more non-interconnected files

- widgets/

- base.js

- FriendPicker.js

- NosePicker.js

… blah blah blah.. who cares.

What’s missing?

Aside from the fact that you now have dependency galore and that your rating plugin requires underscore 1.0.4, but your awesome gallery plugin requires underscore 0.6.0, you have no fucking tests. Every time you deploy to production your CEO finds out that NosePicker throws an error when he actually picks his nose and eats it, but not when he just picks and flicks.

Your godly status is now tarnished, that PHD is feeling pretty good about his $150K investment, and the Rock Star thinks you’re a douche.

You should have used Dojo you fucking n00b

I’m sorry if I hurt your n00b feelings but because jQuery is so ubiquitous now, I feel like this needs to be said. Remember what Rails did for Ruby? It made it you so you didn’t have to think about your directory tree layout and you didn’t have to nerd fight about what was business logic and what was display logic. You didn’t even know that tracking your database changes should go in source control, but Rails taught you that. You never thought about writing clean, readable, testable code because you were the only one touching it. Rails started doing this for you about 5 or 6 years ago and you didn’t fucking appreciate it. Maybe you didn’t learn it because you cringed at the thought of agreeing with a loudmouth Dutch asshole, or maybe you were just trying to get shit done. I don’t care. Rails brought a lot of design patterns and good coding practices into the webdev world and you should at least look at rails because it will make you a better programmer.

Dojo does this

Dojo does this for you too (and it’s been doing so since before Rails was a gleam in DHH’s eye), and honestly, go ahead and use jQuery. Dojo sucks at marketing whereas jQuery kicks total ass, but when you invent your brand new shitty jQuery plugin don’t post it on your blog like you invented something new. Dojo has a full-fledge i18n widget system complete with keyboard controls theming and a11y. It has a ton of core widgets that you need all of the time and it has a framework for creating custom widgets when you wanna do something crazy. Your whole UI lifecycle is taken care of for you and you don’t have to think about it or debate it with the new Javascript Guy. You don’t have to worry about dependencies because Dojo has everything you need to build that next great Facebook Killer.

But the Learning Curve for Dojo is too High

So is learning curve for building a stable performant RIA (is that term passe?). jQuery gives you an awesome API for querying the DOM (thanks John for “Thinking Different”) and providing cross platform consistency, but it does nothing for you when you want to build some bad ass computer shit or maybe just a thick client. You have to do that yourself. I’m not saying its impossible n00berson, I’m just saying it’s hard. Now I will give you the fact that the docs just “aren’t quite there” (hint: they never will be) or that when you download the source bundle it’s extremely terrifying at first glance. But I guarantee you that you won’t you won’t see the Dojo community oohing and ahhing over something simple.

Fine, Use jQuery, but You Will Need Dojo

I understand that 90% of people just want to add a single lightbox or add a drop-down menu to their navigation. I’m not saying that Dojo is for everything. jQuery and it’s plethora of plugins and community support will handle the simple shit for you. I’m talking to all of the n00bs out there that think they are going to get away with writing 5000 LOC and don’t realize that it will become a mess. You people… YOU! are the ones that need Dojo. You need guidance, because nobody has ever written the app that you’re writing. You’re unique, just like you kindergarten teacher told you. I’m just saying that maybe you can learn something from people that have built some crazy shit.

Before you reinvent the wheel… give Dojo a look… because Dojo already did that. TM

Full disclosure… I sat on this blog entry for months before I posted it.


You know you're at the right place on the web where you go to type in a joke, but that joke has already been left.


I think this post is neither trolling nor calling on people to blindly switch to Dojo. It is pointing out a thing I see over and over and over again: people choosing jQuery for tasks to which it is simply not suited. Yes, if you know what you're doing you can make it work -- Alex Sexton makes this argument quite well in his post "On 'Rolling Your Own' Large jQuery Apps" (http://alexsexton.com/?p=106).

This post asks developers who blindly choose jQuery, based on its popularity and an often-misguided sense of self-assuredness, a straightforward question:

"Tell me how, exactly, you plan to solve these problems you haven't even thought about yet? If you proceed blindly with jQuery, then by the time you think about them, you will be effed. So, maybe you ought to ponder, for a solitary moment, that there might be things you haven't thought about yet, and consider a toolkit that's thought about JavaScript app development questions for years, rather than a library whose competencies are still and painfully limited to DOM, Ajax, events and effects."

I applaud the people who answer this question competently with jQuery as a base. What I take issue with is the people who aren't willing to consider for a second that, for all its popularity and simplicity, jQuery might not be the right tool for every JavaScript job under the sun.


Summary for those in a hurry: "fuck this, fuck that shit, dojo has better i18n and a11y plugins, fuck jquery, The End" The tarantino writing style weakens his argument, IMHO. More scientific arguments and less passion please.



Rebecca, thank you for posting these. I'd categorize myself among the n00bs the OP refers to, and your reasoned articles were very beneficial. I hadn't considered Dojo in the past, but I'm planning a very client-heavy JavaScript application in the near future, and I'll definitely check it out.


I would look at MooTools, their approach to OO JS abstraction keeps your JS heavy web apps lean and mean!


If you're calling i18n and a11y "plugins", you're missing the point. These types of considerations are taken thoughout the framework in a consistent manner.


Ignoring the Zed Shaw tone, he makes an excellent point. Part of why I work on Faux is that jQuery isn't a framework. It's a library. I try to explain to people that Faux is to Backbone as Rails is to ActionController/ActionView and Active, and now that I think of it, Faux is to jQuery as Rails is to ActiveRecord.

Well maybe not exactly those comparisons, and it isn't nearly as good as Rails 3.x, but certainly that's the right scaling, and it would be a tremendous mistake to start a rich SPI application and think that jQuery is a framework, just as it would be a mistake to start a web application and think that ActiveRecord is a framework.


Strictly speaking, it sounds like Dojo is the one that's "for noobs". I mean, all the stuff that "happens" when you use jQuery are rookie mistakes:

  Including multiple libraries/plugins to do the same thing
  Not being ready to handle i18n/l10n
  Not having tests
Point being, if you know what you're doing, these aren't things that are going to blindside you or that you're just going to forget about.

We have apps that have well over the mentioned 5k LoC of JS that even our Ruby programmers have no problem cracking open and working on if needed.

(And for God's sake, just because they're Rails apps doesn't mean they have to depend on Prototype.)


>We have apps that have well over the mentioned 5k LoC of JS that even our Ruby programmers have no problem cracking open

Why the "even?" What is it about your ruby programmers which means you find it unusual that they can understand your 5k line JS app?

Not trying to be snarky or pedantic, I'm genuinely curious. I see the two languages as being relatively similar, with their common emphasis on closures and functions-as-objects. Obviously the object models are very different...


I work in a big shop. By and large our programmers don't venture outside their specialities (their choice). You could rephrase what I said as "even people who don't know anything about the code and have very limited experience with JS..."

I can see how what I said may have made the wrong impression. I don't think there's anything Ruby-specific that makes people good or bad at JS.


"So the CEO comes to you and is all like “I wanna build the next Facebook killer”, and your all like “Fuck ya! I’ve been waiting for this chance ever since I learned PHP!”."

Ha!

As for the content of the article...

Yes, if you know that you're going to be building some sort of rich Javascript app, then start with a richer framework. This doesn't mean that JQuery is for Noobs, it just means that it's for lighter weight uses. Different strokes for different folks.


Indeed. When I started a new job that required me to use MooTools, I went looking for the philosophical differences between it and jQuery (which I was familiar with). I found this wonderfully-written overview: http://jqueryvsmootools.com/ .


The link seems to be down; content is here in the meantime: http://j.mp/hdgrtL.


TL;DR: if you use jQuery and PHP, you are noob, everyone who disagrees is a noob. Rails ohhh yeah it's the best, fuck yeah. If you don't use Dojo, you are a fuckin' noob.

For some reason I can't take this post seriously, it's like a typical troll post, it claims a lot of things but doesn't even try to back them up properly.


Friendly reminder: this post does not appear on classic HN.[1][2]

[1]http://news.ycombinator.com/classic

[2]http://en.wikipedia.org/wiki/New_Coke


What are you trying to say and why do you call it a reminder? Are you reminding us to do something specific?


I think you know what I mean. If I'd just said the article was immature and silly and doesn't belong on HN because of its outrageous tone my feeling is that I'd be downvoted, as it's happened before, so I made my criticism more oblique.[1]

[1] http://en.wikipedia.org/wiki/Self-censorship


I didn't know what you meant. But that's by the by. A larger question has to do with HN changing as its userbase changes. Things change. Sometimes for the worse:

https://secure.wikimedia.org/wikipedia/en/wiki/Eternal_Septe... http://gilesbowkett.blogspot.com/2008/05/summon-monsters-ope...

And sometimes for the better. There was a time when the PC web was all about the newcomers, the barbarians beating at the gates of the establishment. The web was the same way. I can't rule out the possibility that if HN is flooded with newcomers, some of them might be vandals wrecking everything, but some of them might also be ushering in a new age, the new new thing.


What's classic mode?


I think it's where the only submissions displayed are those submitted by users who have karma above a certain threshold (or where their account was created a long time ago, i.e. not new account submissions).


It is actually submissions ranked by HN users whose accounts were created in the first year.


Great article and very funny.

I use JQuery for the simple stuff and Flex/AS3 for RIA. JQuery is pretty cool but I could see how all the plugins help paint you into a corner.

If I did heavy-duty JS development I have no idea what I'd use. I'd probably just spend wy time bitching about no Flex/AS3.


Dojo sucks at marketing whereas jQuery kicks total ass

Evidently.


Before reading the post, i was thinking "dude, this is a troll post."

after the first 5 paragraphs i was thinking, "dude, he has got a point. i think TL;DR is : 'tools doesn't make you a good programmer use whatever you want."

but after the "dojo" section, now, i'm thinking "this blog post is for trolling."

there is no god damn one tool to make you a good programmer. not a web framework, not a ide or anything. the tools are nothing to do with your skills.

you have to learn programming without program anything at the early stages. learn programming fundamentals, algorithms, design patterns, best practises and so on.

i'm not giving a shit about which tool you use. if you are using MongoDB because "it's new and everybody talks about it" i will kill you. use a tool only if it does the job.


jQuery is for websites, while Dojo or Prototype is for applications. The architecture of the library/frameworks are extremely different, and if you can write jQuery then it isn't too difficult to switch to another library or framework. It's all javascript. I don't see why people like using tools for unintended use cases. This is like using Rails to build a 3 page static site. Wrong tool for the job.



Sigh. It would seem that Hacker News now rivals Daring Fireball and others in its ability to take a site down with a single link.


I, for one, consider that a positive.

Now, we have added HN to the list of communities which can slashdot a site.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: