06.13.05

Joel Speaks…

Posted in Programming at 11:27 pm

A while back Joel, over at Joel on Software posted a new article on coding conventions Making Wrong Code Look Wrong.

I think his point was legitimate, but maybe clouded by the fervor with which people hate Hungarian notation. The central point that coding conventions should be used to make wrong code look wrong. It may be that Hungarian is a reasonable solution for a procedural environment.

The best Java analogue I can think of is RequestDispatcher.forward(). You *have* to return after that call, or you’ve just created a bug. It may not crop up, but if you don’t return and then some other piece of code tried to modify the response *boom* it blows up.

So how do you make this look wrong:


RequestDispatcher dispatcher = ServletContext.getRequestDispatcher("path");
dispatcher.forward(request, response);

and make this look right:


RequestDispatcher dispatcher = ServletContext.getRequestDispatcher("path");
dispatcher.forward(request, response);

return;

That’s the kind of thing I started thinking about when I read that article.

You can’t extract a method, because you’ll just create another method that requires a return after it. So I think the answer is to make a dictate against such methods. Since we can’t change the J2EE spec, we should leave RequestDispatcher.forward() calls bare. At least, then you can recognize one of the few methods that are missing the required return.

The bit I haven’t figured out, yet is what would the J2EE spec look like if we could change it. That’s a topic for another time.

Diet Pop Update

Posted in Fitness at 10:05 pm

HoustonChronicle.com - Diet drinks won’t provide weight-gain shield:

“‘I want to be very clear,’ said the study’s lead author, Sharon Fowler, an associate faculty member at The University of Texas Health Science Center at San Antonio, ‘Our findings do not prove that diet soft drinks cause people to gain weight.’”

Seems that that article is, at least, closer to the source of the actual research. That quote kind of sums up what I expected to hear. So it’s just correlation, and the other article was most likely just crap.

Duh, fat people drink diet. This article doesn’t talk about how much weight people gained, when they started drinking diet, yadda, yadda. I hope the actual study covered that stuff. Otherwise what’s the point? How do you know if someone gained 20 pounds in 2 years, started drinking diet and only lost 10 pounds in the last 6 years?

Study: Diet Soda Doesn’t Keep People Skinny

Posted in Fitness at 6:51 pm

WRAL.com - Health Team - Study: Diet Soda Doesn’t Keep People Skinny:

“Researchers at the University of Texas Health Science Center in San Antonio analyzed patient information spanning 26 years. They found that those who drink diet sodas were more likely to become overweight. The risk of being overweight or obese increased 65 percent more with each diet drink per day.”

I really wish they had included references to the actual study. That paragraph makes the article sound like it’s full of crap. It seems perfectly reasonable that there would be a correlation between overweight and drinking diet. If you’re not overweight and you drink pop you have no reason to pick the diet over non-diet. How, exactly, did they prove that drinking diet caused people to become overweight, though?

So much music, so little time…

Posted in Turds at 4:37 pm

6261 songs in my iTunes library. 3936 (62%) never played. That’s slightly misleading since I’ve listened to most of them at one time or another, just not so that iTunes could count it. Plus I lost my play counts when I got my laptop and re-imported everything.

Still, lots to listen to.

Security chip to limit OS X to Macs - vnunet.com

Posted in General at 3:34 pm

Security chip to limit OS X to Macs - vnunet.com:

“Apple could use the Trusted Platform Module (TPM) chip to ensure that only Mac computers can run its OS X operating system, according to a news analysis from Gartner.”

Well, yeah, of course they could. They might even do it. But even that won’t stop someone from hacking kernel layer and making it look like such a module exists. Unless they move to some sort of product activation thing, ala Windows XP, that is. Even then, with control of the kernel layer, such hackery should be doable, just harder.

I’d guess that as long as I can’t go buy $130 for OS X and drop it into a Dell hack-free that’s good enough. They don’t need to stop any more than casual installing on random other intel hardware. It’s not as if they forcibly tie their software to their hardware now. It’s the lack of PowerPC based hardware just lying around to hack on that keeps it from being done.

Things that make me want a Symbian phone.

Posted in General at 1:59 pm

I do need a new phone, after all.


Nokia to build phone browser from Apple tech


Russell Beattie Notebook - What’s on my Nokia 6680

Winnie From ‘Wonder Years’ Shows Her Sexy Side

Posted in Turds at 1:49 pm

WRAL.com - Entertainment - Winnie From ‘Wonder Years’ Shows Her Sexy Side

The 13 year old in me is having fits right now.

“Use Automator to create a Mail ‘attachment sender’”

Posted in General at 12:01 pm

macosxhints - 10.4: Use Automator to create a Mail ‘attachment sender’

Okay, this is cool. I should have realized it was possible, but somehow it just didn’t click for me. I happen to have a folder where I keep a bunch of files that I want to mail copies to someone every time there’s a new addition.

06.12.05

How did I not know about this?

Posted in General at 10:59 pm

Cycle through all open windows via the keyboard

Of course the default Control-F4 turns the volume down on my iBook. :(

You’re getting old…

Posted in Fitness at 8:08 pm

This is what the doctor told me the last time I was there. I was in for a checkup of my sprained ankle and mentioned that I was having knee trouble. He manages to poke and prod in the most painful places on my knee and then tells me it’s nothing to worry about and I’m just getting old.

I’m 29 for cryin’ out loud. I’m not getting old, yet. No way.

So fast forward to now, a good three months later. They’re getting better now. My left knee is almost entirely pain free and my right knee is nearly so. I had also developed shin splints again (those hadn’t bothered me since high school) and those are pretty much gone now.

All I had to do was stop slacking off workout-wise. I’m two weeks into the Prelim phase of Core Performance. They suggest the prelim phase for “Tight, in pain or deconditioned”. Uhh, check, check and check. I just had to get over the ego blow it was to force myself to start there, when just about a year ago I was in pretty decent shape when it came to most of those exercises.

I’ve had a couple of revelations that made it easier to get back into it.

First, the “You’re getting old…” thing got to me. I’m only 29. I refuse to accept that qualifies as old.

More than that, I had read somewhere (I wish I could find the source, again) that sometimes knee pain can be caused by an imbalance between your quad and hamstring. Considering my right knee was the worst off, and I was recovering from a right side hamstring tear there seemed to be something to that theory.

Never-mind the left side quad tear from a few months back. That doesn’t fit my theory, so I shall ignore it. :)

Then one day something had occurred to me. I’ve been saying “I’m trying to lose weight” for almost a year now. I don’t know when it changed from “actually losing” to “trying” but it’s somewhere around the new job. I’ve actually gained 20-25 pounds in that intervening year of trying.

As Yoda says, there is no try there is only do or do not

As a result I’ve taken to tracking whether I ‘do’ or ‘do not’ for any given day. It’s worked out reasonably well. The criteria isn’t so strict, but it’s always there in the back of my mind. “If I skip this workout, it’s a ‘do not’.” That sort of thing. The rule doesn’t have to be concrete. You know when you’ve slacked off for a day.

Similar systems have worked for me in the past, like the 52 Day Challenge setup. But I’ve found that level of detail hard to keep up for extended periods of time. Especially once you incorporate more than just diet or workouts. It becomes an overly complicated set of spreadsheets to track every piece of data.

I’ll probably have a page here at some point that tracks do/do not’s for the world to see. It’ll be more embarrassing if I let myself slack for a year again.