Archive for June, 2007

Gotta Leave it on the Track

Monday, June 18th, 2007

Interesting thing happened on Friday, and I'm just now getting around to writing about it. One of the new developers here asked me about my opinion on the checked versus unchecked exceptions - otherwise known as the runtime versus typed exceptions. So I talked to this guy for a while about where we use one versus another and why we try to stick to a scheme given that Java itself makes this pretty hard to do. For example, Java has runtime exceptions and typed exceptions in it's code, so when you try to write code like Java's you are stuck trying to make it look like Java, but since there are really no hard and fast rules as to when to use one versus the other, it's a bit tough, and you have of make a lot of judgement calls. Nothing horrible, but something you have to be aware of.

So as we're talking about this, the guy tries to show me that I'm inconsistent in the use of these in the code I've written. I understand exactly what he's trying to do (though he denies it) - he's trying to show me how smart he is in an effort to gain my respect. Missed the boat entirely.

This kind of "See how smart I am?" crud does the exact opposite for me. Sure, you look at the Vector class and there are a lot of exceptions that are unchecked - ArrayIndexOutOfBoundsException is one. In JDBC this would be a checked exception for sure, but here, it's not. Why? Who knows. More importantly, who cares? When you're writing JDBC-based classes and extending them, you have to live in that little sub-universe of Java, and stick to their pseudo-standards. In the case of the Vector, you have to stay in the world of JDK 1.1 and realize that in the beginning they weren't using a lot of checked exceptions, so you have to make you code look a lot more like that - certainly if you're subclassing Vector (which was the case in this instance). Then he asked me to look at his code and what would I do in this specific case.

I looked at the code and said that he should check the input parameters, check all returned values, and single-entry/single-exit all methods. These are the three most basic coding standards that I have and believe in them without question - regardless of the language. He then said that this code didn't need that. A light then went off in my mind and I knew exactly who this guy was. By the way, he was the Rock Star of the previous few day's posts. This guy was a lazy Rock Star coder.

I asked him my one of my favorite questions about self-image and human nature: If you were driving on a road at 2:00 am and came upon a stop light that was red, and could see far in all directions, far enough to see that no one was coming, would you run the red light? His answer was "Yes", as I knew it would be. I pointed out to him that this tells me he believes himself above the "rules" made by others. After all, the stop light is just supposed to keep us safe, or is it the law to obey them? Yes, it's a law, but many people think it's really optional, and so feel that it's their life, and they can decide what's important and what's not, and they decide that this light isn't worth stopping for.

So we look at his code. We talk more and it comes out that he's built server-side code that has all these checks in it, but he hasn't put them in this particular code because he thinks it's not worth it. I ask him: "Why isn't this section of ten lines of code worth your very best efforts?" He has no answer, and wants to change the subject - which means he knows that I'm right, and that well documented, error-checking code is really better than code that's totally optimistic and undocumented. But he was trying to show me how smart he was, and this is really spoiling his plans. Sad day.

This goes into every aspect of a person's life - you either run it out to first base, or you pull up if you think you might not make it. You either go all out every time, or you sluff it off. You play at your level, or you sandbag. It's personal honesty and integrity. As Yoda said: Do or do not. There is no try. and he wasn't talking about giving your best effort and failing, he was talking about giving it everything you have all the time, believing that this is the last time you'll ever get a chance to do this, or you hold back, take it easy, realize this isn't a playoff game, etc.

I have no interest in living my life the latter of those two. I have to give it everything I have every minute of every day, or I'm just not going to feel like I can look myself in the mirror in the morning. And when I give it everything I have, I can look myself in the mirror - win or loose, and know that the only thing I can do is practice, because there's nothing I could have done to change the outcome - there's only what I can do to change it the next time.

Introspection is Painful

Friday, June 15th, 2007

Several things have happened in the last few days that have caused me to look back on things, times, places, and look within to see if I'm really the person I think I am, or if I'm just kidding myself. It's not a fun process. Never is. Never has been.

The first incident was an old friend from grad school emailed me about some pictures that Purdue had up on it's site for the graduates. Some were clearly professionally done, others were very clearly not. What sort of stung was the fact that I spent 9 yrs. there and there was no picture of me. It's like I was a ghost. Invisible. But I wasn't. I taught classes, did research, did a lot of stuff, but in the end, I'm only a footnote, it seems. Now I know that I didn't take the time, effort, or money to get a professionally done photo for the school, and I didn't go out of my way to put in an amateur one. But I am willing to guess that my friend that sent me the links didn't go out of his way to get an amateur picture of him there, either.

I'm surprised at myself, a little. I didn't think it would bother me, but it does. Just a bit. I look back and think What difference am I making? and I'm stuck thinking that about the only thing I'm really doing of any permanence is raising great kids. No one really seems to care too much about the work I'm doing. And in all honesty, if I weren't doing it, they'd survive. Maybe have to have more people, or do with less, but they'd still keep rolling.

Which brings me to the second thing that recently happened that caused me to take stock. Yesterday, I wrote about the Rock Star programmer, and today I talked to his manager - simple saying that one of my concerns before we hired him was that he might turn out to be just like this - Do what I want, or I'll do it anyway. And the feedback I got from his manager was a little surprising, and at the same time not: he was happy with the guy. He hadn't had any experiences like I had with the guy and was producing a lot of stuff - comparable to the others in the group. Again, I hate to say it, but it's classic Rock Star programmer - gets lots done, but don't cross him.

I didn't push it, and didn't want the manager to do anything at this point, I really just wanted to express my concerns and see how his dealings with 'Mick' had been going. I know in my bones that this guy is going to be more hassle than he's worth. But I'm not about to make it an issue. But it got me to thinking: Am I a Rock Star programmer?

I suppose that anyone that's really productive can think that maybe there's a little element of the Rock Star programmer in them. Being a Rock Star is, after all, about getting a ton of work done in a very short time. But very soon after that, the similarities end and a good, senior, developer is entirely different from a Rock Star. So I was looking within and trying to see if I was really who I thought I was.

I guess the thing I look at are those things that I see that are clearly not the qualities of a Rock Star in myself. Like the middle of the night phone calls. Never lost my cool, always explained everything, walked them through the problem, or if they wanted, I just fixed it myself and then sent out an email explaining the problem. Existing code - I stick with what is as opposed to what I'd like it to be. I might not code this class a certain way, but if it's there and working, I'm not going to spend the time to recode it just because I don't like the way it looks, or how it's structured. Now, if I have to re-write big sections of it, I'll probably clean up the indentation, add a bunch of comments, and such. When I write new, I try to stick with the 'tone' of the rest of the library/package/project. It's just easier on the next guy that might have to pick this up. There's no need to make it look like it's been written by multiple folks, even though it clearly has.

So I guess I'm comfortable with where I sit in the spectrum. I'm certainly not a wallflower, but I'm pretty confident that I'm not a Rock Star either.

Rock Star Programmers

Thursday, June 14th, 2007

There's been a lot of talk about the Rock Star programmer on the web these days. Several very interesting articles about it. Today I had a run-in with a new guy at work, and I have to say, while not a Rock Star, he's certainly got several of the worst qualities of a Rock Star, and I'm trying very nicely to point out to him that they really aren't very useful here.

I try to ask people in interviews what they think their most important job is when first coming to a new place. There are a lot of different answers, most of them very political or very technical, but every so often I find someone who understands what it means to be a good developer, and they give me the answer: learn.

That's when I know I have a 'keeper'.

If the smartest person in the industry came into a shop and started changing things, or building things, it would only be by the greatest feat of luck that it actually worked and worked well - with the existing systems. Anyone can build an app. OK, almost anyone. It takes a skilled developer to see the right way to buld the app so that it fits in nicely with the existing apps and services in the organization.

For instance, if a new app is built that needs to make a copy of the accounting data in order to function as built, then it's bound to fail. Or worse, cost excessive manpower to make sure that it's always kept in sync with the real repository of the accounting data. Making copies of critical data is almost always a mistake. But if you don't know how it's stored (because you're new and don't take the time to learn) then you'll build something that has to have lots of scripts for copying, checking, back-filling, etc. all because you didn't learn before you built.

So today I had a visit from a new developer - been here a few weeks. We'll call him Skippy. Skippy wanted to have a new method put on a Java table object that is widely used in the organization: renameColumn(String, String). I pointed out that there already exists the method setColumnHeaders(int, String) that can rename the column header, but he pointed out that if he didn't know the column number, the setter wouldn't really help. Agreed, then use the method getColumnForHeader(String) to get the numerical column and then use that in the setter. Still no good, says Skippy. It's too long.

Too long? I pointed out that it was one line:

  setColumnHeaders(getColumnForHeader("old"), "new");

and he said that even that was not as clear and concise as the rename method he proposed. I agreed that the 20 (or so) extra characters make the existing method invocation technically longer than the other, the point was really is this the best thing to be spending time on right now?

We are, after all, understaffed for the workload, which means that things are always getting rearranged on the priority list, and many are just not getting done. This means that we need to be very efficient with our time. While I don't disagree that adding convenience methods to classes makes them easier to use, my question is does this addition benefit the users in a material way? And to that question, I am fairly confident, the answer is 'No'.

Now I'm trying to put this in as non-confrontational a manner as possible, but Skippy is still being quite insistent that this change is significant and warranted. I'm trying to tell him that it's not an issue of the individual change, it's about a balance of the workload and the cost/benefits of each thing that we do. I can see his eyes glaze over... his head turns away... and I know I've lost him. I say as much and we're done.

Later, as I try to use an example of something I had done for him the day before to show him that I'm not against his ideas just because they aren't mine, he told me that he was adding the method in his project. As further evidence of his thoroughness, the feature I added for him wasn't going to be used because he hadn't checked with the Team Lead beforehand, and when he told the Team Lead about it, he directed him to do it another way entirely. Effectively wasting my time the day before because he hadn't learned what was needed. He acted on what he thought was needed.

Rock Stars - more hassle than they are ever worth.

Adding Combo Graph to BKit

Wednesday, June 13th, 2007

comboGraph.png

Today one of the developers wanted to add lines to the VantagePoint bar graphs that I had wrapped with nice little helper classes and applets for BKit. The problem is that a bar graph can't have lines, but a combo graph can. So I added the combo graph as a type to the BKBaseGraph and the BKBaseGraphApplet. The idea is that it's very much like the bar graph - even being subclassed off it, but the way it handles the lines versus bars is to have essentially two types of variables: regular variables that are the bars, and line variables that are the lines.

Once I figured that out, and then fixed up a few methods like getColumnHeadersOnGraph(), it wasn't that hard to get everything working. The subclassing was interesting in that I had to have tests for the combo graph before the bar graph as the instanceof would have been true for the bar graph class when I really wanted it to hold out for the combo graph. Not bad, but interesting.

The final thing was a new applet PARAM tag to indicate what lines to put on the graph. I chose asline:<col> ("as line") so if I had columns one, two, and three as bars, and four as a line, the relevant PARAM tags would be:

  <PARAM NAME="visible:one" VALUE="TRUE" />
  <PARAM NAME="visible:two" VALUE="TRUE" />
  <PARAM NAME="visible:three" VALUE="TRUE" />
  <PARAM NAME="asline:four" VALUE="TRUE" />

This tests out great and the line width, color, etc. all work on the line in the combo graph - as you'd expect. It's a nice little addition to the toolkit.

Fiddling Around with CSS

Tuesday, June 12th, 2007

Today has been a bit of a slow day - the data is good, trades are flowing, things are really humming along - all of which makes for a slow day for me. Not a tragedy - I had time today to mess around a little with the CSS on the server editor. I had picked up the CSS for tabs from WebFX and the 'winclassic' version was as close to Windows as I could have hoped. The problem was, it used the Windows-defined colors for 3D objects, and while that's really nice on IE, it's a mess on Firefox as those aren't globally defined in Firefox like they are in IE. So I set out to clean up a few things and in the same way that the fonts were cleaned up a while back, by specifying the RGB components, I was able to get IE and Firefox to match exactly. Nice.

I'm sure that if I had the time, energy and interest, I could look at the CSS stuff and make something really spiffy. I've seen very nice scrolling tables in CSS, and lots of other stuff, so I know it's possible, it's just that this kind of fiddling is something I really hate to do. It reminds me of the time when coding Windows apps that you had to layout your GUI components in code - moving things over 5 pixels, saving, recompiling, testing... it got old very fast. Someone is going to make this processes with CSS faster, and when they do, it'll catch on a lot better than it has up to now.


Interestingly, Apple's stock took a hit from the Keynote. I know it wasn't earth-shaking stuff, but it's really interesting to see that perception is far more important than reality in the markets. People expected something wild... something very Steve, and what they got was a developer's conference keynote - talking about the upcoming OS features. I guess even The Steve needs to watch out for his own distortion field... if he doesn't have the batteries freshly charged he can get himself into trouble.

WWDC 2007 Keynote News

Monday, June 11th, 2007

keynote_sm.png

Well... I happened to really like the MacRumors coverage of the WWDC keynote through IRC. I didn't think it'd be that different, but the response time is, of course, very fast for a chat connection, and even with the AJAX version of the web page, it's much faster to send just the text in chat than to update part of a page. So, I read the chat transcript and then looked at the pictures on the web page. Pretty nice.

Most of the keynote was Leopard, and the new features: new Finder, new dotMac integration, and the new features that had already been shown in previous keynotes. I have to say that it was a nice presentation, but nothing really surprising. It's nice to see that Leopard is going to have the features that warrant a $129.00 upgrade price, but there's not a lot that's really horribly wrong with Tiger (10.4) right now.

And that's when it hit me... this is very much a consumer update. This is so that the apps look more uniform, that iChat has more features, Finder is easier to use, backups are automatic with Time Machine, stuff like that. This is an update for my Mom. It's got nice things for me, but nothing compared to what it'll be like for my Mom. In that sense, it's going to be really exciting. She'll like it.

Summertime and Relaxation? HA!

Monday, June 11th, 2007

This past three-day weekend we took a trip to northeastern Indiana to a state park for a little pseudo-family reunion with my side of the family. It had it's moments... there was swimming for the kids... playing in the wide-open spaces with footballs, baseballs, frisbees... taking a hike to the nature center... having pizza with everyone... no doubt, there were fun times. But it wasn't very restful. Summertime isn't very restful, is it? I mean, the weather is nice, and for those of us that live in cold and ice for far too long each year, it seems that we're so excited about the warmth, that we forget that we're wearing ourselves out.

Then, on the way home it's time to stop by the Farm and see Liza's Dad. Always fun, but we get to spend about an hour or so with him and then it's time to head out to get back in town in time for me to get some sleep before I have to get up and start the week. I know that my workload is at least partly to blame, but that's also the primary reason that we have the time and money to do the things we do. So we can't be too hard on the workload.

I look forward to the weekends to rest and relax. But it seems that summertime is always not when you get to really rest and relax. Liza said to me "Lazy, Hazy, Crazy Days of Summer? HA!" and she's right on the money. I don't like the snow, but Holy Cow! I'm ready for a little rest already.

Coding like your Life depended on it

Thursday, June 7th, 2007

This morning has been a very hectic morning. Some new instruments were traded and they weren't feeding properly into one of my systems so while I was trying to handle the production problem of halting the trades and manually amending positions, I was also trying to find the place in the code where I could augment the search symbology so that the instruments would feed. That, on top of trying to make an app that I didn't write a little more visually obvious that one of the instruments you have up you are not permissioned for from the exchanges. I got the guts of the fee-liable blocking done, but the app wasn't being a visually clear as the project manager wanted.

What a morning, indeed.

The second app had to wait as I feverishly tried to get things in production straightened out. Trades were backing up, things weren't looking good. Lots of stress if I have to restart the server... not fun. Amazingly, when the trades were pulled from the retry list and the positions manually updated, and the trade feed restarted, things started to work. This was major lucky break. With this, I had time to work on the solution. It took me another half hour to code the solution, test it in the development environment and then get it ready to deploy, but I had breathing room. The fix is a simple fall-back one - if the original symbology isn't found, try this other kind and see if it's there. It works cleanly without breaking anything else and it just plain works.

Once that was done I could focus my attention to the app with the visual issue. I'm not a big fan of Win32/MFC GUIs, and certainly when I didn't write them in the first place. Comments in this app date it to 1998 - that's almost a decade old, and the code shows it. There are a few comments, but not many. Trying to get things figured out is a process of tracing the logic through different libraries, different directories, it's a mess. But in the end I was able to get what I think the users will find reasonable. We'll have to see.

Most importantly, I'm out of the woods and things have calmed down. That's a major relief.

Getting Close to Burn-Out

Wednesday, June 6th, 2007

These past few days have been very up-and-down for me. Typically, that means I'm getting closed to burn-out as my tolerance for idiots is at a low point and they effect me more than usual. OK, that's harsh, but it's not that far from the truth. Today I had to dig into code that I told the management was a mess from before Y2K, and hasn't gotten any better with age. It may have been sleek and nicely designed at one time (for a Windows app) but now it's just a mess. There's too much business logic in the GUI and there's no clear pattern for the design. What part is doing what? Where's the documentation? All these are good questions that go completely unanswered. This makes for long, stressful, days. But it's a job.

Summer Time is here for the kids... today was the last (half) day of school and that means that they'll be doing a lot more things - running here, going to Band practice, Karate, etc. It's a hectic time and it's always nice when they go back to school in the Fall. But for now, it's time to enjoy the first few days of Summer and have a few cook-outs. Maybe a good burger with a slab of onion will pick up my spirits...

It's for sure, I need to find something.

Oh... MarsEdit's ability to include these images is amazing. I just can't believe how easy they have made it to include a little picture with a blog entry. I've been slapping them on the last few, and I really like the look of this. This is way better than my own on-line Journal... WordPress and MarsEdit are pretty impressive.

New MacBook Pros Arrive

Wednesday, June 6th, 2007

product-15in.jpg

The new MacBook Pros hit the Apple web site today and while they are a nice upgrade, I don't think I'll be getting one as my existing MacBook Pro isn't that much different from these guys. The biggest changes are the screen - you can get more pixels, which is always nice, and the graphics card, that's nice. Oh... and now you can get it with 4GB RAM while mine only holds 3GB. Nice, to be sure, but even all together, it doesn't justify the upgrade. But something else hit the wires this week that will - the quad-core Intel mobile chips due out next year. Yes indeed... put four cores into the MacBook Pro 17 and it'll be something to get. That will be an upgrade I'll make.