> you should be encapsulating that somehow into some other function or object
Hmm, I believe that's what I'm doing here. This pattern is nice because it's small, simple and easily applied anywhere.
> when I see a class called something very generic like "node"
This is for http://taskranger.com Node is a node in the tree. Might make more sense knowing that.
> lack of semicolons is bad style. Lack of braces for if clauses is bad style.
I'm aware of the consensus, but I'm pretty sure it's wrong :) Semicolons and unnecessary braces create noise and take up space. This subtly harms readability. I've been doing this for about a year and have had no problems.
Hmm, I believe that's what I'm doing here. This pattern is nice because it's small, simple and easily applied anywhere.
> when I see a class called something very generic like "node"
This is for http://taskranger.com Node is a node in the tree. Might make more sense knowing that.
> lack of semicolons is bad style. Lack of braces for if clauses is bad style.
I'm aware of the consensus, but I'm pretty sure it's wrong :) Semicolons and unnecessary braces create noise and take up space. This subtly harms readability. I've been doing this for about a year and have had no problems.
I do appreciate the suggestions, though.