Overheard in the next cube
-
I overheard two developers talking in the next cubicle this morning.
Dev #1: So it's a logical value, right?
Dev #2: Yes, a boolean value.
Dev #1: Then it's true, false or unassigned.
Dev #2: Right.
The next sound was me slapping my forehead.
-
Maybe Java?
Dev #1: Then it's true, false or unassigned.
They could have been talking about the Java class Boolean. A Boolean instance can have three values: TRUE, FALSE and null. Very useful in artificial intelligence or other domains where trinary logic is a must.
-
@flicken said:
Dev #1: Then it's true, false or unassigned. They could have been talking about the Java class Boolean. A Boolean instance can have three values: TRUE, FALSE and null. Very useful in artificial intelligence or other domains where trinary logic is a must.
There is NO WAY in wich a Boolean value will have thre posibilities, because it's used strictly in two-value logic, I will agree with you and the guys in the other cubicle if they where talking about a logic value or even better a tri-state value. But I will also have to admit that I have no special problem with people that refers to tri-state values as boolean, I usually bypass that in order to continue the conversation, but... I also have to admit that I hate all of them when they write specifications in which they say that some variable will be true or false (and thus I assign it to boolean) and later I find out that it can be also null.
The key thing is that you are forgiving them for saying that is a bool while you say it correctly and cite the datatype as trinary logic. Let's keep boolean logic for bi-state logic and whatever name we want for more than 2 values logic.
-
Well that depends I think wether its a local variable or an instance variable. At least if my memory doesn't fail to serve me.
Local variables aren't initialized on declaration, but is unassigned a value?
-
Without knowing the language involved, it's hard to tell, but if the OP is doing a head-slap, then I'm thinking this isn't Java. In C or C++, a boolean is either true or false. It might be true because it wasn't initialized and is exporting bit junk (and it might also be false, but not as often), but it'll still be either true or false.
Debug builds might initialize it, even. (To false, I expect, because underneath it's probably an int.)
-
They could just have been working with SQL or other similar system where booleans can be NULL. This is not a WTF without more context.
-
@zamies said:
Well that depends I think wether its a local
variable or an instance variable. At least if my memory doesn't fail to
serve me.
Local variables aren't initialized on declaration, but is unassigned a value?
If it's a java.lang.Boolean, then like all reference variables, it's
initialized to null. If it's a boolean primitive, it's initialized to
false, and there is no "unassigned" state, only true and false.
This is for class and instance variables. If you don't initialize a
local variable before using it, the compiler will reject the code.
Another area where booleans have an "unassigned" state would be DBs.
-
Boolean is a construct in a language, in some cases it can be null, NULL, whatever.
Binary is the term used to describe a system in which there are only two values, which is what you were thinking of.
-
That boolena could have been a C++ BOOL. At least in windows that is usually typedefed as an int. That BOOL can have the values TRUE (1), FALSE (0) or any other value which is unassigned (even though it evaluates to true).
-
Um, there is no type BOOL in C++. There's just bool, which is a type (not a typedef), which has the values true or false.
You may be thinking of BOOL, which is a typedef in Win32. But that's a proprietary C API, nothing to do with C++.
-
This has come up before here, and I still don't understand the confusion. A boolean value can be true or false. That's all.
If it's a Boolean (in Java), then it can be true or false. The reference to the Boolean might be null, but in that case, it's not a valid reference to a Boolean.
If it's SQL, a boolean still only has two values, true or false. Null is not a boolean value, any more than null is a string value. A null indicates the complete lack of a value. It's unknown/missing/whatever. Null is not a boolean value, anymore than it's an integer value.
The PostgreSQL documentation agrees with this:
boolean can have one of only two states: "true" or "false". A third state, "unknown", is represented by the <acronym style="font-style: italic;" class="ACRONYM">SQL</acronym> null value.
-
"Null is not a boolean value, any more than null is a string value." <- Agh. I deleted that line. Sorry for the repitition. Looks like the forum software bit me.
-
*repetition
-
It's been a while since I touched Java myself, but just checking...
Boolean myBool = new Boolean();
what's the value of myBool now? (is that even valid code?)
-
There is no default constructor for Boolean, so it's a compiler error.
-
I think it might have been a "long bool": {no, perhaps, maybe, probably, yes}
-
Well, I spent ages debugging a PHP script a while ago. (No PHP is not my usual language :) )
I found that if using a variable that wasn't defined,
if($undefed_var == TRUE)
{ // Never gets here... }
else if($undefed_var == FALSE)
{ // Never gets here either... }
else
{ // We end up here! }
You don't know how long this took me to work out, since the reason the
variable had not been defined was because of a typo in its name :)
-
@MattJ said:
Well, I spent ages debugging a PHP script a while ago. (No PHP is not my usual language :) )
I found that if using a variable that wasn't defined,
if($undefed_var == TRUE)
{ // Never gets here... }
else if($undefed_var == FALSE)
{ // Never gets here either... }
else
{ // We end up here! }
You don't know how long this took me to work out, since the reason the
variable had not been defined was because of a typo in its name :)
That happened because you were unfamiliar with the language. Every seasoned PHPer knows that
error_reporting(E_ALL);
is your friend. Don't ask. The WTF-ness of most PHP options is material for a whole category of threads...
-
: Thank you for your time over call. As discussed, please stick with %priorversion% of Cloud Print. %publishedversion% is broken, and product engineer is working on it. , could you please help us understand why a broken version of Cloud Print is onboarded in Company Portal?
: The CPM is not "broken"! The build process changed and CPM was never tested. I have logic in the code to ping the load balancer. The code has to be removed. I am working on that today.
Methinks someone doesn't understand what "broken" means in this context...
-
-
Dammit, I just upvoted two 17.5 year-old posts. We need a "goddamnit fbmac" banner at the start of these old threads.
-
@HardwareGeek said in Overheard in the next cube:
Dammit, I just upvoted two 17.5 year-old posts. We need a "goddamnit fbmac" banner at the start of these old threads.
But if you have never read it, it's still new right?
-
@HardwareGeek said in Overheard in the next cube:
Dammit, I just upvoted two 17.5 year-old posts.
Only two?
@HardwareGeek said in Overheard in the next cube:
We need a "goddamnit fbmac" banner at the start of these old threads.
PRs accepted. That might be challenging to implement though, especially if you wanted it to have more functionality than "The current set of posts on this page seem very old. Have a nickel, kid!"
-
@Tsaukpaetra said in Overheard in the next cube:
Only two?
That's when I noticed I was upvoting people who would never see the upvotes. The OP hasn't been here in 15 years.
-
@HardwareGeek said in Overheard in the next cube:
The OP hasn't been here in 15 years.
We should fix that!
-
@Iago said in Overheard in the next cube:
Um, there is no type BOOL in C++. There's just bool, which is a type (not a typedef), which has the values true or false.
You may be thinking of BOOL, which is a typedef in Win32. But that's a proprietary C API, nothing to do with C++.I need to know more.
-
@DogsB said in Overheard in the next cube:
@Iago said in Overheard in the next cube:
Um, there is no type BOOL in C++. There's just bool, which is a type (not a typedef), which has the values true or false.
You may be thinking of BOOL, which is a typedef in Win32. But that's a proprietary C API, nothing to do with C++.I need to know more.
Sadly he only had three posts and they weren't all this autistic but there might be a quote bug on one of them.
-
@DogsB said in Overheard in the next cube:
he only had three posts
-
@HardwareGeek said in Overheard in the next cube:
@DogsB said in Overheard in the next cube:
he only had three posts
I was looking at the wrong profile.
-
@Iago said in I hate 'clever' programmers (Revenge of the Mover):
TRWTF is invoking a Perl one-liner from a CSH script, instead of writing the whole thing in Perl.
Seriously, even Perl is better than CSH.
What the hell? This is going to be my morning tomorrow.
-
@DogsB said in Overheard in the next cube:
@Iago said in I hate 'clever' programmers (Revenge of the Mover):
TRWTF is invoking a Perl one-liner from a CSH script, instead of writing the whole thing in Perl.
Seriously, even Perl is better than CSH.
What the hell? This is going to be my morning tomorrow.
The more things change... the more you find out they really haven't.
-
@HardwareGeek said in Overheard in the next cube:
We need a "goddamnit fbmac" banner at the start of these old threads.
Feature request: present posts in a gradually degraded manner according to their age. E. g. after a month or two some letters will get a bit slanted and a few specks of dust appear, after a year the text starts to fade, maybe some mold starts growing on the background, then some letters go missing, random graffiti appears on top of the text, etc.
-
@ixvedeusi Also, implement NodeBB in UE5
-
@Applied-Mediocrity said in Overheard in the next cube:
@ixvedeusi Also, implement NodeBB in UE5
: I tried that once, but only completed 19.26% before I had to move on to other, more broken projects.
Filed under:
-
@ixvedeusi said in Overheard in the next cube:
@HardwareGeek said in Overheard in the next cube:
We need a "goddamnit fbmac" banner at the start of these old threads.
Feature request: present posts in a gradually degraded manner according to their age. E. g. after a month or two some letters will get a bit slanted and a few specks of dust appear, after a year the text starts to fade, maybe some mold starts growing on the background, then some letters go missing, random graffiti appears on top of the text, etc.
Feature request thread is
-
@Tsaukpaetra "My code isn't broken, the build process team broke it!"
-
@ixvedeusi said in Overheard in the next cube:
Feature request: present posts in a gradually degraded manner according to their age. E. g. after a month or two some letters will get a bit slanted and a few specks of dust appear, after a year the text starts to fade, maybe some mold starts growing on the background, then some letters go missing, random graffiti appears on top of the text, etc.
This used to be how Lewis Trondheim's blog "Les petits riens" worked (I think he stopped years ago and it seems to be entirely gone by now). Older posts progressively faded away so you could read half a dozen or so, maybe a couple more if you were really determined.
For some reason I never had the curiosity to check how that was implemented and if that could easily be reversed (e.g. by editing the JS or CSS). But given its age, it is equally likely that this was actually implemented with Flash, which would have made it impossible to hack this way.
-
@Medinoc said in Overheard in the next cube:
@Tsaukpaetra "My code isn't broken, the build process team broke it! Also, uh, I'm also fixing something. Completely unrelated I assure you! "
-
@remi said in Overheard in the next cube:
But given its age, it is equally likely that this was actually implemented with Flash, which would have made it impossible to hack this way.
Not at all, there were flash decompilers IIRC.
-
@topspin these days there's even replacement runtimes for Flash written in JavaScript...
-
@Medinoc said in Overheard in the next cube:
@Tsaukpaetra "My code isn't broken, the build process team broke it!"
Not so much the team but The build here depends on codegen via excel. Most of it is pulled into hashmaps because who cares if a build is a few seconds faster. You can’t guarantee the order of iterators from a hashmap so some of the mysterious failures might be down to that.
-
@DogsB said in Overheard in the next cube:
@Medinoc said in Overheard in the next cube:
@Tsaukpaetra "My code isn't broken, the build process team broke it!"
Not so much the team but The build here depends on codegen via excel. Most of it is pulled into hashmaps because who cares if a build is a few seconds faster. You can’t guarantee the order of iterators from a hashmap so some of the mysterious failures might be down to that.
I'm no expert but I reckon if your build process depends on Excel then you might have done goofed.
-
@HardwareGeek said in Overheard in the next cube:
17.5 year-old posts
Thought process:
- Wait, that can't be true
- *check date*
- Yeah, it's from 200x, that's not so long ago
- Oh, f**k.
Fucking posts are almost old enough to (legally) drink and vote.
-
@cvi said in Overheard in the next cube:
Fucking posts are almost old enough to (legally) drink and vote.
I'm old enough to be a grandfather.
Now if only I could find a reason to procreate (and enter into a mutually-beneficial situation to do so)....
-
-
@Benjamin-Hall said in Overheard in the next cube:
@DogsB said in Overheard in the next cube:
codegen via excel.
the nope thread is
Hehe, it's not exactly code, but I do a similar thing in the AutoDeck project, which is entirely based on Excel and PowerPoint.
-
@Tsaukpaetra checks user name. Yup, still applies.
-
@topspin said in Overheard in the next cube:
@remi said in Overheard in the next cube:
But given its age, it is equally likely that this was actually implemented with Flash, which would have made it impossible to hack this way.
Not at all, there were flash decompilers IIRC.
Fair enough. Though I would have been unable to use them (or rather, understand their output).
Given that it was the early 2000, it is also entirely possible that the actual pictures were just sitting in a folder next to the main blog page.
Anyway, since he did not post every day and at least the last 5-10 comics were readable, you only needed to visit once in a while to follow everything, which is why I probably never thought about doing it otherwise. It also was, as the name implies, "small nothings" i.e. quickly drawn random bits of daily life of very limited interest overall. And if all that wasn't enough to bolster the , he also ended up publishing quite a few (all?) of them in books (this was fairly common in the French comics world of the 2000's/2010's I think).
-
@DogsB said in Overheard in the next cube:
You can’t guarantee the order of iterators from a hashmap
Not with that attitude, you can't!
(Maintaining insertion order is just a matter of keeping the leaf entries in an adjunct linked list/deque. Uses more memory, but no more allocations so it's still pretty quick. OTOH, if you need to keep things in the order of keys, you use some kind of tree; trees are great at that.)
-
@dkf let the PHP flow through you!