Reinventing the wheel

I’m kinda sorry I created this thread. But whatever.

[quote=mitică]
That’s assuming libraries are targeted to n00bs, since they can’t actually learn the language. Which is pretty much not true. If a library makes it easy for n00bs, it doesn’t mean the library is for n00bs and n00bs only. Or that any n00b could easily pick the library up and hit the ground running.[/quote]
Whether or not it’s written for and targeted at n00bs has little to do with it… I know plenty of people in the same boat as Sega, who (fairly easily and quickly) learn jQuery but don’t know the basics of (vanilla) Javascript. Either because they haven’t had the time to learn it while getting things done on the job, or because they don’t see why they should bother (again, other than the learning is fun generality). This was the story of at least 80% of a Javascript class/meeting I had a while back (we were asked what our JS experience was before beginning).

Well, besides “just because/learning is fun”, this might be one example: http://www.sitepoint.com/forums/showthread.php?808876 (specifically, oddz’ post)
and stuff like this: http://www.doxdesk.com/updates/2009.html#u20091116-jquery …referring specifically to this sort of example:

Almost always, the ‘best’ way of finding out whether a checkbox is ticked is given with a straight face as:

$(input).is(':checked') 

— as obviously input.checked just doesn’t do enough selector-parsing busywork to be really modern.

On the one hand, this is an exaggeration. On the other hand, you do see code like this, and lots of it. After all, it does work, and you’re not going to notice (as a developer or as a casual user) any actual performance issues with it. It’s slower, but in a “people who do jsperf testing” kind of way.

And another note since some people seem to have missed it: Lea builds these very kinds of tools herself and uses them all the time. So claims that she’s too busy being full of herself and trying to be a douchebaggy brogrammer yo are silly and mean. Also claims that because her personal blog is using WordPress, she can’t possibly be allowed to care about performance for work she does for a client or on a project… not only is ad hominem but also another special form of… being very special. I am disappoint. ಠ_ಠ

And am I the only person who’s noticed that the number of Javascript libraries available are now more than I can count on two hands in the last few years? I’m not? Hasn’t it, like, tripled lately?? And the number of new CMSes… good lord. Then you must wonder, where are all the new libraries coming from? Oh, they’re coming from people reinventing the wheel as Kohoutek said. Yet this is somehow a bad thing, yet you’ll all jump on the latest library saying how awesome it is. This makes zero sense. People looking around existing tools to fix their own solutions created these tools, therefore this must be a good thing. You can’t go on about “people shouldn’t be wasting their time writing solutions to their particular problems instead of using what’s already out there” and at the same time rave about how awesome the libraries/tools coming from these very same people are. That’s such a sleazy double-standard. W. T. F.

If people didn’t reinvent wheels, y’all wouldn’t have your precious precious jQuery; you’d have Prototype.js and Dojo. If people didn’t reinvent wheels, you wouldn’t have your precious precious Prototype.js and Dojo; you’d have vanilla Javascript. You wouldn’t have your precious precious SASS or LESS or any of the 500 grid systems floating around out there. You’d have vanilla CSS. You wouldn’t have CoffeeScript. You’d have native language syntax.

Kohoutek already stated the above but she apparently wasn’t snarky enough to get people’s attention so it was time for me to step in and repeat it with some surly attitude and a bit of hate.

Ja, oui, genau, it’s what I’ve tried to imply in post #19 way back on page 1:

But, so far, nobody seems to want to see or acknowledge the contradiction of arguments made in this thread. How you can invalidate Lea’s thought process (work) and yet argue pro jQuery and its kin makes zero sense to me. The underlying principles are identical.

The people who re-invent the wheel do so in making money or gaining publicity. They do it because they feel people could benefit from their hard work, and in many cases people do benefit from it. I don’t see the issue of using somebody else’s creation.

I wrote something a while back and compared web design to carpenters. In the early days carpenters used to make everything by hand, from kitchens to doors. Now they find ready made products and piece them together so that the customer can afford those cheap products. A hand made solid wood kitchen here costs roughly 7K upwards and those were the days when ready made kitchens were not common. Now with ready-made kitchens from places like IKEA people opt out of a tailor-made solutions and prefer the cheap and cheerful stuff as they are more than half the price.

You can’t compare quality, tailor made wins every time, but money happens to talk and customers want cheap. As a result of this, people will loose the knowledge of making those hand crafted good and the ones who retain it would charge and arm and a leg. Do you see where this is going? Can you see the comparison with web design?

People are using templates, people are managing and creating websites without knowing all the ins and outs. Do you see where the future is going? Unfortunately it’s not who knows most who wins, but who manages to create an affordable product for people, and if that means using things like templates, jQuery and MooTools, well this is what’s going to be a winner in the end.

A famous Greek saying goes like this:

You can hang your art or expertise for everybody to see and admire

… but in the end, we can’t live on admiration.

[ot]

To state the obvious jQuery IS Javascript, so if you find jQuery useful then Javascript itself is useful.
I’m surprised that no employer demanded it - with HTML5, node, client-side templating, gaming platforms, backbone, coffeescript all gaining steady momentum. I’d say Javascript is absolutely essential for any web developer.[/ot]

I appreciate very much the reinvention of the wheel. As long as it’s a better wheel, and you actually get to go forward and build something worthy with it, if not a car, at least a stupid little cart.

So, I have nothing against those that help me build cars. My only problem is with those like Lea Verou that just discovered to principle of circle. And her problem with the wheel is that she thinks that looping ad infinitum in a circle means advancement. It takes more than that. You actually have to choose a road and put that wheel on that road.

Examplification

Let’s say you build a web site.

You build the CSS style for it. It’s only logic you’re gonna have a few different sections in it: a reset or a normalize, the base style, different media queries, a few specifics.

Following Lea Verou’s lead from the article, you’d split and serve that CSS in a few files. Experience says this is not true, right? You’re gaining more by actually serving it all in one file.

Now, using a thing like SCSS means you actually get to eat the cake too. For one thing, you can keep your CSS in separate files at developing time (a huge step forward for cross project reusability), and get a single CSS file for production, with a single click.

As a side note, that’s why I like where Light Table is going.

Doing less, getting more, remaining organized. Well, that’s more like it.

What Lea Verou refers to as reinvention of the wheel is a completely different thing: writing less to get less, and regression, no use of any tools. She’s not even considering a stupid little cart, she’s just throwing a little fit against all libraries, against open source even, because she’s too lazy to actually think one simple thing the whole way through.

I’m not sorry if it feels a little harsh, but I am sorry some took it personally.

<hr>

Finally, you want to see how much the wrong reinvention of the wheel costs us? Take a look at UAs and their war. Take a look at W3C and WHATWG and their war. I don’t see more good than bad coming out of it. That’s why I’m against reinventing the wheel just for the sake of it. A new wheel is a better wheel? Not always. That’s Lea Verou omits to tell us.

I guess I took that article from a whole other perspective - I took it as her saying that you should really look at what you’re actually doing and see if you need these gargantuan js libraries and see if you can’t find/create a solution which is lighter and does just what you need it to do.

And I’m sorry, but jQuery is a beast if you don’t get one of the stripped down versions - which most people don’t. Or they’ll do a quick google search for a piece of functionality and use that rather than looking at what they already to see if they can leverage that. So you end up with jQuery AND mooTools AND …

A good example is a project I’m working on now - our client built a prototype design with a horizontal menu which had a horizontal sub-menu. They built their menu using jQuery (and not the version already being used within the framework we’re building their site with), and it was completely unecessary - I was able to recreate it using straight CSS which was cross browser and clean, and the extra bloat from the unneeded scripting (and extra css class cruft) was gone. It took them weeks to realize the menu wasn’t the same, and weren’t happy when they realized I changed it, but in the end we have less work because I didn’t have to revamp it everytime they changes a menu item.

I don’t know how the menu was built, so I can’t comment on that, but I’m not sure yours is an example to inspire, Dave. :slight_smile:

You’re saying you’ve gone against the client’s plans, and without him knowing you decided on your own what’s best. This shows failure to comply and integrate from your part, with disregard but for your own concerns.

I’m sure that if you’ve managed to make a good case that yours is better, things would’ve been better both for you and for your client.

<hr>

About jQuery being a beast. This issue has been discussed over and over. jQuery has a powerful CDN. jQuery actually goes out of its way to help developers and users too. So developers alone are to make that or break that. Like it is the case with the wheel reinvention.

[ot][quote=mitică]You’re saying you’ve gone against the client’s plans, and without him knowing you decided on your own what’s best. This shows failure to comply and integrate from your part, with disregard but for your own concerns.[/quote]
Companies don’t like it when you sneak accessibility into their sites too. Doesn’t keep me up at night. :slight_smile: I suppose Dave could have just overcharged them to do the unnecessary extra work of constantly reworking their broken bloated menu when they upgraded every time, but that seems less fair (to the client).

Then again, you’d think the client-developer relationship wouldn’t be so poor that they had to discover their changed menu on their own, and then wonder “what other things has he pulled out from under us that we don’t know about?”[/ot]

Nothing that arrogant or self-serving, I assure you. In this case, the prototype they had built did not fit into layout in the pdf design mockup they had provided. Not even close - over 25% too wide. The revamp was done to allow it to fit into the design mockup they had provided as it was just less work since the prototype version provided included different hard coded lengths for each top level menu item, which didn’t allow for any type of menu changes or expansions.

Again, nothing so devious. It was done early on in the templating process as I was converting the pdf over to html. I was working top-down and the menu was the 3rd or 4th thing done, so by the time I was done, I had forgotten all about it. I was just thankful I did it when they changed the menu items since the widths weren’t hard coded anymore and it was just a matter of changing the text and not having to change the widths of each and every menu item.

“Don’t reinvent the wheel” is a rule of thumb. It applies to most people in most situations, who almost always end up doing extra work just to create an inferior wheel.

Well, then allow me to graciously apologize.

+1

Agreed.