Awesome incident of the month
By admin
I'm (finally) getting more structured and object-oriented with my JavaScript. My co-worker is a guru at this stuff.
I was working on an awesome class called FirstTree. It was super-object-oriented. I went to go use it in my code like this:
var myObject = FirstTree.new({config: configuration});
I pounded my head on this for like 20 minutes. Why was it giving some strange error?!?!? I thought JavaScript would let me be object-oriented!
So, I asked the guru to look at my code. And he pointed out, “Dumbass, you write that line of code like this”:
var myObject = new FirstTree({config: configuration});
Moral of the story: Stop thinking in Ruby!



October 17th, 2008