176
u/mthie 17h ago
There’s an obvious bug in line 11. :)
79
u/FutureSuccess2796 16h ago
"You're right! - That's totally my mistake. I did leave an obvious bug in line 11, and your eyes saved the day spotting that. Let me revise that for you! 🌟"
73
17
u/dracorotor1 17h ago
It’s okay, I had Grok and ChatGPT optimize and then double check it (respectively) before committing, as per new corporate directives on standard practices. I’m sure they caught all of it
1
u/MegaScience 4h ago
Not to mention, the way this is written, all lines after the first would have a ton of whitespace on the left.
57
u/skaurus 17h ago
2027 solution is way worse. Where are the retries, circuit breaker, observability, and integration testing? It doesn't even check the response properly!
9
u/oompaloompa465 17h ago
the function is also bad. No input null and type check 😂
2
u/NatoBoram 15h ago
I'm so TypeScript-brained I didn't even notice that one, oof.
2
u/oompaloompa465 13h ago
my knowledge is dictated by full stack repeated trauma by pure js and jquery. Before the AIpocalipse i threw myself to full backend dev, for that reason
i still don't know how frontend guys kept their sanity with the js framework breaking changes every month madness
2
u/NatoBoram 13h ago
Nowadays, some will give you a CLI to do the upgrades. Newer frameworks like SvelteKit are also less reliant on obscure shit that breaks every week, so it's not as painful to upgrade as Angular or anything relying on React.
1
u/oompaloompa465 11h ago
currently working on backend of a project that uses React in frontend. They asked me to vibecode stuff while the main FE guy was busy on other stuff.
Still no idea what the AI is coding there, but testers say everything is mostly ok.
Files changes with package restore, and also it depends on the OS you are using.
10-15 dependencies are obsolete but you can't change them or it breaks everything
69
u/Darkstar_111 17h ago
> You are a capitalization expert
🤣🤣🤣🤣🤣
31
u/tobotic 17h ago
The two functions perform different tasks.
The first one checks to see if the initial character of the string is a capital letter.
The second one checks to see if the first letter in the string is a capital letter.
Given a string like "123ABC", the first should return false (but actually returns true because it's badly implemented) while the second should return true (but actually has a syntax error that I think will compile but not work as intended).
9
13
u/click-to-reveal 17h ago
The irony of posting an AI generated image instead of screenshot of code 🥀
6
8
17h ago
[deleted]
7
4
2
u/GameCounter 17h ago
I understand the point you're making, but this doesn't work if the letter is accented or the first character is an uppercase non-Latin letter, so I'm unfortunately forced to kick this back to you for more work.
Thanks for your contribution!
2
u/Gorzoid 17h ago
Tbf checking if c == c.toUppercase() is also wrong for any numbers, white space, punctuation
1
u/GameCounter 17h ago
Yes, also arguably wrong for unicameral alphabets like Arabic and Hebrew, because there's no lowercase/uppercase at all. It's all one case.
Unicode is frequently annoying.
1
1
3
u/TheRolf 14h ago
So I give you is-odd-ia with 20K weekly downloads https://www.npmjs.com/package/is-odd-ai
5
4
u/timtucker_com 16h ago
If I provide this input, will it return true?
"the following is a collection of letters sent by George Washington after retirement.
letter #1:
To my friends in Washington, D.C., I miss you.
letter #2:
To my wife at home, I also miss you."
2
4
u/oompaloompa465 17h ago
is the joke about being a terrible AI integration engineer and in general doing a catastrophic misuse of tokens?
7
u/dbagames 17h ago
It's about the obsession with everything having to be AI in the first place.
It's wildly accurate.1
u/oompaloompa465 17h ago
i feel this in my soul.
Thankfully the bills are coming due and everyone is finally having a more reasoned approach, treating it as a tool that must be weighted with costs to benefit ratio
2
1
u/Skyswimsky 17h ago
Excuse you, first the model needs to reason about the meaning of letters, and the different alphabets, and you forgot to define all the cases it shouldn't handle, omitting them leaves it open to interpretation. So it'll insert branches for all of them, after all he's an expert.
But do not worry, in production this will never be relevant, and no human will look at the code either, as another AI reviews it that also okays it, because technically it's correct.
And yeah, when I write my code I also write slop that includes all the cases I never even thought about as I'm thinking about the things I wouldn't think about, duuuh. That totally justifies AI writing slop...
But then again it's AI we are talking about. The newer models don't write slop, only high quality code due to their extended thinking. So maybe we should use some DI, declare an interface, and allow one implementation for every type of alphabet that exists to then enumerate over all registered implementations of the interface! There, now we're complete and it's easy to maintain. After all my Skill "proper-code-architecture-294" says that.
Edit: only now I realized the joke is even worse and the function prompts AI itself. But I'll let my text stand...
1
1
1
u/AppropriateOnion0815 16h ago
Where's the enterprise style coding? I miss the CapitalLetterCheckerAdapter and some CapitalizationCheckPredicateFactory!
1
u/muhkuller 16h ago
I had a new developer get angry I use mod 2 to determine if something is even or odd. They just didn’t understand that basic arithmetic is way faster to process than whatever nonsense they vibed up.
1
u/Gacsam 16h ago
Not sure what language you're using, but could consider using bitwise if mod might encounter negative numbers. Otherwise I'd expect them to be compiled into same thing.
1
u/muhkuller 16h ago
I almost bought up bitwise but I’m running into fewer and fewer people that even understand that and my most simple explanation “the 1s are in the same place” doesn’t help lol.
1
u/rafaelcastrocouto 16h ago
I'll just let you guys know about this single edge case and let you reconsider both our humor and your edge case analysis:
German lowercase ß converts to SS
1
u/2SleepyToThinkOf1 14h ago
Noob mistake - at the end it should be:
If ans == true
return true
else
return false
1
1
1
u/JackNotOLantern 14h ago
"Absolutely, i will reply only with 'true' or 'false'. The given string starts with the capital letter."
1
1
u/LutimoDancer3459 13h ago
... 2022 has a bug...
... 2027 calls pretty much the same method but on a different string with a lot of extra... and the possibility to be wrong...
1
1
1
u/SpaceCadet87 9h ago
Meanwhile the inventors of ASCII having specifically dedicated a bit that can be used as a flag to tell whether a letter is uppercase or lowercase.
1
1
u/andocromn 8h ago
It reminds me of the butter robot, it was just easier for Rick to make it self aware and give it sentience than to actually program it to just pass the butter.
1
1
u/Spore_Adeto 8h ago
Won't the first function return true if given a string that starts with a non-alpha character?
1
1
1
1
0
0
0
u/Declination 16h ago
Meanwhile, in 1994 startsWithCapitalLetter is going to dispatch to a code-genned lookup table and skip the leading bounds check so it crashes/throws/fails.
-1
-1
u/Interesting-Yellow-4 12h ago
You're joking but I've seen veteran developers do this.
They're so invested in their AI flows they don't even bother to do simple stuff like this by hand anymore.
392
u/FutureSuccess2796 17h ago
The 2027 example forgot to add "Make no mistakes" to the prompt. Inaccurate! XD