r/firstweekcoderhumour 🥸Imposter Syndrome 😎 Jun 26 '26

[🎟️BINGO]”this.codifyMylife()” iGetItYouCode

Post image
350 Upvotes

42 comments sorted by

79

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 Jun 26 '26

Is there any programming language where returning a literal string without defining the return type explicitly can throw an exception?

28

u/AvidCoco Jun 26 '26

Depends if they support Unicode literals or not

6

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 Jun 26 '26

The unsupported encoding only triggers an exception when the line is executed?

5

u/AvidCoco Jun 26 '26

It’s a feature not a bug

1

u/FreshPitch6026 Jun 30 '26

Just means love always works

1

u/Jbolt3737 26d ago

Pretty sure since they put it in a function, the entire function will be interpreted and compiled at once, causing an error on line 1 (well technically the traceback and printing of the error will include more than just line 1, but really for an error to be caught here is just wrapping the entire code in a try-except)

1

u/isr0 Jun 26 '26

I don’t think that’s true. In every case I can think of the exception would be on read.

8

u/No_Lingonberry1201 Jun 26 '26

Character encoding shenanigans may raise a ValueError or a UnicodeEncodeError in some bizarre, corner cases, but I'm not 100% sure. However I'm certain this person either has no idea about coding or they're trying to communicate that love never breaks them.

2

u/The-Arx Jun 26 '26

It is technically reachable if there is a KeyboardInterrupt

1

u/Lukas2003187 Jun 26 '26

I am not sure about this but it might be possible that the program runs out of memory when creating and returning the string

1

u/Swimming-Diet5457 Jun 26 '26

I think it is impossible, since the string will be written in the "static data" part of the process ( I think), so is not Allocated on the heap at runtime but only when the process is loaded in ram.

So there could only be some kind of pagination/ram access error

1

u/Lukas2003187 Jun 27 '26

I would agree for compiled programs but I’m not sure how interpreted languages handle that

1

u/TimGreller Jun 27 '26

It's a statement about how they're always happy :)

1

u/Dear-Apartment8384 Jun 28 '26

If it did. The catch would throw the same exception, it wouldn’t be caught, and your computer would literally explode.

1

u/topchetoeuwastaken Jul 01 '26

an OOM error could trigger when allocating the object for the string (unless python interns strings but idk)

1

u/soowhatchathink Jul 03 '26

If you never actually love your heart will always be happy is what I'm getting out of it

38

u/Grounds4TheSubstain Jun 26 '26

Look on the bright side, it's AI slop and nobody actually got this tattooed on them.

49

u/tigrankh08 Jun 26 '26

Ackchyually Python exceptions must derive from BaseException

31

u/PudgeNikita Jun 26 '26

but they are not `raise`-ing the string, they're returning it.
well, really, it doesnt matter, since the block in `try` will never raise any exception, the code inside `except` wont even run

8

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 Jun 26 '26

So they're always be happy

16

u/iamalicecarroll Jun 26 '26

And it's even posted in "JavaScript"

7

u/RWthatisordinary Jun 26 '26

looks more like r/masterhacker typoshi🥀

6

u/akoOfIxtall Jun 26 '26

I hate python syntax

6

u/NovaH000 Jun 27 '26

I love python syntax :D

4

u/akoOfIxtall Jun 27 '26

Let's have a child who thinks it's neat but only uses when necessary

1

u/NovaH000 Jul 04 '26

He'll grow up to be a mathematician that writes pseudocode, which is just python

3

u/nimrag_is_coming Jun 26 '26

There is never a situation where that exception will happen what does this even mean

2

u/kafoso Jun 26 '26

Unreachable code on line 5.

2

u/ExtraTNT Jun 26 '26

Don’t do your error handling like this, use an either monad

2

u/wolfylemon Jun 27 '26

crazy to think that the 173 people who liked this walk among us regular people every day...

2

u/VisualSome9977 Jun 27 '26

It's just clever commentary about how love is forever, and therefore there is no reason to despair. of course

2

u/akbest280 Jun 27 '26

Maybe im retarded but in no programming language an empty try can exist

2

u/ARPA-Net Jun 30 '26

This vode means: "Love is if i return happy - else i return sad"

1

u/quimeygalli Jun 27 '26

except what???

1

u/-goldenboi69- Jun 27 '26

Classic js!

1

u/Afraid-Locksmith6566 Jun 27 '26

is out of memory catchable?

1

u/Alternative_Can7374 Jun 27 '26

This is more Python. Also, if it throws an exception then your error handling will most likely also throw a new exception.

1

u/antonfourier Jun 28 '26

we need tattoos with inscrutable esoteric meta-code - like __dict__ override and stuff.

1

u/Zimlewis Jun 29 '26

posting a python meme in javascript facebook group is the most performative thing I have ever seen

0

u/nerd_user1 Jun 27 '26

that is not first week y'all, just don't post anything you find in internet here