Saturday, January 31, 2026

The irony of using "Hiroshima bomb" as a unit of measurement

People love to use informal "units of measurement" to describe the magnitude of things, like "football fields", "Mount Everest" (both for height and volume) and, of course, perhaps the most famous of them all, "Hiroshima bombs".

That pseudo-unit of measurement has become so ubiquitous and so normalized that some even just call it "Hiroshimas" (eg. in YouTube videos), even though that makes no sense.

There's a huge irony in using that bomb as a unit of measurement, though.

And what's that irony? Well, all these informal units are used to give people a good mental picture of the size of something. When you say that the area of something is "ten football fields", that gives a decent mental picture because most people have an understanding of how large a football field is. If you say "two olympic swimming pools (in volume)", most people have at least a ballpark mental picture of how large that is.

But what exactly is the mental picture of the energetic power of the bomb dropped on Hiroshima?

The vast, vast majority of people have absolutely no idea. How big of an explosion was it? How much destruction did it cause? What was the blast radius? How far from the point of detonation did it cause significant damage to buildings?

The fact is that the vast, vast majority of people have absolutely no idea! Ask anybody any of those questions, and they will not know (some of them might throw wild guesses, but they will be just that, wild guesses and nothing more.)

That's because we don't have everyday experience with it, nor even have seen pretty much anything about it. There are some photos of the mushroom cloud (from which you can't even really see how large it is because there's no point of comparison), and stories about the destruction, but that's it. It's all extremely vague. 

So, quite ironically, this informal pseudo-unit of measurement, designed to give people a mental picture of the magnitude of something, is an extremely poor example of doing that. Even if you say "ten Hiroshima bombs" people will still have absolutely no idea how much that is. (Many people might get the impression that they do, but that's just an illusion. They actually don't, because they have no knowledge whatsoever about that magnitude, at any level. And usually they realize if they really start thinking about it.) 

That's quite different from something like "football field", where most people actually have some good mental picture of how large it is. 

Thursday, January 22, 2026

The biggest mistake in Star Wars: Episode 1

When it comes to the prequel trilogy as a whole, the most fundamental problem was bad script writing by George Lucas and, most particularly, the fact that he completely missed the mark on the most important core plot of the entire trilogy. In other words, completely botching showing in a good and believable manner why and how Anakin switched to the dark side.

However, if we examine just the first movie, there are literally dozens of huge flaws in it that could have been done much, much better. However, by far the biggest mistake made in the movie, something that pretty much anybody would agree with, was killing off Darth Maul.

Ask pretty much anybody, and they will agree: By far and large, by a country mile, the most awesome, coolest and best element of the first movie was Darth Maul.


He is exactly what a believable threatening villain should be. He not only looks cool and menacing, but he doesn't speak, he doesn't banter, he doesn't taunt, he doesn't hesitate, he doesn't play with his enemies. Instead, he is efficient to the extreme, going for the kill as fast as possible, with extreme skill and precision.

His fight against the two Jedi is pretty much universally agreed to be the best laser saber fight in all of Star Wars. Not just the prequel trilogy, but all of it, every movie, every made-for-TV movie, every series.

He is so skilled and so dangerous that he single-handedly succeeded in defeating and killing one of the most powerful Jedi that existed in the lore, ie. Qui-Gon Jinn.

Then, after that feat, he is just ignominiously defeated by a padawan. It's no exaggeration that this was universally considered a complete disappointment.


What Lucas should have done is keep the fight exactly as it was (it's pretty much perfect), and after Maul killed Qui-Gon he has his short fight with Obi-Wan, who falls into the chute just like happens in the movie, but he doesn't come back up, he just falls all the way, Darth Maul looks him fall, and then walks away, as he has important things to do. (It would be a bit later in the movie shown that Obi-Wan survives the fall.)

This way Darth Maul could have returned in the second movie, and have a second fight with Obi-Wan, who would then have the opportunity to avenge his master's death properly. 

Tuesday, January 20, 2026

The main problem with the Star Wars prequel trilogy

When the Star Wars prequel trilogy (ie. episodes 1 to 3) were announced, it caused an absolutely massive amount of hype because it had been 16 years since the last mainline Star Wars movie, and fans were absolutely excited. The theatrical release of the first movie in the trilogy broke world records in the amount of people lining up to movie theaters and, especially, in the amount of time they did so: Indeed, at many places people were camping in line for literally weeks in advance. (Lining up for the premiere of a hyped movie for an unreasonable amount of time was not unheard of, but this broke all previous records by a landslide.)

Then the first movie came out and... to say that it caused mixed feelings is understating it. For many fans the absolutely massive hype did carry on for quite a while and they were still excited about the movie for months to come... but even they started to experience a bit of doubt once the hype had passed and they could analyze the movie in a more level-headed manner, particularly after re-watching it a couple of times more.

Some fans were somewhat disappointed from the get-go, others became a bit disappointed in retrospect after the initial hype had passed, but most of them were still defending the movie and hoping and expecting that the next two movies in the trilogy would make up for the disappointment and be awesome. Sure, a few fans were still saying that the movie was a masterpiece, but they were in somewhat of a minority.

Then the second movie came out, a lot of people once again lined up for the premiere (although in somewhat lesser numbers and less time than for the first one) and the hype was really high once again, and after seeing the movie... once again mixed feelings. Some loved it, some were a bit disappointed, although most of them couldn't really put their finger on why exactly.

For most fans hope was still not lost: Surely the third movie, the "finale", would redeem the entire trilogy, and save it from disgrace? Yet, the exact same story repeated a third time: Long queues (but not as long as for the first movie), a lot of hype and excitement, lots of mixed feelings after seeing the movie.

The entire trilogy got a huge amount of backlash and criticism starting from the very first one, and even the most avid fans couldn't defend it very strongly. Some fans were still clinging to it and saying that it was a good trilogy and they liked it, but the general consensus, even among avid fans, was that it was "ok but a bit of a disappointment." Very mixed feelings. Among less-of-an-avid-fan viewers the general sentiment was a lot more negative, and many outright hated the entire trilogy, and particularly the first movie.

There is an enormous amount of criticism, even very rational and reasonable criticism, that can be given for the trilogy, but almost all of it can be summarized by one single thing: George Lucas is a bad writer.

That might sound like sacrilege, but that was indeed the crux of the problem. He wrote bad scripts for all three movies. He should have really left the scripts to better writers and concentrated only on producing and directing the trilogy. He could have delineated the stories, but the details should have been left to world-class scriptwriters.

Anyway, that's not the "main problem" I'm not referring to in the title of this post. Of course it stems from the bad writing, but from all the problems in the script (and the movies in general), what is the one that could be considered the most fundamental?

Well, what is the core idea of the prequel trilogy? What is it about?

The prequel trilogy is the origin story of Darth Vader. That's what.

This is not just speculation or reading between the lines: It's directly the official canon. And, rather obviously, it can be seen in the movies: The main running plot and idea is how Anakin Skywalker became a Jedi knight and then joined the Sith, becoming Darth Vader. We follow his story from childhood, when he was first discovered by the Jedi Order, all the way up to him becoming Darth Vader at the end.

And the main and most fundamental problem with the entire trilogy is: This background story and particularly his turn to the dark side and joining the Sith is extremely badly written.

For starters, the total running time of the entire trilogy is about 8 hours. I have not gone through the trouble of accurately counting how much of those 8 hours is dedicated to showing Anakin's slow transformation and reasoning for his turning, but I would estimate that, at the very most, about 15 minutes is dedicated to it.

That's astonishingly little time dedicated to the very core plot and idea of the trilogy.

And, indeed, when you watch the trilogy for the first time, even knowing that this is the core idea, his turning to the dark side and joining the Sith comes a bit out of the blue, without much explanation, without much reason. There's extremely little in the trilogy that explains what happened and why he did it, how his thinking changed and what lured him. There are a few scattered scenes here and there, but they are very short and not very telling, and most of them are very simplistic, even childish.

This is the main problem with Lucas' bad writing: He spent way, way too little time showing Anakin's psychological transformation, and even the little that he did show was badly written, making his turning feel like unjustified, unexplained and random. It almost feels like Lucas himself couldn't figure out why Anakin turned to the dark side, or couldn't figure out how to explain it, and he struggled to insert at least a few scenes trying to show something about it. 

Tuesday, December 23, 2025

I don't understand why Ramanujan summation is taken seriously

One of the most (in)famous "proofs" that the sum of all natural numbers is -1/12 uses as one of its steps a so-called Ramanujan summation to declare that the the infinite sum

1 - 1 + 1 - 1 + 1 - 1 + ... = 1/2

I don't see anything that would justify this equality. The infinite sum is divergent, ie. it does not converge to any particular value no matter how far you advance in it. There is no justification to assigning the arbitrary value 1/2 to it. (There is no justification to just declare that the result of the entire sum is the average of two consecutive partial results. There's even less justification for it because what you get as partial results depends on how you group the terms.)

How this kind of thing should normally be handled is like this:

1) Hypothesis: The infinite sum 1 - 1 + 1 - 1 + ... = 1/2

2) Counter-proof: We assume that the hypothesis is true and show that it leads to a contradiction. Namely: The assumption leads to the contradictory statement that the sum of all natural numbers, which is divergent, is a particular finite value, which would imply the sum would be convergent. An infinite sum cannot be both divergent and convergent at the same time, thus it's a mathematical contradiction.

3) Thus: The hypothesis cannot be true.

In general, whenever a statement leads to a contradiction, it proves that the statement is false. In this case, we have proven by contradiction the Ramanujan summation as incorrect.

But rather than declaring said summation as incorrect (because it leads to a contradictory result), instead mathematicians have taken it as correct and subsequently also the nonsensical statement that results from it.

It's incomprehensible. 

Saturday, December 20, 2025

Quake speedruns slightly marred for me

Some time ago I wrote a blog post about why I don't really watch speedruns anymore, even though I used to be a huge and avid fan 20 years ago. The (quite long) article can be found here. The short summary is: While 20 years ago I didn't mind and in fact was fascinated by extensive glitch abuse, over the years I have grown tired of it and consider it so boring that I don't even watch glitch-heavy speedruns anymore. And, unfortunately, nowadays "glitch-heavy speedruns" covers about 90% of them, if not even more.

I mention in that post that Quake is one of the few games I still watch speedruns of, and the main reason is that, due to how glitch-free the game is, the speedruns are also almost completely glitch-free, and thus show just pure within-the-game sheer awesome playing skill without much if any game-breaking glitches.

I also say this in that post, quote:

"One particularly bad example made me outright want to puke: In a speedrun of the game The Talos Principle, the runner at one point would go to the main menu, go to the game options, set the framerate limit to 30 frames per second, return to the game, perform a glitch (that could only be done with a low framerate), and afterwards go back to the options menu and set the framerate back to unlimited. This was so utterly far-removed from gameplay proper, and was just so utterly disgusting, that I just stopped watching the speedrun right then and there."

Well, you might guess where I'm going with this.

Indeed, framerate abuse has been introduced into Quake speedrunning. It's not an extremely recent addition, mind you (I believe it was started being used several years ago). It's just that I only have noticed now.

I probably did not notice because the framerate abuse is so subtle, as a key can be bound to change the framerate cap, and thus it can be changed on the fly without having to go into any menus, and it doesn't interrupt the speedrun. The only visible indication of this is that a message appears on the top left of the screen telling about the settings change, and it's very easy to miss when watching the speedrun. The framerate is also changed so rarely during speedruns that it's easy to miss for that reason as well.

The game supports capping the framerate in steps of 10, with the minimum being 10 fps, and the maximum 100 fps. And the framerate abuse swaps between those two framerates. 

Quite naturally, I don't really like the idea much better than with other games, like The Talos Principle mentioned above. Some details about it, however, make it slightly less bothering though, so it doesn't really make me want to quit watching Quake speedruns:

  1. As mentioned, it can be done on the fly rather than going to the settings menu to have to do it, so it doesn't interrupt the speedrun itself. Not that this would be the main reason to dislike the technique, but still.
  2. As far as I understand, the technique cannot (so far) be used for any major skips and instead it can only be used in two very specific situations: To press buttons slightly earlier, and to reach the end slightly earlier.
  3. And that "slightly earlier" really means it: At most 0.1 seconds can be saved this way for each button that has to be pressed and once at the end of the level (as a direct consequence of the framerate being 10 frames per second.) And even then, this is only when the button is right in front of the player (and is not eg. pressed from the side by barely glancing it.)

So in a typical level, where the speedrunner might have to press three buttons, about 0.4 seconds can be saved at most.

While I don't really like the technique in principle, it has so little effect on the speedruns that I consider this only an extremely minor annoyance. 

Tuesday, December 16, 2025

How an experienced programmer approaches Matt Parker's wordle problem

I have written earlier a blog post about an example of where program optimization actually really matters and can make an absolutely enormous difference in how much you have to wait for a program to do something (even though the notion that program optimization is not all that important is way too widespread). In that case it was a question of Matt Parker's original Python program taking an entire month to calculate something that could be (quite trivially) calculated in just a few seconds, even in under a second with a bit of algorithmic optimization.

I would like to describe here how an experienced programmer approaches such a problem.

Said problem is:

Given a big English dictionary file (ie. a file containing hundreds of thousands of unique English words), find all combinations of five 5-letter words that combined use 25 unique letters of the alphabet.

Any experienced programmer would very quickly think of ways to do that in a few seconds at most, and categorically know that one month is way, way too slow. This even if we restrict ourselves to using Python.

Matt Parker is not an experienced programmer, and his approach to solving the problem with a Python program was extraordinarily naive and inefficient. Essentially, he read the entire dictionary into some kind of data container, all the several hundreds of thousands of words, and then went through every single combination of 5 words and checked if they matched the conditions: In other words, all five words are 5 letters long, and all the 25 letters are unique.

That is, of course, an extremely inefficient way of doing it and, as it so happens, it can be sped up by several orders of magnitude with extremely simple optimizations. These optimizations might sound trivial to most programmers, and when said, but they might not come to the mind of a beginner programmer.

First: By far the biggest and also the simplest optimization (that Matt clearly didn't think of): We are only interested in 5-letter words. That means we can discard all the other words from the get-go. It's that simple. When reading the dictionary file, if a word doesn't have 5 letters, just discard it and don't add it to the data container.

That simple step reduces the number of words from several hundred thousands to just a few thousands. That speeds up the entire subsequent calculations by several orders of magnitude (more than two because we are talking about quadratic behavior).

Matt's biggest mistake was to take all the words in the dictionary file without discarding any of them. That, rather obviously, is completely unnecessary and extremely wasteful and inefficient. Just this optimization alone, even without anything else, would have probably reduced the runtime of his program from one month to just an hour or so, perhaps even less.

Second: We can actually discard even more words than that, further reducing the amount of data to process. In particular, if any word has a repeated letter, we can also discard it when reading the input, because such words would fail the conditions immediately and cannot be part of the answer. This will further reduce the amount of words probably to less than half of all 5-letter words in the dictionary.

This second optimization would have likely made Matt's program, even without any other changes, take just ten minutes, perhaps even less.

Third: This is where actual algorithmic knowledge and thinking is more required.

Matt's program went through every single possible combination of 5 words in the input. This is unnecessary and we can go through significantly less combinations than that, further reducing runtime by an order of magnitude or two, perhaps even more.

This algorithmic trick is very common and very well known when dealing with exactly this kind of problem. And the idea is: If two words share any letters, you don't need to check any combinations containing those two words (because, rather obviously, all of those combinations will fail.) Just this idea alone allows skipping the vast, vast majority of possible combinations, speeding up the program enormously.

While the idea and principle is quite simple, it might not be immediately obvious to the beginner programmer how to actually implement it in code (and many beginner and even not-so-beginner programmers will often succumb to really complicated and lengthy solutions to try to achieve this.) This is where programming and algorithmic expertise becomes very helpful, as the solution is much simpler than it might sound.

Explaining in great detail the simple algorithm to achieve this would require a bit of text, so I'll just summarize the general idea instead: Going through all the combinations of elements (words in this case) can be implemented as a recursive function which keeps track of which elements we are dealing with. The recursion can be stopped (and execution returned to the previous recursion level) when we detect two words with shared letters, thus skipping all the subsequent deeper recursions.

Fourth: Comparing words.

Here, too, Matt used a very naive approach, where he would take the original words and do an elaborated quadratic comparison of each of their letters.

The thing is: When doing comparison we don't need the letters of the words in their original order. That's unnecessary for this comparison because we only want to know if they share letters, and the order of the letters in the word doesn't matter. Thus, we can rearrange the letters in each word to be eg. alphabetically ordered in order to make the comparison simpler and faster. (The original word can be kept alongside the reordered one in order to print out the found words.)

But that's not even the most efficient way of doing it. Since no letters are repeated (as we have discarded all the words with repeated letters), can just create a small bitmap of each word, with each bit representing each letter of the alphabet. Since the English alphabet consists of 26 letters, a 32-bit integer more than suffices for this. Thus, we can "convert" each 5-letter word into an integer (which bits tells which letters are used in the word), and then we can use a bitwise "and" operator to compare two of them to see if they share any of the bits. In other words, rather than going through a string of letters, we are just comparing two integers with a bitwise-and operator. This is extraordinarily fast.

Even if we restricted ourselves to using Python, doing the four optimizations above would solve the problem in just a few seconds, perhaps even in less than a second. 

Sunday, December 14, 2025

Programmers are strangely dogmatic about cryptic variable names

As a very long-time computer programmer, I have noticed an interesting psychological phenomenon: For some reason beginner programmers absolutely love when they can express a lot of functionality with as little code as possible. They also tend to love mainstream programming languages that allow them to do so.

As an example, if they are learning C, and they encounter the fact that you can implement the functionality of strcpy() with a very short one-liner (directly with C code, without using any standard library function), a one-liner that's quite cryptic compared to how it's done in an average programming language, they just love that stuff and get enamored with it.

This love of brevity in programming quite quickly becomes a habit to the vast majority of programmers, and most of them never "unlearn" said habit. One of the most common and ubiquitous language feature where most programmers will apply this love of brevity is in variable names. (Oftentimes they will do the same with other names in the program as well, such as function and class names, but variable names are the most common target for this, even when they keep those other names relatively clear.)

It becomes an instinct that's actually hard to get rid of (and I'm speaking of personal experience): That strong instinct of using single-letter variables, abbreviations and acronyms, no matter how cryptic and unreadable they may be to the casual reader. (Indeed, their most common defense of those names is "I can understand them perfectly well", without acknowledging that it may not be so clear to others reading the code. Or even to they themselves five years along the line.)

Thus, they will use variable names like for example i instead if index, pn instead of player_name, ret instead of return_value, col instead of column (or even better, column_index), col instead of colorrc instead of reference_count, and so on and so forth. After all, why go through the trouble of writing "return_value" when you can just write "ret"? It's so much shorter and convenient!

But the thing is, the more the code is littered with cryptic short variable names, the harder it becomes to read and understand to someone reading (and trying to understand) the code. I have got an enormous amount of experience on that, as I have had in the past to write an absolutely humongous amount of unit tests for a huge existing library. The thing about writing unit tests for existing code is that you really, really need to understand what the code is doing in order to write meaningful unit tests for it (especially when you are aiming for 100% code coverage).

And, thus, I have seen a huge amount of code that I have had to fully understand (in order to write unit tests for), and I have seen in intricate detail the vast difference in readability and understandability between code that uses cryptic variable and function names vs. code that uses clear readable names. Unsurprisingly, the latter helps quite a lot.

In fact, this is not some kind of niche and novel concept. The coding guidelines of many huge companies, like Google, Microsoft, Facebook and so on, have sections delineating precisely this. In other words, they strongly recommend using full English words in variable and function names rather than abbreviations and cryptic acronyms. One common principle is, relating to the latter: "If the acronym does not have an article in Wikipedia, just write it fully out."

One particular situation where I have noticed how much clear variable naming helps is in loop variables. Loop variables are the one thing that most programmers abbreviate the most, and the most often. Sometimes they go to outright unhealthy lengths to use loop variables that are as short as possible, preferably single-letter, even if that means using meaningless cryptic names like i, j and k.

I have, myself, noticed the importance of, and gotten into the habit of, naming loop variables after their use, ie. what they represent and are being used for. For example, let's say you are iterating through an array of names using a loop, with the loop variable indexing said array. Thus, I will name said variable eg. name_index rather than just i (which is way too common.) If the loop variable is counting something, I will usually name it something_count, or similar, rather than just i or n.

The longer the body of the loop is, and especially if there are several nested loops, the more important it becomes to name the loop variables clearly. It helps immensely keep track of and understand the code when the loop variables are directly naming what they represent, especially alongside naming everything else clearly. For example, suppose you see this line of code:

pd[i].n = n[i];

That doesn't really tell us anything. Imagine, however, if we changed it to this:

player_data[player_index].name = names[player_index];

Is it longer? Sure. But is it also significantly clearer? Absolutely! Even without seeing any of the surrounding code we already get a very good idea of what's happening here, much unlike with the original version.

Yet, try to convince the average experienced programmer, who is used to litter his code with short cryptic variable names, of this. You will invariably fail. In fact, for some reason the majority of computer programmers are strangely dogmatic about it. They are, in fact, so dogmatic about it that if you were to make this argument in an online programming forum or discussion board, you will be likely starting a full on flamewar. They will treat it like you are a stupid arrogant person who has personally insulted them to the core. I'm not exaggerating.

The instinct to write short cryptic code, very much including the use of short cryptic variable names, sits very deep in the mind of the average programmer. It's a strange psychological phenomenon, really.

I have concocted a name for this kind of cryptic programming style: Brevity over clarity.