So I’ve been thinking about JavaScript performance, because I’m hoping to make my animations run smoother. The actual animation steps (changing position, opacity, or size of a node) can’t be improved by anyone other than the browser vendor. So what can I do to optimise my code and allow me to get more raw horsepower out of the same browser?
The other day, I posted the following to the Prototype Core mailing list:
Has anyone taken the time to verify that the numerous warnings
generated by running JavaScript Lint against Prototype are innocuous?
Prototype 1.5.1 generates 160 warnings. For example:
prototype.js:2300: WARNING: undeclared identifier: node
Reading the news this morning, I ran across the following statement:
It’s very early in development but there’s a beta available if you’d like to try it.
Based on my background of hard-core product development, this seems a little bit contradictory to me. I always understood a Beta to be a feature complete product that’s only lacking a little polish and a lot of testing.
I’m accustomed to making broad statements without qualification (hey, I was in Sales for a while). But the other day, I was reading the Web site of a somewhat popular Javascript library written by a PhD, and after nearly every article on the site, I had to shake my head and ask, “Is this what they’re teaching kids in Computer Science today?”
Just one of the things that made me shake my head: “The primary mechanism by which most modern OOP languages (such as Java and C#) implement this [Multiple Inheritance] is through the use of interfaces.”
Bzzzt! Wrong. And you’ve got a PhD? In What?
Read Beware Experts »
By now you may have noticed that I like long, descriptive names. Take an example from the Key-Value Coding/Observing library, setKeysTriggerChangeNotificationForDependentKey. That’s quite a mouthful for anyone. But most editors will complete this automatically after typing only a few characters.
Most importantly, the name setKeysTriggerChangeNotificationForDependentKey leaves absolutely no doubt what the function does.
In the hopes that I might be able to influence your own naming scheme, I’ve set down my guidelines. If you don’t already have a naming scheme, consider adopting one. It will make your life easier. That’s what they’re supposed to do.
Read A Few Words on Naming »