It’s Over

Published at 23:42 on 17 October 2023

They wanted me to agree to another unrealistic “Performance Improvement Plan.” Given that it was unrealistic, it would have been dishonest to agree to it. The main issue is a fundamental mismatch between what they need and what my skills are. So I am on my way out.

Probably the Textbook Example of Why Java Sucks

Published at 00:22 on 14 October 2023

Probably the textbook example of why Java sucks is the Log4Shell Bug in the log4j library.

It’s just a library and not part of the core Java language, but the core Java language really isn’t the problem. The problem is the dysfunctional culture that surrounds the language.

So the stock logging is both bloated and yet surprisingly limited in functionality, because that is the sort of code the Java community tends to produce. That creates the need for an expanded logging system. Since it fills a void, everyone uses it.

Since the community does not appreciate simplicity, what the hey, let’s stick a general-purpose templating language into the thing. The same community wrote that general-purpose templating language, so what the hey, let’s stick a shell escape with command-output substitution into the templating language. Both the general-purpose templating and the shell-escape feature of the templating are of course enabled by default, because what the hey, why not?

And suddenly, we have a logging library with a shell escape in it.

Just how bad this all is, is underscored by how it sat unnoticed for eight years before it started being exploited. That’s right, so few people actually used all this creeping feature-ism that it took nearly a decade for the vulnerability in it to be discovered!

Look, logging and templating are two different domains. Templating and launching commands in a subprocess are two different domains. A logging package has no business containing templating beyond approximately the String.format level. A templating package has no business containing general-purpose subprocess creation.

If you really have a need to generate a super-long, super-complex log message, long enough and complex enough to require a general-purpose templating system, you should probably rethink what you are doing. Log messages should be relatively short. Now, maybe your case is 1-in-1,000 to 1-in-1,000,000 special and there really is a good excuse for a long message. Maybe. Fine. Do it by hand. Pull in a templating library, use it to generate that message, and feed it to the logger. Don’t bloat up and complicate the code base for everyone else just because of your 1-in-1,000 (or more) special case.

Likewise, if you really need to substitute in the output from a system command into your template, use the subprocess-creation features of Java to run the command, collect its output, and feed it into the template. Again, a 1-in-1,000 (or more) special case, no need to clutter up the code base.

In short, it’s potentially dangerous. Make the programmer work a bit in order to do it. Not a whole lot (libraries should and do exist to make it easier), but a bit. Enough to get the programmer hopefully thinking about the consequences of the feature. Don’t just stick it in by default.

But who am I kidding? This is the Java community we are talking about. Too much can never be enough!

There Is a Reason… and It Is Not Antisemitism

Published at 07:21 on 10 October 2023

The criticism of Israel that Sharansky is worrying about is probably coming, there is a good reason for this, and for the most part it is not antisemitism.

It is very similar to the situation between Ukraine and Russia in many respects. When Putin sent troops into Ukraine, he started a war, and now he has one. Attacks against Russia by Ukraine are seen in this context. If Putin wants the war to end, he can order his troops out of Ukraine.

The situation between Hamas and Israel is quite similar. There is very little criticism of Israel’s right to forcibly apprehend or remove the invaders from its territory and re-secure its internationally recognized border. The issue is what happens after that mission is accomplished.

One difference is that in this case, the invaded is significantly more militarily powerful than the invader. Nobody with even half a brain doubts Israel’s ability to accomplish the above. In fact, it has already in large part been accomplished.

Then what? As I opined yesterday, an Israeli occupation of Gaza seems all but inevitable. That is when the real problems will begin for Israel when it comes to international public relations. As they should.

Ukraine has been warned by the West, multiple times, not to turn this into an excuse for occupying Russian territory. It is not antisemitism for the same standard to be applied to Israel.

And No, I Don’t Want False Equivalence

Published at 17:50 on 9 October 2023

It has already been documented by reliable sources that Hamas gunned down unarmed civilians at a music festival, and it appears they might have lit houses on fire at Kibbutz Be’eri, shooting those who escaped. That, and rounding up people kidnapping them en masse are things right out of the Holocaust. Israel’s war crimes — while not justifiable — tend to be more indirect, such as taking risks with Palestinian civilian lives. Directly and deliberately targeting civilians is worse.

Tables Turned: Hamas Invades Israel

Published at 16:58 on 9 October 2023

It’s not that unusual for Israel to invade Gaza. This weekend, when I was away from the Internet, Hamas invaded Israel.

Because that’s what it was: an invasion. That is what it is called when one side’s military forces enter another side’s territory and takes land by force.

The more interesting question is who put Hamas up to it.

Because someone basically had to. The invasion makes no sense from a realpolitik angle.

You’re Palestinian, you want your homeland back. Is it really a practical strategy to try and get it back by invading and occupying Israel, who possesses what is indisputably the most powerful military in the region? Provoke a fighting war with Israel and Hamas loses. There really is no other realistic outcome.

Someone put Hamas up to it, by playing on their hatred for Israel.

That someone does not have the Palestinian (or even the Hamas) best interest at heart, because as I said earlier, the only realistic outcome one can anticipate is that Hamas will lose.

And when Hamas loses, it will be particularly humiliating for the Palestinian side. More than likely, Israel will respond by invading and (re-)occupying Gaza. Because, unlike Hamas, Israel actually has enough military power to occupy and hold enemy territory indefinitely, this occupation will last indefinitely. This is no doubt what the Netanyahu meant when he said the Hamas attack would “change the Middle East.”

So given how badly this is all set to backfire for Hamas, who could have put Hamas up to it, and why did they do it?

The Odds of a Prolonged Shutdown Just Went Way Up

Published at 19:58 on 3 October 2023

McCarthy compromised to avoid a shutdown, and just was punished for it by being the first Speaker of the House in history to get fired. This makes it highly unlikely that whomever his replacement is will be interested in following in his footsteps.

The Republicans could have avoided this fate if they showed continued interest in compromising and cutting deals. The Democrats actually made some overtures in this direction, but McCarthy chose to snub them. So here we are.

Historically, these sort of antics have not turned out well for Republicans. If the Democrats are at least halfway savvy (not a given, sadly), they will now be preparing a messaging campaign painting the other party as irresponsible and incapable of governing.

Also expect a prolonged process for selecting a new permanent speaker. It took McCarthy fifteen votes to secure his speakership in this Congress. There is no reason to believe that his successor will have a significantly easier job of it.

Camper Van Conversion Kits Suck, Here’s Why

Published at 21:33 on 23 September 2023

I mean, one of the chief advantages of having any RV, even a tiny one, even a simple one, is that it shields you from the weather better than tent camping, thereby extending the camping season.

So kits like this one and this one are just plain stupid. Notice the kitchens. They slide out of the rear. You cook outdoors. Again, the whole purpose of an RV is that it should shield you from having to cook outdoors. Suppose the weather dawns rainy and windy and you just want that cup of hot coffee or tea. With an RV, that should be no problem, turn on the stove, and heat it up. No struggling to cook in the rain.

Yet you can’t do that with these RV’s. You get to cook outdoors in the rain and wind, just as if you were tent camping. Yes, I see that tail gate lifted up. Such gates do not provide very good protection from the rain. Anyone who has tried to use them as such when camping can attest to how they let water drip into the interior when left up. They are intended for briefly sheltering from the rain while loading and unloading, when a few stray drops are no big deal. That’s it.

But why, I wondered. Why do they have such stupid kitchens, when Westfalia showed the world long ago that intelligently-designed interior kitchens can fit just fine in a smaller van.

I think I figured it out:

  1. Making life easier for DIY’ers.
  2. Liability.

Both are related to propane and fire. If you don’t want to rely on a big battery, an RV stove is a propane stove. Now you have to permanently install a cabinet, a propane tank, and route fuel lines. Nowhere near as easy as assembling some furniture and plopping it in.

Worse for the manufacturer, what if those DIY’ers you encouraged botch the job of running gas lines or installing the tank? The result could well be a fire or explosion. What if the stove was installed with improper clearance and setbacks? Fire. In both cases, lawsuit time.

You can’t legally call it an RV unless it ships with a sink, stove, and bed. So you can’t simply leave a kitchen out of something marketed as an RV conversion kit.

The solution to the problem is to have a place where the user can put a portable camp stove. Propane line installation headaches, gone. Propane line installation liabilities, gone. Portable stoves are not certified for interior use, so the design has to be an exterior kitchen that slides out, getting the stove away from interior spaces.

Problem solved! For the manufacturer, at least.

End result this that conversion kits inevitably have designs that seriously limit their functionality as RV’s. Probably a big part of the reason why there aren’t many sellers of such things. Really, the only practical options are paying someone to customize a van, or doing it totally oneself from scratch.

Caution Confirmed

Published at 07:16 on 11 September 2023

Today I learned that a friend has become addicted to cetirizine and is going through withdrawal sickness after suffering an interruption in supply.

Cetirizine is more commonly known as Zyrtec. Yes, the over-the-counter antihistamine. That’s right, an antihistamine, not an opiate.

As an allergy sufferer, I have occasionally taken antihistamines most of my life as needed. The key words here being occasionally and as needed. I was originally given them by my mother as a child. It was not that long after I started being administered them that I pushed back, questioning why I was always being given a dose of them every day. Couldn’t we stop and see how bad the symptoms are without medications today?

Mom thought I was being somewhat silly for being willing to risk feeling miserable like that, all over a little worry about ingesting medication with a doctor’s approval. I felt that why should I take any medication unless I am sure I need it. (It’s not as if my allergies were life-threatening or anything.)

Such has been my policy about antihistamine usage to this day. If my allergies are making me miserable, I will medicate, and do so without guilt. Then I will cut myself off medication, and see how I feel without. If I don’t feel abjectly miserable, I will put up with low-grade symptoms and carry on. If I do feel miserable, I will take another pill.

Many, like Mom, have thought it silly bordering on Puritanical for me to be willing impose suffering on myself like this. Today I feel vindicated.

Postscript

I have also run across those who try to make me feel guilty for being willing to turn to the products of the pharmaceutical industry at all. Try alternative treatments, they say. Well, I have. They don’t work as well (often, they don’t work, period).

When I query them, I find out that such individuals inevitably either don’t have allergies, or that their symptoms are vastly less serious than mine. As such, their opinions the matter are irrelevant.

Java Community Antipatterns, an Ongoing Series

Published at 17:27 on 1 September 2023

To give you an idea of the general pathetic hilarity of the situation, I was reviewing some code at work today. It reads in a message from Kafka, obtains a validator object, and calls that object’s isValid() method on the message it receives. That method in return a ValidationResult object, whose valid() method is then called inside an if statement.

This immediately strikes me as odd. When you validate something, it either turns out to be valid or invalid. That’s it. Two options, no more, no less. Yes/no. Black/white. On/off. There is no need to create a new data type to represent a validation result, because a perfectly appropriate data type already exists, built in to Java: the Boolean. Just use that. Far simpler and cleaner.

Maybe the ValidationResult object does something special and has extended features beyond those of a Boolean? Yes, it has a message field! But wait, that field is never accessed. The only thing that is ever done with that object is to call the valid() method, whose purpose is to return the Boolean value that should have been used in the first place.

And what of the validator object? Its class definition is very simple, just one short method that makes some basic checks. If its argument turns out to be invalid, the message part of the result is set to the string “Data is not valid.” No, I am not making this up. Of course the data is not valid, you moron! That is why the valid flag is set to false! This field conveys exactly zero meaningful information.

What other code uses this validating logic? None of it, it turns out! So there was no need for the validator class, either. Could have just added a private isValid() method inside the one (short) source file where this logic is used. Would have been a whole lot clearer, because the person reading the code wouldn’t have had to open another file to determine just what the validation logic is.

So three classes, and three source files, are being used where just one would have sufficed.

Now, this was a particularly egregious example, but this sort of crap-ola happens over and over (and over) again in Java code. Needless complexity everywhere.