Archive for September, 2009

3 weeks down – 1 week to go

So… as I wrote about in a previous post, I broke my leg 3 weeks ago.

I’ve been hobbling around on crutches ever since and frankly – its getting old!

The good news is that I’m not in any real pain and things seem to be healing OK. I’m still wondering it’ll be like to walk after my cast is off. I’m not concerned about my broken healing leg as much as I’m concerned about my ankle. Its what hurts when I put weight on that leg. I wonder how long I’ll walk with a noticeable limp. :-(

Today I saw the doctor and he gave me a bit of good news – one week from today I’ll be able to trade in my fiberglass cast for a “walking cast” that I can take off to shower, get dressed, etc. Yeah… besides the crutches, having to wrap my leg each morning in a garbage bag (takes 10 minutes!) is the other thing that’s getting really old.

As of today I’m getting around on one crutch which is a huge improvement as I can actually carry a cup of coffee while I walk (very carefully of course).


Its the little things.

I’ve been spending time with Ruby a bit lately and the more I learn, the more I like it.

One of the simple things that I learned early on is that everything is an expression (including if statements).

That allows you to do things like this:

new_value = if some_flag then calculated_value else default_value end

That’s a bit contrived. You’d probably use the ternary operator instead, but you could have blocks of code or methods executed in each step.

Its not huge, but its still much better than the Java way of:

if (someFlag) {
	newValue = calculatedValue
} else {
	newValue = defaultValue
}

Another simple thing that is huge is that Ruby sees “nil” (aka “null” in Java) as being “false” you can do nil checks elegantly like this:

my_var = some_func_that_might_return_nil(val_to_calc) || "default"

The code will get the value of “default” if the function call returns nil. Again, in Java you’d have something like:

String myVar = someFuncThatMightReturnNull(valToCal);
if (myVar == null) {
	myVar = "default";
}

Again its subtle, but it reads and flows much better to me.


Spring 3.0 – Interesting after all…

Spring 3.0 RC1 is out!

I’d initially thought Spring 3.0 was a bit of a “yawn”. The previous posts on it left me underwhelmed (and… to be honest my interest in new technologies has been elsewhere.

However, Juergen’s latest post has me a bit intrigued.

Yeah there’s support for JEE6, Portlet 2.0, full Java 5 support and their “Spring expression language”. Blah…blah… Still awake? Yeah… me neither.

But, its significant additions to the annotations for “declarative model validation” and advanced binding for Spring MVC (again through annotations) that are really interesting to me.

The guys at Spring can do a better job of explaining than I can so see here and here.

This looks really interesting and provided there are a bunch of standard validation and formatting annotations included with Spring 3.0, it would be immediately useful on my projects. A clear and consistent place to put validations and formatting details where they make the most sense.

I know some people might think that placing that information (especially the formatters) into your model is a violation of separations of concern. But, I don’t see it that way. The formatting is still handled by a separate class (the annotation) and in any app there would have to be some mapping between the model and how its formatted for the screen. I see these annotations as an elegant solution (if Java can be elegant ;-) ).

Have you looked at Spring 3.0 yet? If so, what are your thoughts?


Coming up on Three Years since making “The Switch”

In another month or so it will be 3 years since I switched my main computer from a Windows Compaq laptop to a MacBook Pro. So… its time for a Mac Post rant. ;-)

Even though my Mac is near 3 years old it still works great (that doesn’t mean I’m not thinking about getting a new one, but… it still works great! :-) ). Macs aren’t perfect and there are some issues to be sure, but… overall I’m very pleased.

Now that I’m a Mac User raving Mac fan-boy, I get into PC vs Mac conversations all the time with my fellow geeks. Its always interesting and I try to keep the focus from being “Macs are SO much better than PCs” (they are, but… :-D ) to more of a “For me, the Mac just fits me really well and the extra cost is more than made up for by the enjoyment I get from it.”

After my last conversation I was driving home reflecting on it when it occurred to me: In every discussion I’ve had with people who are dissing the Mac, those doing the dissing havenever used a Mac at all! *sigh*

Whereas almost every Mac user has spent significant time on both platforms (indeed – I’ve been a Windows user for 15 years at least).

I realize this is anecdotal, but I know a lot of people who have switched to a Mac and all are happy with their decision. I don’t personally anyone who has switched the other way (though I’ve read of a few people who ditched Apple for Linux for semi-religious reasons – real geek types).

The other day, I was talking to a guy who does a lot of “PC Support” stuff on the side. He’s always over at somebody’s house replacing hard-drives, removing viruses, restoring registries, etc. He said to me that the number of calls he gets from people after they buy a Mac drops off to maybe a 10th of what they were before. A tenth!!! When the do call its usually not a Mac issue, but more likely that their ISP is having trouble or some other networking issue.

Finally, when I bought my Mac it came with OS X version 10.4, I’ve upgraded it to 10.5 and now to 10.6. Each time it went off without a hitch and in less than an hour I was back in business. Sure.. there have been a couple of applications that needed to be patched/upgraded but no errors or major problems. I’ve never once had to do a “complete reinstall” as I’ve had to do every time with my Windows boxes.

So to all my fellow geeks out there with Windows. Good luck with that upgrade from Windows XP to Windows 7! :-D

1 Comment more...

Ouch!!

Up until 4:00 on Sunday I’d made it 39+ years without a) breaking a bone b) visiting an ER for me and c) riding in an Ambulance.

Now I’ve accomplished all three!

On Sunday I was at my parent’s place on Lake Miltona. My dad had setup a “zip line” that ran from a tree near the beach out into the water to a rig attached to our boat lift.

The idea is simple: Climb up the ladder, grab the handle, go for a ride, land with a splash at the end.

Sounds fun, eh? No? Hmm… well I suppose you’d have to be there.

It was fun… until the cable broke while I was mid-ride.

I fell about 5 ~ 6 ft down onto the beach landing on the water’s edge. The handle hit my head and cut me a little. But as started to get up, I looked at my foot and… it wasn’t pointing the way its supposed to point (it looked like a bad football injury.. the kind they won’t show replays of :-/ ). I knew I wasn’t going anywhere.

After a nice ride in the ambulance and a warm welcome in the ER I learned that I’d broken my fibula and dislocated my foot (well… one look at my foot at that much was obvious).

The excellent doctor at the hospital gave me some “happy-forget” medicine and put everything back in place, wrapped me in a splint and then sent me on my way.

There was potential that I might need surgery to have a plate put in, but after visiting an orthopedic specialist yesterday it appears that I’m very lucky and things should heal up just fine.

Looks like I’ll be in a cast for 4 to 6 weeks. Fortunately, I’m not in any pain. I’m being very careful, but… so far, so good. Its nothing like I thought it might be.

The biggest issue is the inconvenience of hobbling around on crutches and having to cancel my big trip I was leaving on this week. :-(

On the plus side… I should have plenty of time for Ruby, Objective-C, and other technical pursuits… :-)

1 Comment more...

  • September 2009
    M T W T F S S
    « Aug   Oct »
     123456
    78910111213
    14151617181920
    21222324252627
    282930  
  • Categories

  • Now Reading

    Planned books:

    Current books:

    • Growing Object Oriented Software, Guided by Tests

      Growing Object Oriented Software, Guided by Tests by Steve Freeman, Nat Pryce

    Recent books:

    View full Library

  • Copyright © 1996-2010 R. John Shields. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress