As a project to assist in learning Ruby, the decision was made to build a calculator. I believe it’s a common challenge that developers undertake to learn a new language because—despite the initial thought that it is an easy task—it’s challenging and can serve to sharpen your understanding of the language and how the language handles numeric types. Additionally, part of my original goals was to allow for interchangeable user interfaces, even though I only ever wrote the one, using GTK2 to provide a windowed interface.
Continue reading “Experiment: Ruby calculator using GTK2”
Recursive initialization of JavaScript objects
It’s been a frequent practice of mine lately to write my Javascript as “object oriented” as is realistically possible. Doing so has made my code incredibly easier for me to maintain, document, and read. The more I write this way, the more non-OO Javascript stands out to me as the less desirable alternative.
The purpose of this post is not to explain how or why to write Javascript objects or even best practices. (A good, quick article to read first can be found on Konr Ness‘s post How to Create Javascript Objects.) Rather, I wanted to introduce the idea of recursive initialization of objects and their “children”, if you will.
Continue reading “Recursive initialization of JavaScript objects”