Trolley Problem: Your beloved versus school children.

Situation a

On track one is a broken down school bus filled with children. The doors of the bus are stuck and as a result the children cannot be evacuated in time.

On track two is a broken down car. Your beloved is driving the car. The doors are stuck so your beloved cannot get out of the car in time.

A trolley is rapidly approaching a fork in the track. You are standing near a lever that can cause the trolley to switch tracks.

If you do not pull the lever, the trolley will go down track one and the school children will all be killed. If you do pull the lever the trolley will go down track two and your beloved will die.

Will you pull the lever?

Situation b

Situation a with one addition. The parents of several of the school children are watching you.

Will you pull the lever?

Situation c

Situation b with one addition. One of the parents has a gun to your head. If you do not pull the lever you will be shot in the head and you will die.

Will you pull the lever?

Why a great deal of technical documentation on the internet is useless.

I am reading the Configuration providers in .NET page in order to learn how to load application settings from a JSON file in .NET 6. This page is a perfect example of why a great deal of technical documentation on the internet is useless.

The JSON configuration provider section of this page attempts to explain how to load load application settings from a JSON file using the JsonConfigurationProvider Class.

The following code block comes from that section.

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using ConsoleJson.Example;

// PROBLEM 1
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);

builder.Configuration.Sources.Clear();

IHostEnvironment env = builder.Environment;

builder.Configuration
    .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
    .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true, true);

TransientFaultHandlingOptions options = new();
builder.Configuration.GetSection(nameof(TransientFaultHandlingOptions))
    .Bind(options);

Console.WriteLine($"TransientFaultHandlingOptions.Enabled={options.Enabled}");
Console.WriteLine($"TransientFaultHandlingOptions.AutoRetryDelay={options.AutoRetryDelay}");

using IHost host = builder.Build();

// PROBLEM 2
// Application code should start here.

// PROBLEM 3
await host.RunAsync();

Note: In the above code block I added PROBLEM comments that I reference below.

Problem 1

The line that follows this comment uses the args variable, however the args variable is not declared prior to use., In order to find out what this variable is you have to open the Host.CreateApplicationBuilder Method page and go to the CreateApplicationBuilder(String[]) section. There you will learn that the args variable should be set to “The command line arguments”.

This should never happen! Your readers should never need to go to another page on your website to find out what a variable is.

Problem 2

What does “Application code should start here” mean? If this was the very last line of code in the code block it would be easy to interpret this example. It would mean place all code above this comment at the very beginning of you entry function.

The problem is that comment is not the very last line of the code block.

Problem 3

There is another line of code after the “Application code should start here” comment. What is the purpose of this line of code? Is it clean up code? Or was the afore mentioned “Application code should start here” comment misplaced. Should this extra line of code be placed above that comment?

Conclusion

Because of Problem 2 and Problem 3 I have no idea how to modify an application to load application settings from a JSON file in .NET 6 after reading this page.

A complete working application would solve these problems!

A much better resource is the Basic example section of the Configuration in .NET page. After reading this, I was able to complete my current task.

The large intestine must be a very frightening place.

I am sharing the following without context beyond saying that thus far I have had a bad morning, although I think the worst is over.

Person 1: The large intestine must be a very frightening place.
Person 2: Why do you say that?
Person 1: Because I have noticed that occasionally shit comes flying out of the anus like a bat out of hell.
Person 2: That is just diarrhea. … Of course it could also be food poisoning.
Person 1: That sounds frightening.
Person 2: It is. … You know what, you are absolutely correct. The large intestine can be a very frightening place.

BTW: I am certain that it is not food poisoning so do not worry about me.

On providing information without being an asshole.

What is wrong with the following quote found in the article How to set up the debugger for Chrome extension in Visual Studio Code?

Here’s a sample attach configuration.

Note: If you do not set the “url” option, a list will be prompted with your open tabs.

This extension have a lot of very useful options that you can use to adapt the configurations to your project. You can read the documentation of some of them here.

First, there is no link in the the first sentence. Second, that sentence is the only sentence in the entire paragraph. By the time the reader gets to the end of this paragraph without seeing the promised information they are pissed off and perhaps even screaming in rage.

Then the next paragraph is a seemingly unrelated note. When the reader sees this they are convinced that you are an asshole and a liar because you are never going to provide the information you promised.

Then in the following paragraph you seemingly change subjects and start talking about an extension. Yes, the very last word in this paragraph is a link that in fact leads to the information you promised in the first sentence but by the time the reader sees that link it is very likely too late. The best case scenario is a pissed off reader who is hoping to find the information you promised from another source. The worst case scenario is a pissed off reader plotting your untimely demise.

Do not do this. If you promise to provide a piece of information do it before the end of the paragraph, if not before the end of the sentence, in which you made the promise.

Incompetence at Microsoft

Whoever does user interface design at Microsoft is an incompetent ignorant imbecile.

When an application freezes and you attempt to close the frozen application a dialog box is displayed that asks if the user wants to close the application or wait for it to start responding again. Then after the user confirms that they wish to close the application another dialog box is displayed saying it is sending information to Microsoft and asking the user to wait. The send information to Microsoft dialog box always freezes.

So, let us review what is happening here.

  1. The user is experiencing an application freeze.
  2. The user just forced the frozen application to close so they can restart it and continue with their work. It is very likely they have lost work as a result.
  3. Microsoft adds insult to injury by deliberately causing another application freeze just so that they can be notified about the previous application freeze.

Are you fucking insane? You not do that you fucking assholes!

Worst job

What is the worst job imaginable? What characteristics make a job worse than any others? Are boring meaningless jobs worse than jobs that result in you being covered in filth all the time? If a dirty job provides an essential service does that make it better than a boring meaningless job that does not require you to cope with physical discomfort?

Is there any job in existence that is worse than Redundant Peon at the Redundant Department of Redundancy?

Inquiring minds want to know.

Regnad

There is a fork in the path ahead of you. There are also two signs, telling you where each fork goes. The sign for the right fork reads “Regnad.” The sign for the left fork reads “Shortcut to Regnad.” What should you do? Inquiring minds want to know.

Being a high ranking general must be difficult.

Being a high ranking general must be difficult. One problem you may run into is that you must choose your words very carefully. Otherwise the following might happen…

General: Hands assistant cold food that needs to be reheated. “Nuke this for me.”
Assistant: “What yield of atomic bomb should I use, sir?”
General: “What are you talking about?”
Assistant: “You asked me to nuke this. I need to know what yield of atomic bomb to use.”
General: “You asshole. Nuke is slang for microwave. I want you to heat that up in the microwave for me.”
Assistant: “Sorry sir. What settings should I use?”
General: “Microwave it on high for 1 minute.”
Soldier: Very well sir!

Being a high ranking general must be difficult.

Being a high ranking general must be difficult. One problem you may run into is that you must choose your words very carefully. Otherwise the following might happen…

General: “Nuke it from orbit. It’s the only way to be sure”. Stops paying attention and as a result does not hear the soldier reply.
Soldier: “Very well sir!”

Some time goes by. There is an atomic bomb detonation at the target that was being discussed earlier.

General, shouting at Soldier: “You asshole. It was just a famous quote from a famous movie. It was not an order.”

Hopefully there are many safeguards in place to keep this from happening in all militaries that actually have access to atomic bombs. If not, may god have mercy on us all.

On Idiot Proofing and Future Proofing

You can attempt to idiot proof something by guarding against mistakes typically made by the idiots of today.

You can attempt to future proof something by guarding against foreseeable mistakes that might be made by reasonable people at some point in the future.

However, you cannot future idiot proof anything. Idiots keep getting more idiotic. There is no way to predict what mistakes the idiots of tomorrow might make.