Yesterday's cold kept me delightfully bed-ridden all day. I lay there most of the day, sometimes draped over a chair like a wet towel, sometimes prostrate on the bed like a dead hooker, but always impossibly listless. I ended up reading all day, and I feel a little bit sorry for the book I demolished - Prodigy by Marie Lu - I would have probably enjoyed it more if I'd read it in a non-zombified state. Still, it was enjoyable if not quite enjoyed. It was as expected, not quite as interesting as Legend (the first book in the series). This is pretty typical of dystopian trilogies; the first book is about starting a revolution, earth-shattering realizations, the death of ignorance, and the next N sequels are about war and hypocrisy and all kinds of nonsense dealt with better in books that deal solely with war and hypocrisy. Prodigy did better in that respect than Hunger Games, Divergent, and the Matrix sequels, but it still suffered from the same side-effects.
I learned a new object oriented programming pattern today that provides a cool way to follow the open / closed principle.
In case you don't know, the open / closed principle says that you should design things to be extensible but not modifiable. Meaning you don't want people modifying your diaper design, but you do want people building plugins for it. The original design, once complete, should only modified if something is broken. And this seems to apply on many levels, from objects to systems. Now onto the pattern, called The Visitor.
The Visitor pattern basically has you build in an uber-simple but multi-purpose socket, that you can later build things to plug into. The socket doesn't need to know beforehand exactly what will be plugging into it, a vibrator or the Omega 13 device, it's the job of the Visitor implementor to build plugs for those devices. The result is that once you have the socket set up, you're virtually unlimited in what you can plug into it, without ever modifying the diaper.
Neat, though it seems a bit hacky to me. It appears mostly to be used when you want to take a function that might apply to many different objects, and encapsulate all the variants into an object. This object, which is called a Visitor but should really be called a DirtyDirtySlut, then plugs into those objects and provides a single service, albeit adapted per their needs. So you might have a ShaveVisitor object, that defines 10 different variants of the function visit(): bear.visit(), chicken.visit(), patrickRothfuss.visit(), etc, and when the bear or the chicken decide they need a shave, they call in the ShaveVisitor to visit (shave) them. And of course everyone who shaves, lives in perpetual fear because they have no way of knowing who the ShaveVisitor shaved before them, and because there are rumors going around that there's a new Butthole object which likes to get shaved all the freakin' time. And who wants to be the next one shaved after that?
Showing posts with label Marie Lu. Show all posts
Showing posts with label Marie Lu. Show all posts
Saturday, July 20, 2013
Wednesday, July 17, 2013
All by myself
Yuan Yuan's off on a cruise to Korea (as a tour guide), so I'm left to fend for myself. This is a survival test. Without anyone to tell me when to eat, why to put on clothes and who I can't safely ignore, I feel very dangerous. What if Yuan Yuan's mom comes to visit and no one's there to tell me to open the door? What if zombies attack and I find I have latent zombie-wasting skills and then when Yuan Yuan gets back from Korea I mistake her for a zombie and waste her? What if I accidentally watch an episode of Chuck by myself? If that happens, I may have to go off the grid. These are the questions that plague me.
Meanwhile, Yuan Yuan's 15 stories above sea level, thinking about whether she should get the steak or the lobster. As the opportunities for a free pass on a luxury ocean liner are scare, she's generously forgiven herself in advance for the inevitable breaking of two 30-day trial oaths - no sweets and no meats. She also has no qualms about rubbing it in the faces of the more faithful.
I bought myself yet another sketch pad today, as well as pencils and an eraser, so I'm all set to continue my quest of drawing lopsided things. In the fantasy literature I've been reading lately, the characters are endowed with prodigious art and/or music skills, and sometimes I feel like I might not have what it takes to be a fantasy hero. It's a highly depressing thought. So I'm smoothing out the rough edges - learning to draw, sing, squaredance, whatever it takes.
While zooming around Bejing yesterday, I finished the latest novel (reading, not writing, I only write novels in November). Legend by Marie Lu. It was good. This "good" is especially good since the novel is in the YA dystopian / action hero genre, where it seems every other novel lives these days, since Hunger Games' success. Legend is way better than Hunger Games. It may have some plot holes, which I wouldn't know about as I suspend all disbelief when reading anything with good language, but at least the premise isn't completely retarded.
I'm also done with Daughter of Smoke and Bone. It was pretty good overall, but the overly girly dialogue and ubiquitous mid-conversation thoughts in italics bothered me. I also didn't really dig the whole seraphim / chimaera "forever war," it was a bit silly. If you're going with something that silly, you might as well take it all the way to This Book is Full of Spiders: Seriously Dude, Don't Touch It. Patrick Rothfuss, you can stop wishing you wrote it and finish The Doors of Stone already.
Meanwhile, Yuan Yuan's 15 stories above sea level, thinking about whether she should get the steak or the lobster. As the opportunities for a free pass on a luxury ocean liner are scare, she's generously forgiven herself in advance for the inevitable breaking of two 30-day trial oaths - no sweets and no meats. She also has no qualms about rubbing it in the faces of the more faithful.
I bought myself yet another sketch pad today, as well as pencils and an eraser, so I'm all set to continue my quest of drawing lopsided things. In the fantasy literature I've been reading lately, the characters are endowed with prodigious art and/or music skills, and sometimes I feel like I might not have what it takes to be a fantasy hero. It's a highly depressing thought. So I'm smoothing out the rough edges - learning to draw, sing, squaredance, whatever it takes.
While zooming around Bejing yesterday, I finished the latest novel (reading, not writing, I only write novels in November). Legend by Marie Lu. It was good. This "good" is especially good since the novel is in the YA dystopian / action hero genre, where it seems every other novel lives these days, since Hunger Games' success. Legend is way better than Hunger Games. It may have some plot holes, which I wouldn't know about as I suspend all disbelief when reading anything with good language, but at least the premise isn't completely retarded.
I'm also done with Daughter of Smoke and Bone. It was pretty good overall, but the overly girly dialogue and ubiquitous mid-conversation thoughts in italics bothered me. I also didn't really dig the whole seraphim / chimaera "forever war," it was a bit silly. If you're going with something that silly, you might as well take it all the way to This Book is Full of Spiders: Seriously Dude, Don't Touch It. Patrick Rothfuss, you can stop wishing you wrote it and finish The Doors of Stone already.
Subscribe to:
Posts (Atom)
