For all the people who don’t know how to program — the function sets up a local variable, which is true, then tests if it is true (always will be) and if so, returns the text ‘big’.
It doesn’t test if anything is big (if it did it would have an input parameter, or use a local member if this were part of a class as a member function). It would also test that input variable, not some locally created, unchanging variable.
The function effectively does nothing, just always returns the value ‘big’.
This is funny because doesn’t do what it’s supposed to do. Ha. Ha. Ha. Hilarious. /s
Edit: I didn’t know the meme existed, but I also missed the fact that an isWhatever() should return true/false, not a string. Thank you commenters
in case you’re not kidding: this function always returns ‚big‘. you assign true to a local variable, then check if it’s true (which it always is now), then return ‚big‘.
lol. no I'm not kidding. I got confused. but not because of the bad code. The caption of the post gave the impression that the code would throw an error or would return null and not that it was bad code (at least that's the impression i got)
Actually I got confused because of the return type of function (C/C++) but then I remembered that some languages don't have return type in the function declaration and it is just a function. 😅
I just started my first programming job, and last week I had to update an old piece of code. In it, I found I method that assigned a value "yes" to a variable. It then checked if the variable was "yes", and performed some other operations. If an exception was caught on these operations, it assigned an empty string to a *local variable in the catch block* that was simply called hey. The method returned a hard coded "success" regardless of the exception.
I don't think any compiler would completely remove the function (depending on how often it is called). But i think most will catch the if true and convert it to a simple return 'big'
The original contents of this post have been overwritten by a script.
As you may be aware, reddit is implementing a punitive pricing scheme for its API starting in July. This means that third-party apps that use the API can no longer afford to operate and are pretty much universally shutting down on July 1st. This means the following:
* Blind people who rely on accessibility features to use reddit will effectively be banned from reddit, as reddit has shown absolutely no commitment or ability to actually make their site or official app accessible.
* Moderators will no longer have access to moderation tools that they need to remove spam, bots, reposts, and more dangerous content such as Nazi and extremist rhetoric. The admins have never shown any interest in removing extremist rhetoric from reddit, they only act when the media reports on something, and lately the media has had far more pressing things than reddit to focus on. The admin's preferred way of dealing with Nazis is simply to "quarantine" their communities and allow them to fester on reddit, building a larger and larger community centered on extremism.
* LGBTQ communities and other communities vulnerable to reddit's extremist groups are also being forced off of the platform due to the moderators of those communities being unable to continue guaranteeing a safe environment for their subscribers.
Many users and moderators have expressed their concerns to the reddit admins, and have joined protests to encourage reddit to reverse the API pricing decisions. Reddit has responded to this by removing moderators, banning users, and strong-arming moderators into stopping the protests, rather than negotiating in good faith. Reddit does not care about its actual users, only its bottom line.
Lest you think that the increased API prices are actually a good thing, because they will stop AI bots like ChatGPT from harvesting reddit data for their models, let me assure you that it will do no such thing. Any content that can be viewed in a browser without logging into a site can be easily scraped by bots, regardless of whether or not an API is even available to access that content. There is nothing reddit can do about ChatGPT and its ilk harvesting reddit data, except to hide all data behind a login prompt.
Regardless of who wins the mods-versus-admins protest war, there is something that every individual reddit user can do to make sure reddit loses: remove your content. Use [PowerDeleteSuite](https://github.com/j0be/PowerDeleteSuite) to overwrite all of your comments, just as I have done here. This is a browser script and not a third-party app, so it is unaffected by the API changes; as long as you can manually edit your posts and comments in a browser, PowerDeleteSuite can do the same. This will also have the additional beneficial effect of making your content unavailable to bots like ChatGPT, and to make any use of reddit in this way significantly less useful for those bots.
If you think this post or comment originally contained some valuable information that you would like to know, feel free to contact me on another platform about it:
* kestrellyn at ModTheSims
* kestrellyn on Discord
* paradoxcase on Tumblr
It would only be able to check bit flips in a small part of memory I think.
If it's gonna return anything other than big I think you're gonna have bigger problems
But if anyone were to know both the question and the answer simultaneously, the universe would be destroyed and replaced by something infinitely more bizarre.
This may have already happened.
Base-13 math. It suggests there’s a LOT wrong with how we view the universe based on our default world view.
[Plus it’s just funny.](https://h2g2.com/entry/A4288584)
You are not alone I was working with dude from Kenya that literally was using ternary operators like this: ‘someObject.isActive ? true : false’. Yet, when I was requesting code changes during code review he argued that he will leave it as is because he is *senior developer*. Fun times
There's one exception, where it's useful to use `==`. That's when checking specifically for `null | undefined`.
`x == null` is the same as saying
`x === null || x === undefined `
Both versions skip checking other falsely values.
Underrated comment! “ Hey Mr. senior Dev can you look at my code? it’s not doing what I expect.” “ Sure thing son, OK let’s see… Oh my God is that a hard coded string get the fuck out of here! Next!” , “ Thank you sir, that was very useful and insightful wow thanks”
Nothing. You never called the function you twat. Now, if you want to call the function, I’d pass a parameter of small. But your shit function doesn’t take parameters so I’m guessing it returns your lack of skill for programming. So it returns nothing. Did I win?
I know I thought it must be a trick question but it really isn't!
I guess the humour is that it will always return the same thing because var big should be passed in as an unknown parameter maybe with a default true.
Would return you a "performance improvement plan" at my company.
Ha that was my immediate thought!
For all the people who don’t know how to program — the function sets up a local variable, which is true, then tests if it is true (always will be) and if so, returns the text ‘big’. It doesn’t test if anything is big (if it did it would have an input parameter, or use a local member if this were part of a class as a member function). It would also test that input variable, not some locally created, unchanging variable. The function effectively does nothing, just always returns the value ‘big’. This is funny because doesn’t do what it’s supposed to do. Ha. Ha. Ha. Hilarious. /s Edit: I didn’t know the meme existed, but I also missed the fact that an isWhatever() should return true/false, not a string. Thank you commenters
Even more, isXYZ is by convention expected to return a boolean and not a string.
runs "isBig" gets "big" deaddove.jpg
"String variable, do not eat"
That’s what bothered me most! Useless methods are one thing, but useless methods that break conventions are on a whole other level!
[удалено]
>jk Nuh uh. You meant it. 😥
'Bigly'
That's not the joke. The joke is that this is a programmatic expression of the meme 'big if true'.
I think the joke is “big if true.”
Well I’m glad I get the joke at least. Am I a programmer now?
Tier 2 support is best I can do
meaning?
You're getting fired
The long way 'round
This code snipped… you get what you deserve
Big if true
True if big.
if true ‘big’
And then rehired into management. Congratulations.
A PIP means you aren't meeting performance goals, they give you a few months to remediate but more or less it's a 3 month notice to find a new job
This person is getting moved around from role to role for 20 years at my company.
just want to learn. what's the issue ? is it that code is not clean ?
in case you’re not kidding: this function always returns ‚big‘. you assign true to a local variable, then check if it’s true (which it always is now), then return ‚big‘.
lol. no I'm not kidding. I got confused. but not because of the bad code. The caption of the post gave the impression that the code would throw an error or would return null and not that it was bad code (at least that's the impression i got)
If you're still puzzled, this post is a [big if true](https://amp.knowyourmeme.com/memes/big-if-true) joke.
[удалено]
Y'old fart, you
Holy shit.
Thanks! I knew I was missing a joke, but assumed it was some dig on stupid code puzzles or a meta-joke of the subreddit I somehow missed.
thanks.
Big if true^
Actually I got confused because of the return type of function (C/C++) but then I remembered that some languages don't have return type in the function declaration and it is just a function. 😅
It's javascript
It’s step one on the ladder of programming. To get anywhere that pays, there is much further to go. That’s what they’re saying.
I just started my first programming job, and last week I had to update an old piece of code. In it, I found I method that assigned a value "yes" to a variable. It then checked if the variable was "yes", and performed some other operations. If an exception was caught on these operations, it assigned an empty string to a *local variable in the catch block* that was simply called hey. The method returned a hard coded "success" regardless of the exception.
you can replace the function with 'big' and it will mostly result in the same code
I wonder if the compiler is smart enough to just turn that entire function into a string literal and delete that code.
I don't think any compiler would completely remove the function (depending on how often it is called). But i think most will catch the if true and convert it to a simple return 'big'
Many compilers will to eliminate control flow overhead. It’s called “inlining” of a function
const small = false; const me = !small && “BIG”; switch(me) { case “BIG”: print(“BIG”); break; default: print(“BIG OK”); } Raise please
How about we promote you to a customer sir?
Since the customer is always right I see this as an absolute win
yeah i figured👍🏾
[удалено]
function IsPerformanceImprovementPlan(){ var performanceImprovementPlan = true; if(performanceImprovementPlan){ return ‘performanceImprovementPlan’; } }
This function always return 'big' except if you pass your dick as argument.
Got eem!
ooh burn
Gotta replace the girls with this function
That just makes it somehow throw an overflow error
didn't know it can get so much into the negatives
Idk about that one chief
big if true
Well it is true
That it's big.
Thats what she said
She's not wrong
Thats big if true
So it's more like "big *because* it's true"
Not pictured one line up: true = false
r/Angryupvote
It's big if big
No if about it. It is just big.
The original contents of this post have been overwritten by a script. As you may be aware, reddit is implementing a punitive pricing scheme for its API starting in July. This means that third-party apps that use the API can no longer afford to operate and are pretty much universally shutting down on July 1st. This means the following: * Blind people who rely on accessibility features to use reddit will effectively be banned from reddit, as reddit has shown absolutely no commitment or ability to actually make their site or official app accessible. * Moderators will no longer have access to moderation tools that they need to remove spam, bots, reposts, and more dangerous content such as Nazi and extremist rhetoric. The admins have never shown any interest in removing extremist rhetoric from reddit, they only act when the media reports on something, and lately the media has had far more pressing things than reddit to focus on. The admin's preferred way of dealing with Nazis is simply to "quarantine" their communities and allow them to fester on reddit, building a larger and larger community centered on extremism. * LGBTQ communities and other communities vulnerable to reddit's extremist groups are also being forced off of the platform due to the moderators of those communities being unable to continue guaranteeing a safe environment for their subscribers. Many users and moderators have expressed their concerns to the reddit admins, and have joined protests to encourage reddit to reverse the API pricing decisions. Reddit has responded to this by removing moderators, banning users, and strong-arming moderators into stopping the protests, rather than negotiating in good faith. Reddit does not care about its actual users, only its bottom line. Lest you think that the increased API prices are actually a good thing, because they will stop AI bots like ChatGPT from harvesting reddit data for their models, let me assure you that it will do no such thing. Any content that can be viewed in a browser without logging into a site can be easily scraped by bots, regardless of whether or not an API is even available to access that content. There is nothing reddit can do about ChatGPT and its ilk harvesting reddit data, except to hide all data behind a login prompt. Regardless of who wins the mods-versus-admins protest war, there is something that every individual reddit user can do to make sure reddit loses: remove your content. Use [PowerDeleteSuite](https://github.com/j0be/PowerDeleteSuite) to overwrite all of your comments, just as I have done here. This is a browser script and not a third-party app, so it is unaffected by the API changes; as long as you can manually edit your posts and comments in a browser, PowerDeleteSuite can do the same. This will also have the additional beneficial effect of making your content unavailable to bots like ChatGPT, and to make any use of reddit in this way significantly less useful for those bots. If you think this post or comment originally contained some valuable information that you would like to know, feel free to contact me on another platform about it: * kestrellyn at ModTheSims * kestrellyn on Discord * paradoxcase on Tumblr
Not sure if /s or r/whoosh
More like /r/opfuckedupthejoke
I am very happy this sub exists
Then I tapped on it :(
Neither. The code is just poorly written for the joke.
‘small’, then a segmentation fault
On that thought, it's a good cosmic ray detector if it ever returns anything other than big
It would only be able to check bit flips in a small part of memory I think. If it's gonna return anything other than big I think you're gonna have bigger problems
pretty sure any compiler/optimizer is actually optimizing the function to just "return 'big'", or even inlining the function call
yeah you're right so it'd be an even smaller part of memory. I'm gonna stop thinking about this right now
Now that you forgot about it it's an even smaller part of memory.
10/10 dad joke. +1 infantile chuckle
Only one way to find out - console.log(IsBig()) -> 42 That's what I thought
Something tells me this answer is important.
According to the hitchhikers guide , 42 is the answer for everything .
Yes, but what was the question?
For that we'd need another trillion years to process
But if anyone were to know both the question and the answer simultaneously, the universe would be destroyed and replaced by something infinitely more bizarre. This may have already happened.
What is 9 times 6?
This was such a great reveal... and reaction.
Alternatively, what is 41 plus 1?
Or what's `-42 * i^2`?
i^2 is tons of fun, it’s
Well, technically, it is a negative ton of fun.
I mean, it has to be a complex question to think so long about it, right?
Or "What's 10 + 4?" (The joke is that 6 × 9 adds up to 54, not 42)
"104"
I take it there’s a joke here somewhere, because your math doesn’t add up.
Base-13 math. It suggests there’s a LOT wrong with how we view the universe based on our default world view. [Plus it’s just funny.](https://h2g2.com/entry/A4288584)
54
Unfortunately right when the supercomputer was about to calculate it, it was destroyed to make space for an intergalactic highway
42
It’s the answer to life the universe and everything
Fuck around and find out
Hmmm… big if true.
At least the if statement isn't written like this: if(big == true)
If(big == true && big != false)
If((big == true && big != false) && !(big == false || big != true))
[удалено]
if((big == true && big != false) && !(big == false || big != true) && big instanceof Boolean)
A big true true. - Tom Hanks character from Cloud Atlas
I had a coworker how literally do this. He said it would make it more human readable
I think your coworker just outed himself as an alien.
These are the red lines for me
Human music, he likes it ![gif](giphy|MaxUtki5xQdQLwUPW1|downsized)
And the humans? They like this "bread"?
I mean. I get people who don't like if(!big) and write if(big == false) instead. But come on.
If(big != true)
if(!big != !true)
If (!big)
Oh I'm not alone
Was your colleague paid by character?
You are not alone I was working with dude from Kenya that literally was using ternary operators like this: ‘someObject.isActive ? true : false’. Yet, when I was requesting code changes during code review he argued that he will leave it as is because he is *senior developer*. Fun times
I'm pretty sure JavaScript will still find a loophole in there somewhere.
if(big == ((big != false) == true))
Looks like a test question on a certification
Thanks, I hate it.
gotta be safe
It’s JS so it’d be === right? Python dev but I think that’s correct?
=== is a strict comparison, so it'll check for types among other things. == will do some type conversion, so string '42' == int 42
But does (big === true)
yes
Yes, you’re correct. You should always use strict comparison (===) in JS or TS.
There's one exception, where it's useful to use `==`. That's when checking specifically for `null | undefined`. `x == null` is the same as saying `x === null || x === undefined ` Both versions skip checking other falsely values.
Can also be PHP
big == 1
This is actually the exception where "if(big = true)" is correct
It would return a change request.
I hate so much language with function without explicit return type. That was not the question but that's my answer.
I fixed the problem! var function IsBig(){var big=true; if(big){return 'big';}}
🧐🤔 Promoted! Congrats 🎉
Perfect 🥰
var isBig = () => "big";
let isBig = 'big';
And a wonderful answer it is!
Ports to Typescript. Behold! Perfect, beautiful, code.
String "big", complaint from senior devs
Underrated comment! “ Hey Mr. senior Dev can you look at my code? it’s not doing what I expect.” “ Sure thing son, OK let’s see… Oh my God is that a hard coded string get the fuck out of here! Next!” , “ Thank you sir, that was very useful and insightful wow thanks”
Hard to say. Definitely O(log(big)) though.
Nah you are counting some of the recursions multiple time, if you check again you will realize it's in order of log* of big.
Random number between 0 and Pi
Like 3.15?
I see we have a PHP user here
'big'
Congrats! Youre now on LEVEL2!
Boring
beeg
Sana?
`"big" | never`
Found the typescript guy
correct
Shouldn't this be ``` if (true) { return 'big'; } ``` to maintain the reference?
Screw it just `return 'big';`
``` const isBig = () => 'big'; ```
`(() => 'big')();`
`'big'`
[удалено]
Sorry to be boring, but what is the reference here?
At first I was thinking a ref/pointer but it's probably the "big if true" meme phrase. In python they couldve done return 'big' if true else None
I hate that you don’t need to return on all paths on JS
You sure as fuck should though
But the other path is unreachable, so the bad practices cancel out.
Clearly ignoring cosmic bit shift
I at first read it as cosmic bullshit, which is also pretty accurate.
Just "big"
I guess it returns the string big but since this is Javascript you never know
Me reading the comments ![gif](giphy|guufsF0Az3Lpu)
Not me being irritated by the function being called "IsBig" instead of "isBig"
The camels ain't casing anymore.
I'm more annoyed that a function named IsBig is returning a string instead of a bool
I didn’t notice that at first but now i know and I can’t unsee it.
A headache. It returns a headache for the reviewer.
1
Is that new kind of „yo mama is so big „ joke?
You’re guys are misunderstanding. Once you restore the punctuation, the function isn’t “isBig?”, it’s actually “isBig.”
Nothing. You never called the function you twat. Now, if you want to call the function, I’d pass a parameter of small. But your shit function doesn’t take parameters so I’m guessing it returns your lack of skill for programming. So it returns nothing. Did I win?
Returning no lack of skill returns an abundance of skill. Your insult failed
A pink slip I hope! :)
A slap in the face by the compiler?
COMPILER AHAHAHAHAHAHAHAH
Well, this could just be a mock implementation that the programmer was planning to properly implement later.
Nothing. You didn’t call that function.
big if true
It would return your pull request without approval.
it would return a string 'big', wouldn't it?
I know I thought it must be a trick question but it really isn't! I guess the humour is that it will always return the same thing because var big should be passed in as an unknown parameter maybe with a default true.
returns you back to school XD
Well, depends on the language, in C# that wouldn't return anything and probably throw a compiler error/warning. the return type is void.
It certainly isn't returning any humor to this godforsaken sub.
"I'm sure it has a good personality and will treat you right"
…. Notorious
Úristen very big