How boring is javascript?

Discuss general web development questions. Help others and get help from others.

Moderator: kfury77

AJAX!!!!!

Postby muz1 » Mon Apr 14, 2008 2:40 am

Hey.
Javascript is an amazing tool. To see some really awesome uses, look no further than AJAX. The fuel behind Web 2.0.

Using the HTTPObjects, the ability to send and receive information handled by Object Orientated Javascript has re-defined web development for me.

Check out: http://script.aculo.us/ for an example of easy libraries that are open source and allow yo uto do some amazing things in your pages. Oh and it is almost totally in Javascript.

Prepare for blastoff.

Muz
We have one chance to be the best we can be, to share what we have and to give what we can. What comes after that is up to you.
muz1
 
Posts: 8
Joined: Sun Mar 05, 2006 5:38 am
Location: Melbourne, Australia

Postby syrupcore » Thu Apr 17, 2008 12:20 am

MaxD wrote:Any opinions on using jquery to do the work of javscripts? Also Multifarious described jquery as a 'framework'. Anyone be so kind as to clarify what he means. Is jquery not a language in its own right :?:


jQuery makes writing JS fun. jQuery isn't a language, it's a javascript framework. Frameworks are basically a collection of javascript functions that make writing javascript easier and/or more productive. In the case of jQuery, fun. :)

Instead of writing a bunch of crap to get some ajax functions to work (and work cross browser), jquery does all of that stuff "behind the curtain" for you. Instead, it offers you some simple syntax to get a bunch of things done. What's nice is that if you know JS, you can simple intersperse your JS with some jQuery to make things faster/easier.

There are a lot of tutorials out there on jQuery. Totally worth the evening you'll spend learning the basics. The example on the jquery homepage (the show/hide) is so elegant, I don't know how anyone could resist it.
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Postby multifarious » Thu Apr 24, 2008 9:40 am

just some personal notes on using frameworks/libraries (like jQuery, mootools, dojo, jsExt, YUI etc)

weight vs speed
Keep in mind that some of the frameworks are quite large in (file)size. It might not allways be in your best inrterest to use a framework if all that it does is collect some elements for you to iterate over. Yes they do make it easyer (what with all the xPath support) but this comes at a price, the price of sending plenty redundant code to the browser.. Rule of thumb for me has allways been that if I'm using less then 30% of any given framework I should look into rolling my own more specific library.

learning JavaScript (or [DOM]scripting in general)
Knowing a framework by heart doesn't make you a webdeveloper. Knowing JavaScript and THEN using a framework makes you a kick-ass developer.
Why? because, IMHO, not knowing the basic language (and it's quirks ) on which a framework is build prevents you from REALLY understanding and appreciating WHY a certain element is used and HOW to leverage that to it's fullest potential.
If you don't know the intricate differences between a javascript array or object how then can you make a real educated assumption which iteration method you're going to use?
If you don't know how scope behaves in a JSON object vs a regular object (ie: oJson ={} vs oBasic = function() {}) you can brace yourself for a whole world of hurt in most frameworks..

And lastly...
I honestly think that the majority of the projects which I've worked on where I was forced to use a framework (by client's or tech-leads choice) this had more to do with the current hype then a well considered design-choice.
Specifically if you're well versed in DOM-scripting (and well aware of browser quirks) chances are most frameworks are too bloated for what you're trying to achieve but still don't really deliver on where you actually need help. For instance, try and merge multiple arrays containing dom elements without the resuilting array having duplicates. The ones out there providing for this are pretty inefficient about it, which annoys me to no end.


And i'm not saying you sshould steer clear from them, not at all, but before you go out and proclaim any of them to be the best thing since sliced bread be sure to check in to at least two others. And the base language itself ofcourse.

here's some linkage that might be of interest:
http://mootools.net/slickspeed/
http://blog.creonfx.com/javascript/dojo ... comparison
http://drupal.org/node/69786
http://bearfruit.org/blog/2008/02/08/jq ... year-later
http://blogs.pathf.com/agileajax/2007/0 ... proto.html
http://ask.metafilter.com/76454/jQuery-vs-Scriptaculous

as y'all see in the last links above, 'best of show' is debatable to say the least. Hence my suggestion to have a look at at least three (preferrably all of them) so you know which to use for which project ;)

Having said all that:
Totally worth the evening you'll spend learning the basics. The example on the jquery homepage (the show/hide) is so elegant, I don't know how anyone could resist it.

I SO agree with syrupcore on this one ;)
Patrick Kanne - webmaniac
- as we fail to imagine, we are punished with reality
multifarious
 
Posts: 32
Joined: Tue Feb 05, 2008 4:40 pm
Location: Amsterdam

Previous

Return to Web Developer Talk

Who is online

Users browsing this forum: No registered users and 1 guest

cron