Sunday, April 26, 2015

OOJS Tutorial Notes

Last week, I would have told you that Class.js was feature complete. In fact, I think I said something like that in the first paragraph of the tutorial pages. And once again, I've proven myself wrong. Some days it seems like I'm my own worst enemy. So what did I miss?

For those of you familiar with OO programming, do you remember that feature where from in a class method, you can access the private scope of other instances of the same class? That's the thing I forgot! In the case of Class.js, that proves to be a problem. I found myself blindly trying to use that feature of classes just to get told off by the JS interpreter since the public interface of the sibling object obviously didn't contain the function I was trying to call.

I've got the solution, though. It's not as straight forward as what you get in OO languages, but it achieves the same effect. At the same time, it's dangerous. I'm not sure if I want to keep the feature or not in it's current invocation. In either case, you'll learn about it in part 3 of the tutorial.

Friday, April 3, 2015

OOJS Tutorial Notes

Well, I'd already written part 5 and was working on part 6 when it hit me. "I'm being an idiot! These need to be pages, not blog entries!" So I've moved part 5 to a page by itself as a new tutorial. All future parts to the tutorial will be delivered as pages. So just look to the links on the right for your link to the new pages.

Part 5, now part 1, of the tutorial is a complete re-start. When I first got Class.js working, I was so happy. I could finally get rid of a ton of boilerplate code and just focus on the functions I needed. But as things go, I found myself wanting more from it than it provided. So, while working on another project that uses Class.js, I've found myself constantly fixing bugs and adding features to Class.js. 

Did it break? Yeah, took me 2 months to fix it! Now it's solid. There's probably still a few bugs in it. No doubt I'll find them while working on that other project. As for the tutorial I'm developing, hopefully it will describe most if not all of the Class.js library and its features. I've sunk a lot of effort into this, so I hope someone else will find it equally useful.