Make everything a tree?
-
I've been using jQuery quite a bit lately, and I've enjoyed how easily it makes navigating and manipulating the DOM. When I think of other areas of my code, I sometimes wistfully wish it was as easily to mainpulate the data there as it is to manipulate the DOM with jQuery. This makes me wonder if I'm missing an abstraction. The DOM is really a tree at the heart of it. So maybe, where it makes sense, I could attempt to model the data in the domains I work in as trees. Then use a domain specific language to manipulate those trees.
-
I've been using jQuery quite a bit lately, and I've enjoyed how easily it makes navigating and manipulating the DOM. When I think of other areas of my code, I sometimes wistfully wish it was as easily to mainpulate the data there as it is to manipulate the DOM with jQuery. This makes me wonder if I'm missing an abstraction. The DOM is really a tree at the heart of it. So maybe, where it makes sense, I could attempt to model the data in the domains I work in as trees. Then use a domain specific language to manipulate those trees.
Once one learns to use a hammer and practices with it quit a bit it is easy and fast to use it to join lumber in any number of different ways. That doesn't mean it is a replacement for a drill. And it certainly doesn't mean that one should use it when making a cake.
-
Once one learns to use a hammer and practices with it quit a bit it is easy and fast to use it to join lumber in any number of different ways. That doesn't mean it is a replacement for a drill. And it certainly doesn't mean that one should use it when making a cake.