Get it now from
Corey Hart has a fun post on jQuery micro optimization tips by walking through the jQuery codebase to see what is running.
Right away he notes that these are true micro optimizations, and to “use with caution and balance elegance with performance correctly.” Chances are you are a lucky chap if these are the biggest issues for performance on your application!
The post is still interesting as it shows a lot of jQuery core itself. I would think that Mr. “inline it” Dalton would approve of some of these tips 🙂
- jQuery.root: Internally, all selectors that don’t provide a context use jQuery( document ).find( selector ). Save yourself some ms, store the document root onto jQuery itself, and then run all global selectors off of that element.
- Context sucks, use find: Don’t get me wrong, you should always run selections based on a context if possible. But passing in a context to the jQuery constructor creates an extra unneeded function call. Internally jQuery runs context.find( selector ) anyway, so skip that step
- Live is terrible, delegate is awesome: The best part: delegate is live with a context. So why is live a bad idea? To use live, you first have to run a selection on the page, and then bind the live handler.
- jQuery.data > jQuery.fn.data: avoid jQuery(this)
- Bind and Trigger, get used to it: don’t use the short cut methods, save a function call
- Each is evil: there is only one true reason to use each, and that is when a closure is needed for each item. If you are just looping through an array, then the callback function gets triggered on every iteration. So using an array of 25 items, the callback gets triggered 25 times.
- Classes over styles: I would go so far as to say that using a class for a single style change is better than running through jQuery’s style module.
- Object.length, use it: Every jQuery selection comes with a length property that defines how many elements were found. Always check to make sure that there is a set of elements in your object before running a chain of methods.
I try to be a good netizen. Really I do. I know it’s not nice to trash a fellow blogger. However, a recent article by a well-meaning individual, [Update: name and link removed], is driving me crazy! I can’t just let this article go unchallenged.
The title of his article is 10 “Nice-To-Have” Skills for Front-End Developers. He starts out with this:
…since front-end coders are a dime-a-dozen these days, it pays to have experience, or, at least, rudimentary knowledge, in a number of other technologies that often don’t get listed under “mandatory” skills for a front-end position.
He then goes on to name 10 “Nice-To-Have” skills that, in my opinion, are way off base. Each of them is either a “must have” skill or a “dime-a-dozen” skill! One of the commenters hit the proverbial nail on the head:
If you don’t have these [skills], you’re not a “developer”, you’re a rank amateur.
I couldn’t agree more with the commenter. Maybe it’s because he used the term “developer”? If he wrote “UI designer”, I might not disagree. However, he uses both “front-end developer” and “front-end coder”, which to me are only a shade of gray from “front-end engineer” (the most seriously dedicated of the three).
So, anyway, if you’re a front-end engineer/developer/coder and if you’re sincerely interested in elevating your career, salary, and job satisfaction, you’ll heed my advice, not that other blogger’s. Below, I’ve listed each of his points. I’ll explain why he’s dead wrong and which must have skills you should be focusing on instead:more on unscriptable.com
He he this is soo true!
var i=0, j=1. Declaring multiple variables using one var-statement accross multiple lines is a NO GO! I consider this evil. And I learned it the hard way. It might look pretty nice, looks like less code and more efficient. But it definitely is not so when writing code. If it results in more speed let your build tool, compressor or compiler do it. But don’t write code which spreads multiple variable declarations in var-statement across multiple lines!
This article is quite long for such a simple topic, but anyways I just feel like writing it down, since this is how I initially used my previous blog and I must say it was very helpful for me to look up things again but obviously also for others to find information. I also feel that showing what coding guide lines to use and the reasoning behind it is really important especially also for those who have to apply them.more on uxebu.com
LONDON (AFP) –
Aliens may exist but mankind should avoid contact with them as the consequences could be devastating, British scientist Stephen Hawking has warned.
“If aliens visit us, the outcome would be much as when Columbus landed in America, which didn’t turn out well for the Native Americans,” said the astrophysicist in a new television series, according to British media reports.
The programmes depict an imagined universe featuring alien life forms in huge spaceships on the hunt for resources after draining their own planet dry.
“Such advanced aliens would perhaps become nomads, looking to conquer and colonise whatever planets they can reach,” warned Hawking.
The doomsday scenario is suggested in the series “Into the Universe with Stephen Hawking” on the Discovery Channel, which began airing in the United States on Sunday.
On the probability of alien life existing, he says: “To my mathematical brain, the numbers alone make thinking about aliens perfectly rational.
“The real challenge is to work out what aliens might actually be like.”
Glowing squid-like creatures, herds of herbivores that can hang onto a cliff face and bright yellow predators that kill their prey with stinging tails are among the creatures that stalk the scientist’s fantastical cosmos.
Mankind has already made a number of attempts to contact extraterrestrial civilisations.
In 2008, American space agency NASA beamed the Beatles song “Across the Universe” into deep space to send a message of peace to any alien that happens to be in the region of Polaris — also known as the North Star — in 2439.
But the history of humanity’s efforts to contact aliens stretches back some years.
The US probes Pioneer 10 and 11 were launched in 1972 and 1973 bearing plaques of a naked man and woman and symbols seeking to convey the positions of the Earth and the Sun.
Voyager 1 and 2, launched in 1977, each carry a gold-plated copper phonogram disk with recordings of sounds and images on Earth.
Install ruby 1.9.2 from source with the code below. It will install ruby 1.9.2 preview in a folder called rubysrc in your home folder.
mind blowing pics