log (2003/11/14 to 2003/11/20>

older log
newer log

reply
about
archive
search

home
words
site news
talking place
linkwatcher
XML (RSS)


Now playing:
Thursday, November 20, 2003  permanent URL for this entry

So I'm going to be all code-geeky this evening, and complain about a particular feature of a particular programming language. (This particular feature caused a rather embarassing, if minor, malfunction during an informal demo to some colleagues today, so I'm mad at it.)

(Apologies to my readers with, like, lives.)

Say, in a Java program, you have some object foo with a bar() method, and the method throws ThingException, and you have some code that uses it, as in:

public void updateThing(Thing t) {
  ...
  foo.bar(t,primaryThingClient);
  ...
}

Now the compiler will very nicely remind you here (by refusing to compile this) that the bar method of foo throws ThingException, and so you have to either catch the exception yourself, or admit that you'll be passing it up.

Say in this case it's okay (or even required) for updateThing to throw a ThingException if that call to foo.bar() does; so you do

public void updateThing(Thing t) throws ThingException {
  ...
  foo.bar(t,primaryThingClient);
  ...
}

and now it compiles and everything is happy.

But then say later you come along and add some more code to this routine, as in say

public void updateThing(Thing t) throws ThingException {
  ...
  foo.bar(t,primaryThingClient);
  ...
  foo.bar(t,secondaryListener);
  ...
}

Now in this case the compiler will not remind you nicely that that second foo.bar() might throw a ThingException; once our method is declared as throwing it, every line of the method gets a free pass.

If it happens that excepting out of the method in that second call would be a bad thing (because, say, the bits of code represented by the first two sets of dots would get run, but not the third), you're on your own as far as the compiler is concerned.

What I want, I think, is some sort of "no implicit exception throwing" switch on the compiler, that would refuse to compile any of the above, and would only compile, say:

public void updateThing(Thing t) throws ThingException {
  ...
  try {
    foo.bar(t,primaryThingClient);
  } catch (ThingException e} {
    throw e;
  }
  ...
}

and then if you gave it:

public void updateThing(Thing t) throws ThingException {
  ...
  try {
    foo.bar(t,primaryThingClient);
  } catch (ThingException e} {
    throw e;
  }
  ...
  foo.bar(t,secondaryListener);
  ...
}

It would again refuse to compile, forcing you (me) to catch the ThingException from the second bar() call, and either explicitly re-throw it myself or deal with it in the method.

Can I have that compiler switch, please? I can't think of any programming pattern that avoids this class of oops otherwise (except extremes like "no method you write should ever thrown an exception", which isn't actually all that bad an idea but you can't really always do).

True Java geeks are invited to leap all over me and show how if I were a proper programmer using all the accepted modern idioms, this would never even come up...


Wednesday, November 19, 2003  permanent URL for this entry

So after nobly resolving not to wade back into the MeFi thread on Metababy yesterday morning, I almost immediately did, with one more comment attempting to divert attention away from what an idiot I am, and toward the actual subject at hand. I had resisted looking for responses until just now, and now I see that (probably entirely by coincidence) there are a handful of posts from people who spent some time on the latest mb incarnation and seem to have enjoyed it.

And in the meantime I'm also trying to resist looking at Metababy for awhile.

From somewhere on metababy (I'm not resisting all that well), via a Google search, to a notable page on crank dot net, and thence to this fascinating revisionist history of history, and relatedly to this commentary on (another?) alternate history.

(I don't think these are the anti-Semitic holocaust denier sort of revisionist; they just think things like "there was never an ancient Rome" or "the history of England is really the history of Byzantium" or similar nifty stuff.)

Crackpots "R" fun.

- 2 for "enjoy porn"
- 2 for "helen naked pictures"
- 2 for "hurry on down"
- 2 for "naked helen pictures"
- 1 for "a new sport by 2050"
- 1 for "enjoy porn and i vote"
- 1 for "ftrain"
- 1 for "iris chacon"
- 1 for "john wain"

Apropos ("apropos") of my being all worried about the reaction to Roy Moore's oustage ("oustage") the other day, I'm now all worried about the reaction to the recent lovely and sane decision on same-sex marriage in Masse Massach Massechoo Boston:

President Bush waded into the debate with a statement criticizing the ruling.

"Marriage is a sacred institution between two people of the same race," he said. "Today's decision ... violates this important principle. I will work with congressional leaders and others to do what is legally necessary to defend the sanctity of marriage."

Something like that, anyway.

Listening to all the sanctimonious piffle being spouted by other opponents of the decision (including the governor of (um) that state), I am just reminded again how deeply alien so many people are, and how important it is to avoid waking them up before we have the world more or less secured for goodness and sanity.

What do you say? A couple of readers simultaneously gladden and sadden me:

Write the novel, dood.

I hope you do decide to write. It'll be lonely in here without you.

I've pretty much firmly decided not to write it now. I hope the second reader there isn't lonely (if you're another writer, NaNoWriMo is anything but a lonely place; if you're say one of my characters, I'm sure we can work something out).

bah; you're making me seem all laZy (problem with lower Z in FeedReader) for not having done anything useful :-( Curse you

Don't worry, I haven't done anything useful either. *8)

My dad used to say that. I never knew how to respond.

I say that to my kids; generally they don't know how to respond either. My readers, on the other hand, always know just what to say!

I say....but wait. First I want to know what you say. Come on, out with it. Oh. I see you've written it all out in a sort of 'log' thing. OK. Well, in that case, I say...well, now I'm not sure.

hi

>> Your stomach needs to produce a new layer of mucus every two weeks or it would digest itself.

porn

a pox on both your houses!

[link]

......pumpkins

Medic! Medic! Stack down! Viral strike!

Gould > Dawkins

When I first had the World RPS Society pointed out to me, I was sure they were just kidding. Well, maybe they were. Back then.

We didn't do pumpkins this year; just some neon green spiderwebs on the front porch. The kids didn't even seem to notice the lack of Jack o' Lantern carving; I'll probably try to revive the tradition next year, though, if things are a little less madly busy end of October. Ritual is important.

What do you say?

He turns to me and says
Manuscripts don't burn
bits on the wire
will flow

Indeed.


Tuesday, November 18, 2003  permanent URL for this entry

Metababy is back again! My spies (thanks, spies) first reported this to me on Thursday; I don't know when it actually reappeared. Things were relatively quiet over the weekend, then on Sunday Metafilter noticed it, and around the same time it escalated into the usual flurry of porn and excrement and cussing and bottoms and deletion wars.

The MeFi thread was all full of people saying "ewwww" and "excuse me while I go pour bleach on my eyeballs" (a great line), and "don't waste your time". Now that's certainly one legitimate class of reactions to it, but I thought it was sad that no one was speaking up for it at all, so I chimed in saying that heck it's only images, and people should try to get past the Yuck factor and give it a second think.

This was a mistake; suggesting that it's "just images" only showed that I'm an insensitive lout incapable of feeling other people's pain. One posting "called bullshit" on my claim that images won't hurt you, saying that one image had made the poster "sad about the world for several days after I first saw it".

So three choices: to roll my eyes and get out of the thread entirely, to get really snarky in the thread (either openly or in kind), or to take a deep breath and try to continue the conversation rationally, replying to the "interesting difference of opinion" parts and ignoring the "passive-aggressive misinterpretation attack" parts. Fortunately I was composed enough to choose the first option.

I am once again reminded why, despite how attractive they sound in principle, I've never really gotten into Metafilter, or for that matter into most parts of Usenet. I'd rather hang out on Metababy.

Spam harvest:

Re: RMKEW, he must have
Re: FWMZ, at this inappropriate
Re: RR, this time there
Re: HW, but here something

(Which is, come to think of it, obviously about Metababy.)

And a whole nother message from the aether:

Subject: Hey mountainside crayon
Subject: Coming up with new ideas is hard

And that's the way it is.


top

earlier entries