[ad_1]
Tags: old meme, funny, art, oil painting, monty python
1782 points, 60 comments.
[ad_2]
Humor | ReportWire publishes the latest breaking U.S. and world news, trending topics and developing stories from around globe.
[ad_1]
Doreann has touched this particular function many, many times. In all those times, she never noticed this particular little line, dropped in by a third-party contractor that has long since cashed their check and wandered off to other things.
(user?.betaMode || !user?.betaMode) && (specialRuleCode())
My suspicion is at some point, the specialRuleCode was only supposed to run if the user was signed up for beta features. At some point, it left beta and was supposed to run for all users. I imagine the requirement was "it should also run if the user is not in the beta," and thus it was implemented exactly that way.
Of course, the real WTF isn't the tautological condition: it's (ab)using logical operators to control whether a branch runs. That, I imagine, made some developer feel like they were being clever. "user?.betaMode && specialRuleCode is so much more concise than an if statement!" they said to themselves while typing this.
Honestly, that kind of "clever" is not something I'd expect from a third party contractor. It makes me think the original line started in-house by a "clever" developer, and the third party added the || portion in just the dumbest way to implement the requirement given to them.
Either way, Doreann is ashamed that it's lingered this long in the code base, writing:
dishonor for it being there
dishonor for me not recognizing this
dishonor on my whole family
I'm just glad that we're finally breaking through and getting readership in the Klingon developer community.
[ad_2]
Remy Porter
Source link
[ad_1]
|
maybe we have ourselves to blame?….i guess we'll just be sending her with her 2nd favorite book. The hungry catapillar. submitted by /u/burnyoudown13 |
[ad_2]
/u/burnyoudown13
Source link
[ad_1]
Today’s anonymous submitter sends us some C# code. This particular block of code controls whether two different columns are visible on the screen. If the field Dist_Por equals one set of constants, we display one column, if it equals a different constant, we display the other. Seems simple enough.
My question to you is this: how many nested ternaries do you need to solve this problem?
ColHectarias.Visible = Dist_Por == TIPO_DIST_COSTO.Directo ? false : Dist_Por == TIPO_DIST_COSTO.Plantilla ? false : Dist_Por == TIPO_DIST_COSTO.Hectáreas ? true : Dist_Por == TIPO_DIST_COSTO.CCosIndirecto ? true : false;
ColPorcentaje.Visible = Dist_Por == TIPO_DIST_COSTO.Directo ? false : Dist_Por == TIPO_DIST_COSTO.Plantilla ? true : Dist_Por == TIPO_DIST_COSTO.Hectáreas ? false : Dist_Por == TIPO_DIST_COSTO.CCosIndirecto ? false : false;
If you read through just the first ternary, you’ll notice the pattern: if the field equals Directo, this is false. If the field equals Plantilla this is false. If the field equals Hectáreas, it’s true. If the field equals CCosIndirecto, also true. And when you write it out that way, it’s just a simple or expression: ColHectarias.Visible = Dist_Por == TIPO_DIST_COSTO.Hectáreas || Dist_Por == TIPO_DIST_COSTO.CCosIndirecto;
The ColPorcentaje column is even worse: it’s only visible when Dist_Por equals TIPO_DIST_COSTO.Plantilla.
Our anonymous submitter adds:
Simple, right? If only, starting with the fact they even got the
ColHectariascolumn name wrong: it should have beenColHectareas. Do not make the mistake of assuming those are the only lines with issues or this is the first time it happens. I known the person who wrote that and if I had any choice in the matter I would never, ever, look a their code, because my sanity drops every time I do.
[ad_2]
Remy Porter
Source link
[ad_1]
I recognize that our comments system here leaves much to be desired, especially with regards to the spam filter. Lots of good comments get moderated, an annoying quantity of spam gets through. But today, I want to take a moment to talk about some of the spam we get. Because we get a lot. And since most of you never see it as most of it hits our moderation queue, I don’t think you can appreciate how weird some of the spam we get is. Formatting preserved, but links- where they were present- stripped.
We’ll start with one of my “favorites”, the sycophant:
That was a hilarious and painfully relatable read — nothing quite captures the chaos of legacy code and unexpected bugs like a situation that feels like it was scripted by Murphy’s Law itself. It reminds me how important it is to approach complex systems with patience, clear thinking, and a bit of humor. Speaking of complex systems, if anyone’s exploring online gaming options, SPAMCASINO offers a modern platform with a wide selection of games and features that are a lot more enjoyable when you take the time to understand how they work and play responsibly.
I’d say they had me in the first half, but they didn’t, because nobody’s that much of a suck up in the comments here. Also, damn if the tone of your standard LLM doesn’t drive me up one side of the wall and down the other. I don’t think most of our spam is LLM generated, but this reeks of it.
With that out of the way: do you want to be a star? Our next spammer asks:
Ever dreamed of releasing your own cover version of a famous hit?
Have I!
Now you can — and for free! SPAMMUSIC is giving artists the chance to distribute cover tracks to all major platforms, legally and easily, using the promo code “FREECOVER2025”. With limited slots and time running out, this is your moment to reach new fans and expand your music career. Don’t wait — upload your cover now and join the global stage
Wow, for free you say? Um, wait, are you normally charging money for this? Wait, and “cover” tracks?
Sometimes, though, the spam gets threatening. This particular one contained no links at all, which makes it a lot harder to avoid the “not cute” hints:
I’ve put this on my wish list 2025 Devil May Cry Anime Netflix Dante Coat. I might have to drop a few hints before my birthday that aren’t so cute.
I’m not used to being threatened by spam, honestly.
Then, of course, there’s the type of spam comment which just delivers fun trivia, and contains no links or descriptions of services:
The cleanliness of cats has become proverbial. They can spend hours licking their fur, keeping it in perfect condition
Or:
Of course, there is a fly in the ointment. The main disadvantage of reusable diapers is the need for washing and drying
Maybe “trivia” isn’t the right word. Maybe this is just “bleedingly obvious things I don’t need spammers to tell me about.”
Or, if you want a longer read, how about paragraphs about space:
Often, when spaceborne garbage hurtles back toward Earth, objects such as defunct rocket parts are torn apart by the jarring physics as they can slam into Earth’s thick inner atmosphere while still traveling at more than 17,000 miles per hour (27,000 kilometers per hour) Each of the pieces from the rocket part can then pose a threat to the area where it lands.
But Cosmos 482 was well suited to make the trip home in one piece. The spacecraft had a substantial heat shield that protected the vehicle from the intense temperatures and pressures that can build up during reentry. And because Cosmos 482 was designed to reach the surface of Venus — where the atmosphere is 90 times denser than Earth’s — the probe likely remained intact.
The Soviet Venera program The Soviet Union’s Space Research Institute, or IKI, ran a groundbreaking Venus exploration program amid the 20th century space race.
Venera, as the program was called, sent a series of probes toward Venus in the 1970s and ’80s, with several spacecraft surviving the trip and beaming data back to Earth before ceasing operations. Of the two Venera vehicles that were launched in 1972 , however, only one made it to Venus.
The other, a spacecraft sometimes cataloged as V-71 No. 671, did not. And that’s why researchers believed that Cosmos 482 was the failed Venera vehicle. (Beginning in the 1960s, Soviet vehicles left in Earth orbit were each given the Cosmos name and a numerical designation for tracking purposes, according to NASA.
Then there’s this one:
-The Assassin seeks a path to peace, although he himself allows murder How to get rid of a person
-Hitman World of Assassination brings together the best elements of Hitman hire a hitman
The assassin seeks a path to peace? I think this is a video game ad, but also, the link was on “hire a hitman”. A link I did not click, because if I want to send messages to my personal FBI agent, I do that on hacker forums where everyone types l1k3 4h15 a11 4h3 31m3z.
Some of the spam is shockingly honest. For example, a comment advertising “vaginal powder” that can be purchased by phoning a number in Chelyabinsk:
?? Important: – Not a medicine – Consult a doctor before use – Store in a dry place
Definitely not a medicine. Also, a sketchy powder from Russia for your intimiate areas? Is this cocaine? Would I be buying cocaine? I’m no expert on this.
We’re no stranger to critical comments here, but even the spammers are getting in on it:
Before announcing a list of our exclusive products and services with an indication of their features and benefits, we urge you not to even try to write us, begging to give you these products or provide services for free how to kill yourself
Everyone’s a critic.
And finally, there’s this masterpiece of machine translation of a, um, adult doll ad:
INCREDIBLY PRAGMATIC COITION DOLL WITH METAL SKELETON! Abide the contrariety dispute – well-deserved like a natural friend!
ULTRA-SOFT FLAY that perfectly mimics the come near of genuine human skin – indistinguishable! Anatomically on the mark proportions, no more than like a legitimate mate – every curve in faultless closeness!
WHY IS THIS DOLL EVERY HOMO SAPIENS'S DREAM?
FLEXIBLE METAL FRAME – holds any feeling you can imagine!
100% NON-POISONOUS – non-toxic medical-grade documentation, certified by CCIC – no weird smells, decent pure pleasure!
HIGHEST POINT VERSATILITY – enjoy voiced, mamma ingratiate oneself with and anything else you after!
OUTGOING CONTRIBUTION – intelligible to victual altogether and fresh!
ONLY PROFFER! Get yours any more at the best price – while stocks pattern TOP-RATED on AliExpress with RAGING REVIEWS!!
BRING SOMEONE ROUND YOUR LUXURIOUS CONFRERE NOW!
Wary removed packaging – 100% concealment guaranteed!
This isn’t honourable a doll – it’s the fulfillment of your deepest desires! Don’t long for to – **order now and experience ultimate satisfaction!
It’s PRAGMATIC. It has ULTRA-SOFT FLAY. It’s EVERY HOMO SAPIEN’S DREAM. People are asking a lot of questions already answered by the “100% NON-POISONOUS” label, and buddy, let me tell you- it might not ship with weird smells, but I can pretty much guarantee that it will end up with weird smells.
Anyway, I’m gonna go mamma ingratiate myself.
[ad_2]
Remy Porter
Source link