I so hope there is truth in this
Iāve just found a Stringoolean in some Java code.
String blah = "";
[loop thing]
if (blah.equals("")) {
doSomething();
} else {
somethingDifferent();
}
blah = "1";
[end loop]
Sorry non-developers, you wonāt get this.
I donāt get this.
Excellent
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.
Ahh!..
Still donāt get it.
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.
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.
Have you stumbled across Cummingsā root code? In Java with no garbage collection, naturally?
That would be
10 GOTO BARNARDCASTLE
please, even my students dont do thisā¦
FFS, itās only 15% alcohol. I wouldnāt even be drunk.