this post was submitted on 12 Aug 2024
1019 points (99.5% liked)

Programmer Humor

19564 readers
1165 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 3 months ago (4 children)

Is that python? If it's, thank you, finally learned how to format text in a way that can be read on the script and in the execution.

[–] [email protected] 9 points 3 months ago (1 children)

It isn't, there are curly braces. It's TypeScript.

[–] [email protected] 1 points 3 months ago (1 children)

Python also have curly bracers, om dictionaries.

[–] [email protected] 5 points 3 months ago

Yes, but not for indentation (which is obviously what I meant)

[–] [email protected] 9 points 3 months ago

As the other comments have already said it's not Python. Not sure what you mean with text formatting, do you mean that it's multiple strings that are concatenated using +? You don't need the + in Python, you can do

some_function(
    "part one of really long string"
    " part two of really long string"
)

Which is identical to

some_function("part one of really long string part two of really long string")
[–] [email protected] 3 points 3 months ago

Looks like TypeScript to me

[–] [email protected] 2 points 3 months ago (1 children)

No, but you can do the same in python

[–] [email protected] 1 points 3 months ago

I was thinking on trying it. Need to see how it works with f formatting.