Archive for April, 2002

The Waiting Game

Tuesday, April 30th, 2002

OK, I'll admit it... I'm not the best waiter in the world.

I'm most comfortable moving right along, getting things done and feeling like I'm making progress even if I'm not doing a lot of really important stuff. I like cleaning up the House - it's not the most exciting thing, but it beats being bored. Don't get me wrong, there's a time for relaxing and I wish I had more 'down' time, but while I'm at work, I'd rather be busy.

If I'm not busy, I think about all the time I could be spending on another activity, project, thing, that I could be working on. It's almost like I'm trapped - I can't leave work and I can't do anything other than work at work. When there's nothing to do, it leaves large gaps in the day and those are pretty hard to fill.

Sure, I can catch up on a little surfing, but that's not something I'm going to do for hours on end - I just don't have that much fun following links. I could read a book, but that's a little obvious, and I don't want the folks I work with to think "Hey! Why does he get to do that and I have to slug it out!" Well... the answer is clear - I've gotten everything done that I can do and I'm waiting for others to complete their work before I can move on. But that's still a confrontation that I'd rather avoid if at all possible.

So I wait.

In the end, things will pick up but until then, it's a painful thing
to do.

Why do I get so upset?

Monday, April 15th, 2002

Last Friday I was dealing with a vendor that I haven't had the best luck with when dealing with problems in their code. Typically, their company policy has been that we (meaning I) must be the problem and we just aren't using it in the way it was intended. This in interesting as we are their only customer, but let's forget that for now and get to the real problem - me. I get way too bent out of shape when I deal with these people. I get upset because their calm, cool, demeanor as they say it's all my fault reminds me of the sales person in the Monty Python skit The Pet Shop. And I'm the guy with the dead bird!

OK... there it is. I've been able to find why it bothers me so much. I love Monty Python, and I can so understand the incredible frustration of the guy with the dead parrot. Here he is, trying to get someone who sold him a dead bird to care that he sold him said, dead, bird. Put in these terms it's clear why the person is calm - he knows that there's nothing he has to do. He has all the cards - the other guy has the dead parrot and he has the money. All he has to do is to not say or do anything illegal and chances are, the guy will leave. Give them nothing to fight against, and there will be no fight.

This is such an interesting philosophy! I have to agree that prior to writing this down I hadn't seen it in this light. Now that I see it in this light, I'm not sure what the best approach is to solving this problem of mine is. You see, I still have the horribly built code (dead parrot) and unfortunately I can't just bury it in the backyard. I have to live with it.

If I were to take a page from their playbook I'd pass this along as a nice, living parrot and let the users figure out that it's dead. But this has a problem - the customer won't ever go into that Pet Shop again, and I can't have the users thinking I'm no smarter than the Pet Shop employee, so I need a better alternative. Hmmm... what can it be?

What I need is to have something that the vendor wants - that I can control, be just as dead (useless) as my parrot and then we can trade - I'll give you a live cat if you give me a live parrot. Interesting idea... now what can they want that I can say is alive when it's as good as dead to them? Hmmm...

Got it! I did some tests on their code and it's in a terrible state - memory problems, and their hurried design of the new updating scheme has got some serious problems. So I've suggested another way to achieve the same ends, and all they have to do is to unroll the changes due to the new updating scheme and put in a new feature for me and it'll be working like a charm. Wonder if they'll take it...

What really helps is that I know I'm the guy with the dead parrot... whenever they start to get to me now, I just have to giggle as I know I'm the guy holding the dead parrot, and the trick is to try and have at least a little fun with the ex-parrot... the one that is no more...

Gotta Love OS X

Friday, April 12th, 2002

OK, once again, I have to say that Mac OS X is a great step up from it's OPENSTEP roots, and I love doing development on this platform.

I have been working on a simple GUI query tool for PostgreSQL - with an eye towards making it as databse independent as possible. Lots of abstraction in the base classes, and then PostgreSQL-specific classes for the models. It's a good design, if I do say so myself. And the speed with which is goes together is incredible. You can leave all the basic initialization to the nib loading and instantiation and the just focus on the behavior in your model and controller classes.

Don't get me wrong, if you don't like Model-View-Controller (MVC) style coding or you don't understand how to create MVC designs, then I can really see that this design paradigm could be a pain in the neck. However, having said that, there aren't a lot of apps that need a GUI that aren't MVC, or couldn't be made in MVC easily.

While I've written a ton of Visual Basic code in my lifetime, I have to honestly say that their merging of the Controller and View objects just isn't what makes for really good, reusable code. Sure, you can hammer something out fast - drop a few buttons on a window - double click on the buttons, write code, and run it. But in the end, the View holds too much business information and that's never good as you try to scale things up.

Sure, you can use the COM objects to get the Models out of the code, and that's good. But you can't get the Controller out of the View in VB. And there's lots of reasons to have the Controller be the only disposable code you have. That's what I like about Mac OS X.

I guess that VB gets around this by the wealth of OCX controls that are reusable, but specific enough that they contain quite a bit of useful behavior. This is OK, and I used a ton of them in my day, but the idea of having a real Controller is just so nice and clean. It makes things so much easier to design.

I guess that's why the little database app went together so nicely. It's got all the functionality that I need and putting things together was the most demanding part and IB did the vast majority of that. Great tools for cool programming. Can't ask for anything more.

People really are funny

Friday, April 12th, 2002

I was sitting here thinking about the status of a project I'm working on and I had to giggle to myself a little. Now I've written in the past about the company that provides the basic framework/infrastructure and how it's not the most incredible piece of engineering I've ever seen, but today's got to be a new high (or low) point in the saga of this project.

We have been facing a real problem with stability that, in my opinion,
has been brought on by the lack of careful development design that Java seems to breed. Not that I've got anything against Java as a language, but whenever you have a language that tries to do so much for you, you run into folks that this this is some sort of magic Genie that will take care of a lot of other things as well.

But I suppose Garbage Collection is a good thing - if you understand the limits of technology. It's not perfect after all. Let's take the example of an event-driven system. A good design might be to have each event source capable of sending one event through the system, and buffering up the others in some sort of compressed queue, until the handlers of the event are done with the one you've already sent. Then there's the magic Genie model that says "Hey, let's generate a new Event Object for each event and pass them on as they are generated." This is the incredibly bad design that Java so easily allows that I'm talking about.

On the surface, both seem the same. Both handle all events - one buffers them at the source, the other somewhere in the event processing loop. But the enormous difference is that the first one allows for such ideas as "too busy" while the other simply allows for excessive memory usage that will lead to crashes.

If you don't exercise some level of common sense in the insertion of events into the stream, you can't be upset when the stream can't keep up with the flow of events - and the Garbase Collector can't keep up with disposing of all these created objects. Yes, it should in a perfect world, but this isn't, so it can't. With one Keyboard Event Object (say) that you reuse again and again for the different events, you don't have a problem with excessive memory usage. Also, in the Keyboard Event Filler you can say "OK, I've got 50 keyboard events in my buffer - that's enough, throw the rest out." or something similar. In any case, you can easily control the number of events since you're controlling them at the source. It's this kind of systems thinking that I'm seeing so completly absent in so many Java development projects these days.

C, Obj-C, C++ - they all made it hard to allocate and free memory and objects so you were pretty darn careful about what you created, where you passed it around and who freed it. Yes, this lead to memory leaks and this, in turn, lead to memory profilers. But the problem of
over-generation of objects seems to lie clearly at the feet of Java as it makes it too easy to create without any knowledge or care about the consequences, and lifetimes of these created objects.

In some ways, in the hands of good developers, Java's Garbage Collection is a good thing. But it doesn't absolve you from thinking that it's not magic. And that's where you get into all the trouble. In this regard, it'd be better to write in a little more complex a language just to force all the developers to think before writing.

Life with sherman

Thursday, April 4th, 2002

Life has been very, very busy for me these days - as evidenced by the time since my last journal entry. Lots of things have been happening and I have to say that most of them have been good, while still keeping things interesting with a curve here and there.

I'll try to hit the high points and not be too wordy along the way...

Work at The BANK is going well. Lots of work to do, which is nice. Keeping my skills sharp and putting more things in from of the traders. All this is good, and I can't complain about work at all.

The word amongst the consultants is that rates are being lowered which is interesting in that I got a non-trivial raise. I guess they are seeing that developers, in general, are getting less, but good ones are still worth paying more for. But of course that'd be my interpretation of it. 🙂

At home the machines are running well, but a few weeks ago I lost the 9GB boot drive on sparky which took a few days to get a replacement for. In the end, it was cheaper to get an 18GB replacement than to try and get an exact replacement. Funny how technology drives prices down then up again as the parts get more scarce.

I've also got my first Mac in a very long time - a 14" iBook. And by a long time I mean a decade. I did this because of Mac OS X and the Developer Tools that used to be thousands of dollars under NeXTSTEP and OPENSTEP - both of which I love and continue to have in my office. So I was quite taken with the new iBooks and got one. Excellent move. With my 802.11b wireless LAN in the house, the AirPort card works wonderfully, and it uses the wired 10/100-baseT when I'm sitting at my desk. Very nice. The tools are as nice as I could have imagined though I have to say that they could have made the administration a little easier with the startup scripts if they had gone with Irix's or RedHat's chkconfig system, but that's a minor point and they have a feature, just not as easy to configure and use.

While it has taken a little getting used to, specifically in terms of getting the tools I got used to on Linux/Solaris/NT to Mac OS X, I think I'm over the hump on getting up to speed on the Mac world again. Oh sure, there are a lot of little details I'm unsure of, but I'm productive and have about 90% of the things I need up on the iBook and that's more than good enough to do all I need to do.

I'm impressed with the improvements in Project Builder since OPENSTEP, and am glad that they didn't mess too much with Interface Builder. Setting up the user preferences on this guy could have been a lot easier, but it's all a certain mind-set. Where to change the size of the icons on the Desktop? Don't look for it under the Desktop Preferences, you need to select an item and then select the view preferences for that item and it'll change it for all Desktop items. Not obvious, but there's a certain logic to it I'll agree. It's just getting into that logic that's hard.

The DVD/CD-RW on the iBook is very interesting, but I'm a little surprised that while the DVD is paused the iBook can't go to sleep. If you stop the DVD playback then it'll sleep and the play will resume where you left off. Hmmm... still a few bugs in the system, but they'll work them out or I'll work around them. Either way, it's still a nice little box.

My next box will be a new step up - gotta get a dual-Athlon XP with gobs of memory and a very nice video card with OpenGL acceleration. This will be my preferred desktop workstation in the office and I figure that I'll get it nearer to the Fall.

For now, I have to say that working with sherman is a whole lotta fun!