Sunday, March 15, 2009

It all started when I wrecked my bike...

So, about 5 or 6 years ago, when I was gung ho about cycling (not "riding bikes"), I was out riding the Interurban Trail, towing Laura behind me in a Burley. Joe and Cheryl were along. We went out about 5 miles and then turned around and headed back and decided to stop and rest and have some water, etc. I glided up, feathered the brakes, and ever-so-gently came to a stop. And then, realized my cleats were still stuck to the pedals because I had forgotten to click out at which time I panicked and instead of either a) clicking out and leaning over or b) PEDALING, I just fell over.

If there's a feeling sicker than that just before you hit the pavement because you forgot to click out of your pedals, I don't know what it would be. If you cycle, you know exactly what I'm talking about. If you don't, just trust me. It's the inevitability of the pavement meeting parts of one's body mixed together with the thought of "wow, I could have avoided this pain I'm about to feel if only I weren't a complete idiot" added to "sure are a lot of people around who are going to see this embarrassing spectacle". It's all bad is what I'm saying.

So, I hit the pavement. Hard. I also took a handlebar to the gut. Hard. Hard enough that the handlebar was all bent up and pretty much unusable in its newly current state. Laura, back in the Burly, was fine because the makers of the Burley are very aware that idiots like me exist and designed the burly so that if the cyclist goes Tango Uniform, the Burley remains upright and its passenger is spared the ugliness of being unceremoniously dumped out onto the pavement.

Laura, not knowing the agony I was in, thought it was pretty funny, which, in retrospect, it was, especially to a 3 year old. I, on the other hand, did not think it was funny. Actually, I didn't think about much of anything as I was concentrating on breathing; that handlebar knocked the wind out of me completely. I believe Cheryl and Joe were both concerned for my well-being because the next thing I remember is them asking if I was okay.

Well, I was okay enough at the time. It hurt a lot, but we still had 3-4 miles to go to get back to the cars, so I hauled this way and that on the handlebars to get them bent back into some kind of usable shape, and we headed back, and all was mostly well. Kind of. At the time, I was pretty sure that I had cracked a rib or two, but I didn't go to the doctor because I figured "what's a doctor going to do with cracked ribs anyway? tell me to take it easy and don't do that again?". In any case, I didn't bother with it and it wasn't long and all was well and normal again, and I replaced the handlebars and didn't think about the incident much.

Gross stuff coming; stop reading if you don't like gross stuff. On the other hand, if you are interested in why I would want to write the above stuff, read on.

Flash forward to about a year and half ago where I had this thing on my belly that was weird, but I didn't know what it was. All I knew was it poked out, and I could push it back in, and then later it would poke out again. I just figured it was part of a) being fat, or b) getting older or some combination thereof.

Well, I had this thing for a while, and didn't think much about it until it started hurting when I took my walks or played Dance Dance Revolution (a valuable part of my weight loss plan at the time, which was working, by the way). Still, I didn't really worry about it, although I did slow down, and eventually stop, the walking and DDR. After a while, though, I was starting to be irritated by this thing, and so was my family, and I had also figured out that it was probably a hernia.

So, I went to see Dr. Laura, our family doctor, and asked her about it and she confirmed that I had a hernia. About this time was when everything started the downhill slide, but I did not know it yet. She referred me to a surgeon and he looked at it, and we scheduled a surgery for early December. I angsted about the surgery, but did everything I was supposed to do: a bunch of blood tests, an EKG and show up at the outpatient surgery center early early in the morning. The surgery went pretty well, and I went home and did the recuperating thing, which also went okay. When I was "all better", though, I still had this frickin' pokin' out thing. So, when I went back to the surgeon for my follow-up, he said "Yah, I found exactly what I expected, an umbilical hernia and that's what I repaired. However, this other thing you have is not from that, and I really couldn't just do exploratory surgery while you were out (no consent), so we're going to have to go again."

Now we reach the point where I tie the bike stuff in with the hernia stuff. It turns out that most likely, this 2nd hernia (or the 1st one, from my point of view) got started the day I wrecked my bike and took the handlebar to the gut. To be fair, I do not think that had I rushed to the doctor that day, she would have found this and been able to give me a pill that would spare me future surgery. In any case, if you wear cleats and use clipless pedals, always remember to click a foot out before you stop and you can avoid this whole nightmare.

Back to the first surgery. Right before I went in, the anesthesiologist came to see me and confirm what I was getting done and so forth, and he mentioned in passing that I have a "funky EKG" and did I know anything about it? I, of course, did not know about it, but he didn't seem concerned and we went ahead with the surgery. I did, however, ask Dr. Laura what a "funky EKG" was and she got a copy of it and looked at it and had her husband look at it and concluded that I had Premature Ventricular Compressions (or PVCs), and referred me to a cardiologist to get checked out "Just In Case". As will become clear, this is the first and last "Just In Case" anything I'm doing because it all went sideways from here.

I had my first appointment with the cardiologist, and he ordered up a bunch of tests: another blood test, another EKG, an echocardiogram, a "Nuclear Stress Test" and I had to wear a monitor for 24 hours. I went and did all that stuff, which was a pain, and when it was all done, everything looked good except the results of the something-grams they took as part of the nuclear stress test were "inconclusive".

So, the cardiologist says "you need an angiogram." I had had enough of the testing, and really didn't want an angiogram. My surgery for hernia #2 (or #1, from my point of view) was scheduled for the end of the week and I just wanted to get it over with. Well, except, now I couldn't have my surgery; I was informed that no anesthesiologist would put me under with what was currently dictated into my file. So, I had to cancel the surgery and do an angiogram that day instead.

Let me tell you this: you do not want an angiogram. Not ever. They take a garden hose, and they shove it up into your femoral artery via your groing and use this to get a catheter into your heart so they can put a contrast dye in there and take picutres of your circulatory system. He told me I wouldn't feel anything other than a little pressure. What bullshit that was. In getting into the artery, they hit that big nerve that goes down the inside of my leg not once, not twice, but 3 times, and that utterly sucked.

The funny thing about all this is, about 30 seconds after they started actually taking the pictures he said I was "all clear, everything looked great", at which point I was wondering "Then why in the hell did I need this stupid angiogram in the first place?". He finished up, and they took me back out where I started and the nurses removed the garden hose, and I bled all over everything, and they applied pressure for 10 minutes and then I had to lay flat on my back for 3 hours and then I had to do laps of the recovery room and then they let me go home and I was sore for days. The cardiologist suggested that I could have the angiogram on Thursday and then the surgery on Friday, which in retrospect would have ended up working out logistically, but would have been a very bad idea for other reasons, chief among them that I would have been groin-sore and gut-sore and that would have been to much, I think.

I got my 2nd hernia surgery for the 2nd (1st) hernia a couple weeks later and here I sit, recuperating and healing up, and, truly, all's well that ends well, I guess. I'd just as soon have skipped the whole thing, which I could have done had just remembered that I needed to put a foot down a little bit earlier.

Also, medical care is expensive and I'm way glad I have health insurance. Oh, and the "funky EKG"? Perfectly normal, lots of people have PVCs.

Labels: , ,

Monday, November 24, 2008

A Very Astute Take on Gay Marriage

song chart memes

Seriously, people, get over yourselves.

Saturday, November 22, 2008

Religion Doesn't Belong in Software Development

Apparently there is a religious war going on between two factions of software developers. You have your big-design-up-front folks, and your agile folks, and if what I'm seeing in the blogosphere is any indication, they are engaged in a bitter war for religious superiority. I'm going to tell you why they're both wrong.

I cannot stand developers who get religion, especially when it's about stupid things like how to format the code (answer: pick something that everybody can live with and move on; no, your particular way isn't better than anybody else's way), how much to document the code (answer: as much as necessary, which is not as much as you think, but no more), or any of the other things we developers fight about instead of actually building the software. Religion about the development process is pretty stupid, too.

Greg's first rule of development process: if your process has a name by which it is recognized far and wide, your development organization has religion.

That's right. Agile, Scrum, XP, Waterfall, Rational, Test-First; all of those are religion, and I'm sure there are many others, as well. If you ever interview at a place and they say "We do Scrum here" or "We are an Agile shop", etc, run away, because the development group has got religion and you don't want that.

Why is religion bad? Well, by its very nature, it is rigid and inflexible, and represents in the mindsets of its practitioners the idea that they don't have to think about this stuff any more, the process takes care of it all.

Except, it doesn't, and you have to think about this stuff, constantly. The main problem is, no matter how much some developers want it to be so, one process does not fit all. For instance, if you are starting from scratch, good luck getting to your first version in any kind of useful time frame with no design up front. In that situation, you have to develop a foundation for the software, and doing it the Agile way is just not helpful because you must have some agreement at some level of what the hell you're doing before you can start doing it.

If are past that, and are evolving an existing product, then the approach you should take depends on, well, a lot of things, and there's no way any intelligent developer would say "Let's do XP" or "We need this big specification phase first" without knowing all of those things, which should be evidence that perhaps you can't use the same process for all projects.

Greg's second rule of development process: Do what works for your project right now.

I have seen various processes come and go (and come back with new names) over the years, and if I've learned anything, it's that there's really nothing new under the sun. Every so often, somebody comes up with the One True Way that nobody could ever have thought of before, and they give it a name, and suddenly it's the hot new thing. Except it's not hot, it's not new, and it can't be the One True Way. So, instead of searching for the One True Way, I've been searching for the ways that work, and the answer is: It depends.

The bottom line is, have smart and experienced developers in charge of the process, don't subscribe to one religion, and Do What Works. Sometimes that's doing a big design up front and sometimes it's doing iterative refinement in small chunks. Most of all, don't decide that what you've been doing works so well that you give it a name and write a book about it. That way lies madness.

Wednesday, October 15, 2008

Debates, Elections, Fear and Hope

With the final presidential debate behind us, I'm feeling the need to put some thoughts down. For those of you who are likely to tl;dr me on this, I'll even give you a preview with some bullet points:

  • Barack Obama took the series (3-0, if you ask me).
  • John McCain has lost himself completely.
  • The vice presidential candidates don't really matter.
  • However, if they did matter, Biden took the VP debate 1-0.
  • The artificial fear that the right is attempting to whip up has nothing on the genuine fear that is the natural consequence of neo-conservative economic policies.
  • Town hall style debates are stupid. Sitting at the table debates are awesome.
  • Pat Buchanan is just really blatantly a cheerleader for the right, and it's kind of pitiful.
  • Keith Olbermann and Rachel Maddow really do rock.
  • John McCain's base of supporters must be idiots.

I'm sure I missed some stuff up there, but that's probably good enough for now.

So, Senator Barack Obama is just a better debater than Senator John McCain. McCain comes across as mean (the first debate), condescending (say "My friends" one more time, John), or angry (this last debate). Obama has been calm, steady and thoughful throughout all the debates. Don't take my word for it, go back and watch the debates. But, really watch, don't just cheerlead for McCain because he's a Republican. You'll see.

The John McCain of now is not the John McCain of the past. In an effort to pander to the Republican base, he's hitched his wagon to the worst of nags, and it shows. It's also not working, because the only people that support him now are that base (and oh, are they base indeed), and that's not enough to win an election. He could have pulled off this "maverick" thing if only he had actually acted like a maverick in recent memory. But, now he just looks like another neo-conservative Republican to the undecideds and any Democrat who might have voted for him based on his marverickyness, and to the Republican base, he's still to moderate, and even the nomination of Sarah Palin didn't fix that.

Face it, nobody really cares who the vice presidential candidate is. Maybe the vice presidential candidate has made a difference in elections past, but these days, not so much. Even so, surgeons could remove most of Joe Biden's brain, and he'd still pwn Sarah Palin in a debate. At best, she is completely unprepared to hold the second highest office in our land (never mind her being one melanoma away from the highest); at worst, she makes George Bush look like a fucking genius.

It's the economy, stupid. Really, it is. Republicans can sow the fear of terrorism all they want, but that only works in good economic times. What's the threat of planes flying into tall buildings compared to the fear of losing your house, your car and your big-screen television? Seriously, folks, if I don't know where my next meal is coming from, I just don't have time to think about the scary terrorists.

The debate this evening was awesome. McCain just dug hole after hole, and Obama happily shoveled the dirt in on top of him. You really can't argue with facts, and you certainly can't counter facts with lies and distortions. It was like McCain went in with a game plan of the plays he was going to run, but his playbook was inflexible and not responsive to the offense or defense of the other team. It was clear that Barack Obama has class, and it was clear that whatever class John McCain may have had has left the premises. Obama responded with facts; facts about his economic plan, facts about his health care plan, and facts about McCain's plans. McCain responded with the tired old Ayers, Acorn and taxes, oh my. Anyway, this debate format was perfect to illustrate the differences between the two.

I've always thought Pat Buchanan was a douchebag, but I had hopes that maybe he'd be a little less douchebag-y when he started appearing on MSNBC as the token Republican. I'm sorry to say, he's still just a Republican cheerleadin' douchebag. I think if John McCain had come out and performed "The Aristocrats", Buchanan would give him the debate "on points".

Just givin' a shout out to my sweetheart here, gosh darn it; Rachel and Keith make politics fun again. Yeah, they're just a tad bit biased in the direction we lean (just a tad), but you know, it's nice to have an alternative to Bill O'Reilly and Sean Hannity whereby such alternative isn't on Comedy Central. (I love you, Jon and Stephen, make no mistake, but Rachel and Keith are just a tiny bit more legitimate).

In honor of Mr. Olbermann, here's my special comment: Senator McCain, you are proud of your supporters, are you? You had an opportunity to repudiate their behavior on live television in front of the entire nation, and you did not take it, sir. Rather, you deflected the question by suggesting the same sort of nonsense occurs at Obama rallies. However, you offer no specific instances of such, sir, relying instead on the politics of insinuation, saying, in effect "no u". Mr. McCain, that is not an argument, that is not a debate. I defy you, sir, to offer up one instance of someone shouting, in reference to you or Governor Palin, "Kill him!", at an Obama rally. I defy you to offer up any instance remotely as despicable. Sir, you incite and inflame your supporters; your running mate stokes the fires of fear and hate, and you have the audacity to whine about "things said at your [Obama's] rallies"? And, you can't even come up with a single example? Shame on you, Mr. McCain; that is conduct unbecoming a United States Senator. And, when the respected congressman from Georgia calls you on this behavior, sir, your response is to complain that he's calling you a segregationist? Mr. McCain, you apparently did not read or hear the same remarks from Congressman Lewis that I did because that is not what he said at all. He said, "As public figures with the power to influence and persuade, Sen. McCain and Gov. Palin are playing with fire, and if they are not careful, that fire will consume us all. They are playing a very dangerous game that disregards the value of the political process and cheapens our entire democracy. We can do better. The American people deserve better." His allusion to George Wallace was but an example of how this sort of behavior can backfire. He was not calling you a segregationist, but rather, a sower of the seeds of hatred, and, Mr. McCain, the comparison is apt. You and Governor Palin are playing a dangerous game, sir, and it is one the invitation to which I hope the majority of the American people will ignore.

In closing, Barack Obama offers real solutions, real change and real hope. Let us hope that the American people accept his offer, because the other way lies fear, darkness and despair.

Also, Senator Obama was wearing a flag pin and Senator McCain was not. Who's unpatriotic now? :P

Saturday, August 30, 2008

Why EJB, Rails, and other clever object-relational frameworks are harmful

Software developers have spent a great deal of time and effort developing new and better ways of dealing with data persistence. Unfortunately, the more clever the framework, the less useful it is when faced with any real-world data problems, and I'll tell you why. (This will be pretty java-centric, since it's what I know, and it's where I perceive the problem as originating, anyway. If you like .NET, I'll bet $1 that what I say below still applies.)

Before Java came along, I don't recall there being a big hoohah about elaborate persistence frameworks. You had your relational database, you had C, you had a library that you used to get your data in and out, and maybe you had some kind of pre-compiler to ease the burden of integrating the library with your code. Then C++ became interesting, and we all struggled to integrate the notion of relational data with the notion of object orientation. At that point, we were off to the races.

When Java came along, JDBC came followed shortly after, and JDBC is a decent general method of getting at your data in a database-independent (we'll come back to this notion later, by the way) manner. The reason it's decent is because it doesn't try to do too much; it lets you execute SQL on a server, and it lets you get at the results of that SQL. What more could you ask?

Well, to developers steeped in object-oriented methods, JDBC does not do enough because it doesn't turn SQL results sets into collections of objects. Further, to lazy developers, such as myself, it requires an awful lot of code just to execute simple queries. What you really want is an easy way of getting your data out of the database (which is really good at storing and querying the data) and into objects, which are easier for pretty much all of your other components to deal with.

So far, so good, mostly. Except, at this point, already the shift of the database to second-class status had begun. The relational database had become more of a necessary evil in the lack of any decent alternatives. With the advent of Enterprise JavaBeans, this became particularly pronounced, as it became fashionable to write as little SQL as possible and "let the framework do the work".

At the time, I even bought into this point of view. When EJB was still in its 1.0 version, at which time it was a neat idea, but not really usable (kind of like Jini and JavaSpaces; remember those?), I wrote a gigantic persistence framework that did all the things I wanted it to: I didn't have to write any SQL, I got to deal with object instances that were all objected-oriented and cool, and I didn't have to think about the database. Well, other than when I had to think about the database; my general-purpose way of modeling the data so it would be easy to map to objects only worked with CRUD operations on single instances. I eventually put in a lot of work to solve most of those problems and had something that worked pretty well, but only until I had to make any changes to way the data was structured to fix design problems.

At a later time, when EJB was in its 2.0 version, I had occasion to use it pretty extensively and, surprisingly at the time, it had many of the same problems I had had to solve in the framework I built. More recently, we have Hibernate and Rails which are essentially similar in nature, and they exhibit the same problems as EJB and everything else.

The overarching problem here is that they all try to abstract the database away. I've heard several arguments for doing so, but the one that crops up the most often is that you want to have database portability. There is this great desire to be able to switch database server technology without it being a Big Deal. Thus, if you abstract the database away, and make your framework stick to "standard" SQL, you should be able to just pick up your application and drop it on a new server and have it Just Work.

This is fantasy. For trivial applications, such as, say, the sample and tutorial apps that all of the frameworks ship with, sure, this can work. For real-world applications that deal in volumes of real data, though? Pure fantasy.

Now, a lot of the fault in this lies at the feet of the "standard" SQL people, and with the people who thought up SQL to begin with. "What, not how" works very well when talking about relational calculus; unfortunately, in the real world, we have to worry about "how" as well as "what". And until optimizers employed by database servers are perfect, we will have to continue to worry about "how". But, because of the promise of SQL to allow us to think about "what" without thinking about "how", other enterprising individuals have decided it's a good thing to abstract the database away.

Every database server's optimizer works differently. Queries that are exactly the same in relational calculus can give wildly different execution plans in practice. It takes an expert in the particular database technology to figure out the right way to write the queries to get the best performance. It takes an expert in the particular database technology to figure out the right way to structure the tables, indexes and constraints to get the best performance.

This brings me to my first rule of enterprise software: The database needs an expert.. Database design and database development is a first-class discipline. No matter how cool the rest of your application is, if it needs a relational database, you need an expert if you want your application to be at all scalable. That expert should be designing your databases, writing your queries, and working closely with your IT/operations people to ensure that the deployment is scalable and reliable. The corollary to this rule is Don't let Java programmers write SQL (unless the are An Expert). The skills required to write good object-oriented code do not automatically transfer to database development, and I've seen more needless bugs in applications that stemmed from Java programmers writing SQL when they don't understand how database servers work. Another corollary is: Don't let Java code write SQL. Java programmers write Java code. Framework writers don't know anything about your application. What makes you think that framework writers know how to write your SQL?

Now, my second rule of enterprise software is: Changing database servers is a Big Deal. Database portability is a myth, for reasons aforementioned, and further, switching database servers almost never happens. Abstracting the database away in the name of portability is useless, because switching database servers just isn't done, and when it is it's a Big Deal anyway.

Now, I'm not opposed to frameworks; anything that makes my job actually easier is a good thing. But, a framework should not get in my way, or force me to do things in a certain way. The framework writers don't know anything about my application, so why would they know how I should write it? So, any framework used for data access should stay out of the way as much as possible. Remember, what I want is a way of getting my data out of the database and into objects that I can use. And, I want Java programmers writing Java and database experts writing SQL, the framework should facilitate that.

And now, for my third rule of enterprise software: Access to the data should be through stored procedures. I want SQL experts writing the SQL. I also want them to have the ability to tune the SQL without having to write Java code. Finally, I don't want them to have to go wading through Java code (or XML or properties files, etc...) to find the SQL. The natural way for a database expert to write database code is via stored procedures. Thus, any framework I use will be capable of calling stored procedures. If your database server doesn't have stored procedures, well, you need to get a new database server because yours is a toy.

This is the point where I put in a plug for the framework that I like: iBatis SQLMaps. It does everything I want and mostly stays the hell out of the way.

In conclusion, let Java programmers write Java code and let database programmers write database code. You will get the highest quality and the most scalability that way, and contrary to popular belief, your applications will be maintainable and understandable, too. Don't worry about database portability.

That there is The Right Way.

Friday, February 29, 2008

Friday Snippets

  • This smells like more desperation from the Clinton campaign (to be fair "Both campaigns have made it clear that they would go there if they had to", but it looks like the current threat is from Senator Clinton's campaign). I'm not sure what she thinks this would accomplish; I'm afraid that I agree that lawsuits from either candidate over the delegate selection process will likely break the "reinvigorated Democratic process". I really don't understand her objection to the caucuses other than the obvious fact that the people motivated enough to attend caucuses seem to favor Senator Obama. In my opinion, that's just too bad. I like the caucus system better, actually, because I get more of a sense of community participation from getting together with my neighbors and deciding things than I do from filling in a circle on a ballot and mailing it in without ever laying eyes on a neighbor (perish the thought).

    Update: It looks like I'm not the only one who smells desperation.

  • WTF? Suspending a kindergartner for his haircut? Okay, I'm going to employ a tactic generally employed only by republican douchebags and just ridicule this and move on. I suspect that the haircut would not be a distraction to the other students (and I'm not even conceding that it actually is) were the adults not so worked up about it. This is the same kind of stupidity as not allowing a young man to wear a kilt to his prom and deserves just as much ridicule. Incidentally, that school offical still doesn't get it, but apparently the educators in Missouri are just a wee bit more reasonable, after a fashion.

  • I'm growing weary of this story and all of its predecessors being used as evidence to say "See? Teenagers are stupid." or "See? Teenagers are getting stupider." First, stupidity != ignorance (which the New York Times gets right, by the way), and it is intellectually dishonest to assert that they are the same thing. Second, a shortish quiz requiring knowledge of specific factoids doesn't really tell us anything anyway. It's yet more republican douchebag hit-and-run ridicule. I guess that's what people mean by sound bite news. In any case, read more here.

  • It seems I'm not alone in what I admire about Senator Obama and why I think he's just what we need. Awesome!

  • That's it, I'm getting my daughter a cellphone.

Thursday, February 28, 2008

Thursday Politics

I've had more time to think about the 20th (and final) Democratic Debate on Wednesday, and about the Democratic nomination process and I have some more thoughts.

I think Senator Clinton's campaign is starting to slide. I don't know if she was advised to whine about the media at the beginning of the debate or if that was all her, but in either case, that was a bad move. It made her look somewhat desperate and once the desperation starts to show in a campaign, it's over. She also got caught distorting the facts or telling half-truths several times, both by Senator Obama and by the moderators, and not just caught, but caught red-handed and flat-footed. I never had to opportunity to participate in debate in high school, but even I know that arguing against a strawman doesn't work. I know Senator Clinton is smarter than that, which is what makes me think she knows the nomination is slipping further and further from her grasp and this is causing her to make bad decisions out of a desperation to score points. At this point, I really think she could do a lot of good for the party to admit defeat, drop out of the race and throw her support to Senator Obama. That's just my opinion, though.

I've said it before and I'll say it again: Senator Obama really does seem to be very easy-going and nigh on imperturbable. He doesn't really get flustered, he doesn't seem to struggle to respond to criticisms. The fact that he has actual plans behind his policy positions in addition to his emotional message of hope makes him an ideal candidate for president in my mind. After two terms of neocons ruling the roost, and two years of and ostensibly Democratic congress rolling over on pretty much everything President Bush wants, many of us have become much more cynical and depressed about the whole direction the United States has taken. Senator Obama has impressed me with his ability to energize people like me with his message of hope, and I think that, above all, is what we need in the next President. As a wise woman once told me, the President sets the tone and topic of the national dialog. We've had two terms of "terrah, terrah, fear, fear!" I think it's time for "Yes We Can".

Labels: , ,