Shit you just learned (probably from the internet.)

I so hope there is truth in this

2 Likes

I’ve just found a Stringoolean in some Java code.

String blah = "";

[loop thing]
    if (blah.equals("")) {
       doSomething();
    } else {
       somethingDifferent();
    }
    blah = "1";
[end loop]

:crazy_face:

Sorry non-developers, you won’t get this.

1 Like

I don’t get this.

3 Likes

Excellent :+1:

1 Like

I don’t get this, and am currently Developing quite the turtle’s head.

A ā€œstringā€ (a series of characters) is being used as a true / false flag.

There is already a concept meant explicitly for the true/false notion. It’s called a ā€œbooleanā€.

Using as String for this purpose is as inappropriate as using Excel to track cases of a global pandemic. There are tools intended for this sort of thing, and Excel isn’t one of them.

1 Like

Ahh!..

Still don’t get it.

4 Likes

2 Likes

It’s worse for me, I don’t get it, but there was a time when I did get it, and even got paid to do it, but now I don’t and brane won’t, and if I squeeze too hard some poo will come out.

1 Like

I suspect that the above snippet was brought to you by the same person who was using a map where the same datum was used as both key and value. This concept is more commonly known as a set.

The more troubling thing is where this code is (hint: it’s not in a dev environment) and what it’s doing.

1 Like

Have you stumbled across Cummings’ root code? In Java with no garbage collection, naturally?

That would be
10 GOTO BARNARDCASTLE

5 Likes

please, even my students dont do this…

1 Like

:smirk:

:grinning:

6 Likes

What really happens when you drink Buckie …

3 Likes

FFS, it’s only 15% alcohol. I wouldn’t even be drunk.

1 Like