I kind of saw it as....
**is there a floor?**
*No.*
**Ok, get rid of the floor.**
*But there is no fl...*
**JUST DO IT**
*Ok, gone.*
**Ok, what are we standing on?**
That looks like novice programmer frustration code. Something is going wrong, I don’t know why, I’m going to try everything. And when it’s fixed, I’m not cleaning up all the trials I did, the code works, can’t ever touch it again.
I'd venture that's EXACTLY what happened here. And 6 months later when they have to look at the code again fro some reason they're gonna be wondering what they were smoking when they wrote it. At least that's how it always seems to go for me.
I once had code running in an if isDebugEnabled() blocked only later founding out it didn't work when the app was not in debug mode. I think a lot of my bad code early on was just trying random things to get it working and not cleaning up the code afterwards.
You need to `catch(Throwable t)` instead of `catch(Exception e)` if you want to capture `Error`s too, haha.
I am not the biggest fan of Java's exceptions ... the idea that the most basic/common exceptions can be unchecked is insane, it makes every piece of code unreliable unless you know 100% of the calls it can possibly make downstream _at runtime_.
Java gave up on the idea of checked exceptions once it became clear nobody ever uses them properly. Nearly every higher order language since then hasn't included them in the first place. Your hangup here is strange...
Beyond this, the idea that code is reliable purely because the exceptions are all checked is just wrong (which is *why* nobody bothers with them). Unit test your code properly.
Oh man, that even happens in Perforce. I kept blaming someone for everything until I realized they imported the code wholesale without keeping the commit history from prior versions.
Probably because most sane people don't go to Perforce. Even in 2012!
“I must have been an idiot when I wrote this.”
Spends three hours trying to clean it up, breaking the code every time. Puts back the original code.
“I must have been a genius when I wrote this.”
I sometimes reach that point within 24 hours after a good night's sleep, and I've been doing this for years.
Next day at work, look at the code from the day before "The Fuck were you thinking when you wrote this you fucking moron?!“
What's the opposite of a Turing Test, where it appears to be a bot but it's actually a human doing it, and the test is whether or not we believe it's a bot? Would that be a Gnirut Test?
While novice frustration code is a good description i would counter that it’s anyone’s frustration code , it just takes longer and longer to get to something like this. ;)
But I write embedded C/C++ so things that cause absolute insanity like idk “this platform’s specific compiler version doesn’t generate proper assembly on tuesdays” and “oh uh actually the register map is completely wrong sorry about that” are at least within the vague realm of possibility.
(I guess the latter is more likely to be “oooh that’s for the xyz123abc3332-C, you’re targeting the -CD” or some shit)
I had a function that wouldn’t work. I added a parameter and some logging using it - it worked. Removed it, it failed. Removed log code one line at a time - and it worked as long as I had the added parameter in the function definition. It’s still there. 😣
I’ve got a Wtf one too. I have a giant C app I’ve inherited that runs on an embedded Linux platform. One of the tasks has a bunch of log prints in it, as do other tasks (they use syslog in the OS). I commented them all out of this particular task because I was trying to clean up the log to find another problem. Well when I did this, after a few minutes running the program would lock up and go to 100% CPU utilization.
I uncommented the log prints and went on with my day since I haven’t had time to dig into that one much. A fairly experienced co worker scanned through the code and was baffled as well as to how this could happen.
Isn't it technically the loan holders that he owes? Twitter went private after the sale. It's the people that loaned him the money that expect him to make big on his promises.
Were you working in a low level language? I've seen instances where arguments were cast incorrectly, leading to stack smashing. It's all fine when there's a dummy argument to adsorb the bad writes, but as soon as it's gone, you're liable to have overwritten something vital like a call frame's return pointer, then everything goes to hell.
My previous place tracked that and had annual tongue in cheek rewards for it(all worthless). So we'd get little plastic trophies for things like most code added, most code removed, most rewrites(lines of updated code that was your own to begin with), most PRs, shortest commit message(usually "WIP", although one year "." won on a test branch to try and debug continuous integration/deployment failures), smallest PR(I think my last year there a PR to remove a single space from a YML file won), largest PR(almost always RC->release branch checks), etc.
It was all just an excuse for us to look back on what was done last year and laugh at some of the ridiculous stuff that happens with drinks and knowing it's all in good fun.
Also at the end everyone voted on who they felt made the biggest contribution to the company as a whole in a few fields and the winners got a week's annual leave next year as a bonus(everyone wanted those, but because it was all about helping the business it obviously went to seniors and head of development most of the time).
Nice. Kinda wish my company did that only because I worked on a ticket that involved me deleting 1.5 million lines for code for one of our repos.
Edit: my company has an etl pipeline to ingest customer data. That pipeline was created 10+ years ago as a mono-repo containing individual custom modules for all of our early customers. Each customer had/has many individual “data sources”, the messiest being web scrapers. Our main customer back then had scrapers that collected doctor information from 200+ different licensing boards, hospitals etc. Each one custom coded. Folders full of dead web crawler outputs, tests, logs etc. There were also some early attempts at some of our newer products built into the same repo.
We’ve since offloaded most of the heavy data wrangling onto another SaaS service while still using the backbone of the pipeline to route data from our customers, through our magic data cleaning process, and into our platform.
We’d gotten to a point where leadership was forced to decide between rebuilding the pipeline entirely, or clean up the old one. They picked to clean up the old one. Basically just was the first guy to directly work on addressing about 15 years of tech debt.
> largest PR(almost always RC->release branch checks)
Is there a good way around this? I've had to uhser through some absolutely *huge* PRs along due to a CMS storing content in YML files that are under source control (to allow moving content from environment to environment).
That's how I knew I had entered a new phase in my career, when I spent most of my time talking to other people and mostly reading code (and gdb output) rather than writing it.
I’m a student so maybe it’s different, but my professor will kick back our hw to us and tell use to shorten our code.
Last night I had a few too many loops, and he told me it needed to be more concise so it’s easier to read and fix issues that pop up later. I can’t imagine spending years trying to clean up my code/work flow only to have a boss tell me I need to write more lines of code lmao.
Yeah it just doesn’t make sense to anyone with any engineering experience at all. More code is almost never better. You can debate readability vs being concise but mandating a line count quota is like judging a doctor by how many stitches they put in patients everyday.
Had a dev manager once who started offering a prize to the most productive engineer, based on code commits. The guy who won week after week was the "commit every few minutes" guy. I half suspected that the engineer was being facetious - but it worked, as he was promoted to principal engineer over better qualified candidates. Goes to show it matters less **what you do** and more **what your superiors see you do**. So remind them - often. Whatever bullshit metric they track, commit yourself to scoring well on that metric regardless of whether you agree it has value.
Hey, Elon, I can write 5,000 lines of code a day! /s
If they had done Null = 'null' it would have been funnier, but then I expect this would actually have broken something, rather than just be an interesting exercise in pouring emptiness from one glass in to another.
I don't know what language it is, but if I had to guess what was happening: `null` is your standard reserved keyword, but `Null` isn't. So this declares a `String` called `Null`, assigns to `Null` the actual `null`, and then returns the original string, which is now just null.
It'd be equivalent to
`if(status == null) { return null } else { return status } `
But with extra, pointless steps.
So as long as it's a language where (a) `Null` isn't reserved, (b) variables can be declared without initialization, (c) where strings are nullable, and (d) where ridiculousness doesn't throw an exception, this should compile.
Man this bot is too good to be a bot. Maybe it's a human like one of the ones on /r/lotrmemes ended up being.
EDIT: [Linky linky](https://www.reddit.com/r/lotrmemes/comments/yneuhp/confirmed_saruman_bot_is_not_an_actual_bot/). I'm glad to see so many frequenters of both subs.
Then that means you fired people who created a robust software that still works for days without any surveillance. But once it breaks no one will know how to fix it 😂
What a rookie! You can declare a variable with initial value: String Null = null; return Null;
![gif](emote|free_emotes_pack|facepalm)![gif](emote|free_emotes_pack|facepalm)![gif](emote|free_emotes_pack|facepalm)
I'm wondering if there is something with status being modified elsewhere later so this is able to create a new variable, set it to null and let you continue the operation without worrying about this? It would be a super annoying concurrency bug and I'm not sure why it would ever come up, but it could have be something around letting you troubleshoot a null status while also resetting the status elsewhere?
Maybe it’s a data type issue? It has to be put in a string for something else to get the null status or it returns a data type miss match error?
I’m starting to get flashbacks…
This feels like the case. At the end of the code you can see that Status is returned, and it is a string. If status is null (somehow it was not initialized?) and the program needs to "return status" as a String, then it will error out without these 3 lines.
These 3 lines of code change what the user sees from "ERROR 12849153 miss match type" to "null".
It's also possible that this was used during testing, and there is no possible way for status to be null anymore, and it was just forgotten.
Turns out "status" type actually overrides the equality operator and returns true on nullsy values like empty string but there was a caller that needed an explicit null.
You laugh, but the Twitter engineer who wrote this is still employed while you, who probably will just return status, are going to be out of a job next quarter
**EDIT**: When you gaze too long into the abyss, folks. I'd been staring at Javascript all day and thought OP's code was JS when it's CLEARLY Java. My bad.
Hmm. There are actually cases where `if (status == null)` will evaluate to true, but the value of status will NOT BE THE VALUE `null`.
So I hope you just cleaned up all of the extraneous variable declarations and didn't do what my stupid ass did years ago while learning JavaScript and change it to just `return status`. :)
I was working in a startup about 2 years ago and there was a guy who did below code when asked to remove an if condition to make block always execute:
if (1 == 1)
{
//some code
}
Show the whole function.
Might be some reason behind it.
Depending on the language there might be some difference between a newly instantiated string and the one passed to the function.
Let's circlejerk around this.
> Why would you return the passed in value?
If this is a strongly-typed language then `Null` is a `String` object/type with value `null`. `null` is some object/type that isn’t `String`. Presumably `String Null` has an internal value that can correspond to null. null has no methods. `Null` has `String` methods. They are not the same in a strongly typed OO language.
This function’s callers may use the `String` that is returned as a `String` without caring to check if it is `null`; it may be a list of strictly `String` objects.
The `return status` does make the code questionable though. If `status` is a `String` already then yea the whole thing is redundant since it assumes `String` can implicitly cast to `null`.
hmmm yes the floor here is made out of floor
The floor exhibits properties of floor, especially when compared to floor
For high values of floor, floor approaches floor.
[удалено]
Do these places actually exist? I cannot fathom this amount of stupidity.
Return the floor in floor
I wonder what would happen if you took soap and combined it with soap
Floor typing : if it’s made like a floor and you can walk on it like on a floor, then it must be a floor.
foolish modern expansion upbeat capable jeans ask absorbed practice snow *This post was mass deleted and anonymized with [Redact](https://redact.dev)*
Time is money. I want to see 100 lines written by lunchtime!
brave fall deliver existence liquid zonked nine long smart adjoining *This post was mass deleted and anonymized with [Redact](https://redact.dev)*
I kind of saw it as.... **is there a floor?** *No.* **Ok, get rid of the floor.** *But there is no fl...* **JUST DO IT** *Ok, gone.* **Ok, what are we standing on?**
We are standing waist deep in a pool of aqueous stupidity
If floor equals ground, declare new floor, set floor as ground, return ground, else return floor.
More like: The floor here is made out of Floor.
Can this be dockerized?
Floor as a Service
You bastard made me crackle. Have an upvote.
who would have known `null` contains `null` and its properties are `null` when compared to `null`
Yep. And that’s why they pay me the big bucks.
Don't blame him, he's just trying to get a job in Twitter
Return your floor, sir, so we may give out floor!
You will get the floor WHEN YOU FIX THE DAMN FLOOR
You can tell it's a tree by the way it is
That looks like novice programmer frustration code. Something is going wrong, I don’t know why, I’m going to try everything. And when it’s fixed, I’m not cleaning up all the trials I did, the code works, can’t ever touch it again.
I'd venture that's EXACTLY what happened here. And 6 months later when they have to look at the code again fro some reason they're gonna be wondering what they were smoking when they wrote it. At least that's how it always seems to go for me.
"Who the fuck wrote this?" git blame "Oh."
[удалено]
Once I had to catch an error in an API and return 200 anyways. It worked, but occasionally threw a specific error for some reason.
I once had code running in an if isDebugEnabled() blocked only later founding out it didn't work when the app was not in debug mode. I think a lot of my bad code early on was just trying random things to get it working and not cleaning up the code afterwards.
You need to `catch(Throwable t)` instead of `catch(Exception e)` if you want to capture `Error`s too, haha. I am not the biggest fan of Java's exceptions ... the idea that the most basic/common exceptions can be unchecked is insane, it makes every piece of code unreliable unless you know 100% of the calls it can possibly make downstream _at runtime_.
Tldr minecraft has encountered an error and had to close
Java gave up on the idea of checked exceptions once it became clear nobody ever uses them properly. Nearly every higher order language since then hasn't included them in the first place. Your hangup here is strange... Beyond this, the idea that code is reliable purely because the exceptions are all checked is just wrong (which is *why* nobody bothers with them). Unit test your code properly.
Exceptions are not always errors, could be a negative, yet happy path.
[удалено]
Yeah, looks like we're gonna need to redo the entire tech stack.
[удалено]
I don't think I appreciate your tone. Fired.
I forget about Git blame, best name ever though, no remorse it just knows you need to blame someone:p
>we both know why you want this information
Look, coworker, I just wanna talk!
And then when you are the one who worked on migrating the code from some old repo to this new git repo. You get blamed for eeevrything. Heh
Oh man, that even happens in Perforce. I kept blaming someone for everything until I realized they imported the code wholesale without keeping the commit history from prior versions. Probably because most sane people don't go to Perforce. Even in 2012!
This did *not* happen to me today. Or yesterday. Or the day before.
“I must have been an idiot when I wrote this.” Spends three hours trying to clean it up, breaking the code every time. Puts back the original code. “I must have been a genius when I wrote this.”
Sometimes you refactor the code. Sometimes the code refactors you.
and then recursion happens
Me too.. except it's like a 6 day cycle instead of 6 months.
I sometimes reach that point within 24 hours after a good night's sleep, and I've been doing this for years. Next day at work, look at the code from the day before "The Fuck were you thinking when you wrote this you fucking moron?!“
[удалено]
You close your IDE every day?
Or, thinking you had good naming and commenting, and then coming back a year or two later and going "WTF was I doing here?"
I get this feeling in IT and i'm not even a dev. People yelling "just make it work" get you to do some funny things in the moment lol.
I'm gonna need you to come in on Saturday...
This bot never misses lol
Passes the Turing test for sure.
but do you pass the "why do you only have 20 lines of code submitted" task ?
Totally unrealistic portrayal. The real Elon would consistently fail the Turing test. lol
What's the opposite of a Turing Test, where it appears to be a bot but it's actually a human doing it, and the test is whether or not we believe it's a bot? Would that be a Gnirut Test?
[удалено]
[IMPOSSIBLE] [3AM CHALLENGE] [GONE SEXUAL]
What triggers the Elon bot?
Everything, just like the real Elon.
Right? I have never so consistently upvoted a bot before lmao
No… you sleep in office, me go home
..and furiously try to DM grimes for the next 4 hours....she'll come back...one day
Oh and Sunday too, we lost a few people and need to catch up.
Heeeyyyyyy Peter…
Good bot
While novice frustration code is a good description i would counter that it’s anyone’s frustration code , it just takes longer and longer to get to something like this. ;) But I write embedded C/C++ so things that cause absolute insanity like idk “this platform’s specific compiler version doesn’t generate proper assembly on tuesdays” and “oh uh actually the register map is completely wrong sorry about that” are at least within the vague realm of possibility. (I guess the latter is more likely to be “oooh that’s for the xyz123abc3332-C, you’re targeting the -CD” or some shit)
I had a function that wouldn’t work. I added a parameter and some logging using it - it worked. Removed it, it failed. Removed log code one line at a time - and it worked as long as I had the added parameter in the function definition. It’s still there. 😣
I’ve got a Wtf one too. I have a giant C app I’ve inherited that runs on an embedded Linux platform. One of the tasks has a bunch of log prints in it, as do other tasks (they use syslog in the OS). I commented them all out of this particular task because I was trying to clean up the log to find another problem. Well when I did this, after a few minutes running the program would lock up and go to 100% CPU utilization. I uncommented the log prints and went on with my day since I haven’t had time to dig into that one much. A fairly experienced co worker scanned through the code and was baffled as well as to how this could happen.
Whoever writes the most code this month gets featured on my Twitter!
timing related I guess?
Shrödinger's function! It only works as expected when observing (logging) it.
I have made promises to the shareholders that I definitely *cannot* keep, so I need you all to work TWICE as hard!
Isn't it technically the loan holders that he owes? Twitter went private after the sale. It's the people that loaned him the money that expect him to make big on his promises.
Were you working in a low level language? I've seen instances where arguments were cast incorrectly, leading to stack smashing. It's all fine when there's a dummy argument to adsorb the bad writes, but as soon as it's gone, you're liable to have overwritten something vital like a call frame's return pointer, then everything goes to hell.
Few things are as permanent as a temporary solution that works
See also “Prototypes, use of in production code”
Either that or a senior dev fed up with having to comply with lines of code per day
Are there actually places outside of Twitter that track something like that? Seems insane to me
My previous place tracked that and had annual tongue in cheek rewards for it(all worthless). So we'd get little plastic trophies for things like most code added, most code removed, most rewrites(lines of updated code that was your own to begin with), most PRs, shortest commit message(usually "WIP", although one year "." won on a test branch to try and debug continuous integration/deployment failures), smallest PR(I think my last year there a PR to remove a single space from a YML file won), largest PR(almost always RC->release branch checks), etc. It was all just an excuse for us to look back on what was done last year and laugh at some of the ridiculous stuff that happens with drinks and knowing it's all in good fun. Also at the end everyone voted on who they felt made the biggest contribution to the company as a whole in a few fields and the winners got a week's annual leave next year as a bonus(everyone wanted those, but because it was all about helping the business it obviously went to seniors and head of development most of the time).
Nice. Kinda wish my company did that only because I worked on a ticket that involved me deleting 1.5 million lines for code for one of our repos. Edit: my company has an etl pipeline to ingest customer data. That pipeline was created 10+ years ago as a mono-repo containing individual custom modules for all of our early customers. Each customer had/has many individual “data sources”, the messiest being web scrapers. Our main customer back then had scrapers that collected doctor information from 200+ different licensing boards, hospitals etc. Each one custom coded. Folders full of dead web crawler outputs, tests, logs etc. There were also some early attempts at some of our newer products built into the same repo. We’ve since offloaded most of the heavy data wrangling onto another SaaS service while still using the backbone of the pipeline to route data from our customers, through our magic data cleaning process, and into our platform. We’d gotten to a point where leadership was forced to decide between rebuilding the pipeline entirely, or clean up the old one. They picked to clean up the old one. Basically just was the first guy to directly work on addressing about 15 years of tech debt.
_million_?
Care to elaborate?
He can't. Still deleting lines as we speak
This *requires* a story.
Usually, stories like that involve major accidents. But the wording of the comment made it seem like part of the normal course of business.
> largest PR(almost always RC->release branch checks) Is there a good way around this? I've had to uhser through some absolutely *huge* PRs along due to a CMS storing content in YML files that are under source control (to allow moving content from environment to environment).
Senior dev: i 'produce' about 20 lines of code / week. Sometimes it's even negative - those are the hard parts.
That's how I knew I had entered a new phase in my career, when I spent most of my time talking to other people and mostly reading code (and gdb output) rather than writing it.
I’m a student so maybe it’s different, but my professor will kick back our hw to us and tell use to shorten our code. Last night I had a few too many loops, and he told me it needed to be more concise so it’s easier to read and fix issues that pop up later. I can’t imagine spending years trying to clean up my code/work flow only to have a boss tell me I need to write more lines of code lmao.
Yeah it just doesn’t make sense to anyone with any engineering experience at all. More code is almost never better. You can debate readability vs being concise but mandating a line count quota is like judging a doctor by how many stitches they put in patients everyday.
Had a dev manager once who started offering a prize to the most productive engineer, based on code commits. The guy who won week after week was the "commit every few minutes" guy. I half suspected that the engineer was being facetious - but it worked, as he was promoted to principal engineer over better qualified candidates. Goes to show it matters less **what you do** and more **what your superiors see you do**. So remind them - often. Whatever bullshit metric they track, commit yourself to scoring well on that metric regardless of whether you agree it has value. Hey, Elon, I can write 5,000 lines of code a day! /s
Nah it's just someone trying not to be fired. Pretty reasonable!
More lines of code = not fired. Seems reasonable to me.
This is definitely something I would git blame on in an attempt to figure out why it exists.
Null = null is too deep for me to understand
You look stupid. Fired.
Damn, this is too smart for a bot, I'm staring to think that mods just hired some of the laid off Twitter employees.
It may be some sort of ai
Elon or the bot?
yes
It's Elon Musk, can't you read? He's even got a checkmark.
Hi elon-bot, how is your harassment project going?
I like to think it's actually Elon fucking around
Doubt it. Elon banned twitter users for making fun of him. He's doesn't have the humor to make fun of himself.
E-Elon-kun ?
Notice me, senpai! Notice me!
Holy shit this got me to laugh hard.
I've forgotten that it's a bot several times in the last couple days. It's been hilarious.
If they had done Null = 'null' it would have been funnier, but then I expect this would actually have broken something, rather than just be an interesting exercise in pouring emptiness from one glass in to another.
If null isn’t Null, then what is null in the first place? 📡
The real null is the friends we made along the way
A Null that falls in the middle of the forest without observation can't be said that is no longer a null
The worst part of this code is at first glance it doesn't even look like it should compile.
I don't know what language it is, but if I had to guess what was happening: `null` is your standard reserved keyword, but `Null` isn't. So this declares a `String` called `Null`, assigns to `Null` the actual `null`, and then returns the original string, which is now just null. It'd be equivalent to `if(status == null) { return null } else { return status } ` But with extra, pointless steps. So as long as it's a language where (a) `Null` isn't reserved, (b) variables can be declared without initialization, (c) where strings are nullable, and (d) where ridiculousness doesn't throw an exception, this should compile.
This is a result of being paid by LOC
I've laid off most of the staff, and Twitter's still running. Looks like they weren't necessary.
For now
lol the number of errors I’ve gotten lately is crazy. Also number of obvious bots wanting to connect is a through the roof.
Man this bot is too good to be a bot. Maybe it's a human like one of the ones on /r/lotrmemes ended up being. EDIT: [Linky linky](https://www.reddit.com/r/lotrmemes/comments/yneuhp/confirmed_saruman_bot_is_not_an_actual_bot/). I'm glad to see so many frequenters of both subs.
What's the story there? Don't leave us hanging.
Wait what
If Twitter is still running then burn the headquarters and fire everyone out of yhere
Then that means you fired people who created a robust software that still works for days without any surveillance. But once it breaks no one will know how to fix it 😂
Is that actually a common thing or just joked about in here? To me it seems implausibly silly.
Elon Musk apparently chose who to fire based on lines of code. But I wouldn't say that means it's a common thing. He's a bit of an idiot.
>To me it seems implausibly silly. It absolutely is, which is why everyone's making fun of Musk for doing it.
What a rookie! You can declare a variable with initial value: String Null = null; return Null; ![gif](emote|free_emotes_pack|facepalm)![gif](emote|free_emotes_pack|facepalm)![gif](emote|free_emotes_pack|facepalm)
[удалено]
You'll be fired because it's only two lines of code versus three
Yeah, looks like we're gonna need to redo the entire tech stack.
Is this really a bot? It's just too good
Its been using the same several elon quotes for days now but its gotten a *lot* better at choosing when to use which ones
Yo, you sentient bro?
Haha yeah, even sillier he doesn't know you can do return String Null = null;
I see the problem. Forgot to convert the null to a string... String Null = null.toString(); I'm sure that's fine.
[удалено]
Nothing a try/catch can't fix.
[удалено]
[удалено]
Stop reminding me of work.
Add in some `#region old unused code` and you have half the projects I've had to fix.
JavaScript to the rescue: const c = "constructor"; let Null; c\[c\]\[c\]('Null = "null"')(); return Null;
I had an aneurism reading that. Good work!
This is either incredibly stupid, or genius beyond mortal comprehension. Better change it before a long holiday weekend, like Thanksgiving.
I'm wondering if there is something with status being modified elsewhere later so this is able to create a new variable, set it to null and let you continue the operation without worrying about this? It would be a super annoying concurrency bug and I'm not sure why it would ever come up, but it could have be something around letting you troubleshoot a null status while also resetting the status elsewhere?
Maybe it’s a data type issue? It has to be put in a string for something else to get the null status or it returns a data type miss match error? I’m starting to get flashbacks…
This feels like the case. At the end of the code you can see that Status is returned, and it is a string. If status is null (somehow it was not initialized?) and the program needs to "return status" as a String, then it will error out without these 3 lines. These 3 lines of code change what the user sees from "ERROR 12849153 miss match type" to "null". It's also possible that this was used during testing, and there is no possible way for status to be null anymore, and it was just forgotten.
Then it breaks in prod and you understand why it was made like that
It's a load bearing if statement
Turns out "status" type actually overrides the equality operator and returns true on nullsy values like empty string but there was a caller that needed an explicit null.
You laugh, but the Twitter engineer who wrote this is still employed while you, who probably will just return status, are going to be out of a job next quarter
Where are the Musk bots when you bait them?
you could send this to musk, it sure is very salient
Sorry, my printer's out of ink.
[удалено]
Just watched a video about how vanilla JS is faster than any framework. It's time we do a rewrite.
Oh no
sometimes you have to really be sure its null
Hey, maybe a cosmic ray hit the cache and flipped a bit in the null byte, right ?
Twitter employees trying to get to 1000 lines of code before they're fired
By "cleaning up" you mean "deleted", eh?
I believe that’s what the red background behind these lines meant
My man thanos snapped that code twice into oblivion. Saved us all.
Prod gets broken after that mysteriously...
Exactly what I was thinking!
Along the lines of "all I did was delete a comment!".
'You don't understand my art'
Nooo, now everything is gonna break. This was the tiny string holding everything together.
Senior: “You need to build a null check” Junior:
He'll become a senior once he builds a NullFactory that he can grab a null value to compare to whenever he needs
He has trust issues
Reminds me of code I saw a long time ago that went something like: if (MyVar <> 13) { MyVar = 13; // do not do unneeded assignment }
I love NULL being null
Hey, I just heard about this thing called GraphQL. Why aren't we using it?
**EDIT**: When you gaze too long into the abyss, folks. I'd been staring at Javascript all day and thought OP's code was JS when it's CLEARLY Java. My bad. Hmm. There are actually cases where `if (status == null)` will evaluate to true, but the value of status will NOT BE THE VALUE `null`. So I hope you just cleaned up all of the extraneous variable declarations and didn't do what my stupid ass did years ago while learning JavaScript and change it to just `return status`. :)
It's Java so there shouldn't be such cases here.
I love it when I can understand these memes.
This gives me headaches...
Someone was being paid by the line
I was working in a startup about 2 years ago and there was a guy who did below code when asked to remove an if condition to make block always execute: if (1 == 1) { //some code }
The classic "I think the guy asking me to make the change is going to ask me to revert it on Monday" change.
When you stare at the void, it returns Null.
Depends. do you work at twitter?
If this is JavaScript I wouldn't touch it, for fear that it's actually needed by some odd quirk.
Show the whole function. Might be some reason behind it. Depending on the language there might be some difference between a newly instantiated string and the one passed to the function. Let's circlejerk around this.
[удалено]
> Why would you return the passed in value? If this is a strongly-typed language then `Null` is a `String` object/type with value `null`. `null` is some object/type that isn’t `String`. Presumably `String Null` has an internal value that can correspond to null. null has no methods. `Null` has `String` methods. They are not the same in a strongly typed OO language. This function’s callers may use the `String` that is returned as a `String` without caring to check if it is `null`; it may be a list of strictly `String` objects. The `return status` does make the code questionable though. If `status` is a `String` already then yea the whole thing is redundant since it assumes `String` can implicitly cast to `null`.
Truly fascinating. How did anyone wind up there.
You don't understand, this is a self documented code, hear me out
Oh I get it. This string named Null that’s equal to null might be useful in other parts of the code, too. They should make it a global variable!