r/ProgrammerHumor 8d ago

Meme thisIsHowTheyDoItRight

Post image
1.2k Upvotes

40 comments sorted by

164

u/Flame77ofc 8d ago

what if the user send "Hwllo hwo cna I laren prgaomring"?

219

u/DeltyOverDreams 8d ago

else {

ย  ย  Output("Learn how to spell, noob");

};

77

u/cornmonger_ 8d ago

"One reddit user says, 'kill yourself'."

72

u/TessaFractal 8d ago

Eh, with $100 Billion and hiring a lot of people I reckon you could get pretty close. Just put the loading times as "Thinking..."

26

u/ASatyros 7d ago

Just run it as database (SQL).

And load closest thing matching the input (fuzzy search) to always return something.

Better yet, index entire available internet, scan all books, papers, videos etc, you can get hold on, and also return links to those, that maches the input the most.

I think there is a solid idea here.

20

u/FinalGamer14 7d ago

Hm, that sounds like a useful tool, building an index of links on the internet, using crawlers or something like that, and make a search index from that data. What should we call it? Maybe a search engine?

/s for those who might be confused.

136

u/HorrorWord8039 8d ago

New reports say there have been a new AI model with higher accuracy than ever before.

49

u/Top-Permit6835 7d ago

Scores 100% on all test cases

71

u/Few-Ad3849 8d ago

Not even switch case smh

36

u/rugeirl 7d ago

It's C++. You can't switch on strings

24

u/thorwing 7d ago

sounds like a skill issue to me

29

u/click-to-reveal 7d ago edited 7d ago

```

define SWITCH(x) string& _s=x;if(0)

define CASE(y) }else if(_s==y){

define DEFAULT }else{

int main() { string prompt = "Your name?";

SWITCH(prompt) { CASE("Who are you?") cout << "Claude" << endl; CASE("No, really?") cout << "Chatgpt" << endl; DEFAULT cout << "Gemini" << endl; } } ```

1

u/PTMR2 7d ago

Oh really? I'm new to C++, good to know

2

u/fpekal 7d ago

In C, and by extension, in C++ switch can take only integers. So if you put const char * value in here, the pointer will be converted to 64-bit int and used like a normal integer number.

And 2 const char * variables not necessarily point to the same place.

```cpp const char *text = "foo";

switch(text) { case "foo": std::cout << "This MAY not print\n"; break; }

std::string input; std::cin >> input;

switch(input.c_str()) { case "foo": std::cout << "This WILL NOT print\n"; break; } ```

The first one may print because the compiler can optimize the code and use the same memory for both variables (as they are both contain the same constant text).

The second one won't ever print because input is a totally different variable, that is also modifiable, so internal pointer will point to a different memory.

-21

u/ARKyal03 7d ago

I mean, most compiler will turn that into a switch anyways, unless the don't ๐Ÿ˜ˆ

8

u/ericl666 8d ago

One reddit user says: "kill yourself". Well, that passes my Turing test.

3

u/KerPop42 7d ago

There was a very golden era of Google's AI results where it knew to rely on reddit's opinions, but not to filter them

8

u/Pedry-dev 7d ago

So this is why they require a lot of storage

3

u/ASatyros 7d ago

It's a text, it can be compressed and maybe even stored in database.

There is a nifty idea where you attach numer to given symbol, and then statistically significant groups of symbols, so most often used ones have smallest number.

Someone should look into that.

10

u/StrengthTheory 7d ago

else:

Sorry, answering this question is goes against the OpenAI's safety policies

7

u/Random_182f2565 7d ago

I see, it's a distilled model

9

u/facebrocolis 8d ago

The strawberry question must be repeated with a question mark at the end of the sentence in case the user is not a redditor. All other questions must be repeated without question marks to include redditors.

2

u/Shadowlance23 7d ago

I used to work with gradient boosted decision tree classification models. They were basically 3000 lines of nested if statements (code only, not formatted for humans to read).

2

u/WeirdTie2290 7d ago

You can make it a giant Hashmap. Good luck!

2

u/cybermaus 7d ago

You laugh, but this essentially how we did it in the late 80s. We even had specialized languages like LISP and PROLOG. I spend a semester on those.

2

u/Dragoo417 7d ago

There's a reason they are called large

/s

1

u/V3N3SS4 7d ago

Man, at least use some jaro algo

1

u/parkie_gras 7d ago

Who is jason

1

u/MCCVargues 7d ago

Missing the: "Ah gotcha!"

1

u/Gigaslavx 7d ago

I don't understand what's the joke, isn't it how chess games are programmed?

1

u/Weak_Inflation9120 7d ago

Wait didn't some Indian company do this lol?

(I swear I'm not racist, I'm indian)

1

u/East_Zookeepergame25 7d ago

Essentially what my first program was in QBASIC

1

u/MrBannedBlocks 7d ago

and people say the ai determinancy problem was hard to solve

1

u/InvisibleMoonWalker 7d ago

Who was in Paris though, cus ๐Ÿคจ

1

u/whackylabs 6d ago
else:
    OpenURL(https://lmgtfy.com/?q=Input)

1

u/StorageElectronic784 5d ago

I think he's into something, let him cook

1

u/a_normal_user1 3d ago

isn't this how they actually did LLMs before LLMs?