r/badcode • • Aug 27 '21

python Is this code bad or sugoi?

Post image
1.0k Upvotes

154 comments sorted by

View all comments

595

u/delta-samurai Aug 27 '21

This is the first piece code I've ever seen in another language

140

u/Architector4 Aug 27 '21

look up 1C programming language code examples

you probably will be horrified

30

u/[deleted] Aug 28 '21

11

u/TigreDeLosLlanos Aug 28 '21

The standard was also available in Braille.

True programers don't need a screen.

4

u/nighthawk648 Aug 28 '21

Cool there's like a total of 5 registered uses for each one

→ More replies (1)

72

u/mrissaoussama Aug 27 '21

thankfully there's only one arabic programming language

43

u/Schlipak Aug 28 '21

You can imagine my pain when back in school they made us use some shitty CASE software (Computer-aided software engineering) that uses its own language that lets you code either in french or english, or both at the same time if you want to. And they also have a chinese version.

Absolute madness.

7

u/Blackbird-ce Aug 28 '21

We do code reviews as a service, and have so often encountered French, Dutch and German variable names, documentation/comments, method names, etc. The whole idea that maintenance of the code might some day be outsourced to someone non-native often does not occur

3

u/the_vikm Aug 28 '21

he whole idea that maintenance of the code might some day be outsourced to someone non-native often does not occur

I've encountered people that did this intentionally so their work "couldn't be outsourced"

2

u/blamethemeta Aug 28 '21

Gets outsourced anyway, company can't make any changes to code base

→ More replies (1)

5

u/nighthawk648 Aug 27 '21

Because why would you ever? That seems like such a fucking headache writing a compiler, and syntex tree parser for a foreign langauge... if I was asked to program that, I'd probably leave the industry

113

u/TinyBreadBigMouth Aug 28 '21

...What? Why would you need to write a custom compiler? The picture clearly shows a program written in standard Python. They've just chosen to write the variable names in Japanese, which is perfectly allowed. Variable names are just text; the compiler doesn't have to learn to speak Japanese, any more than it knows how to speak English.

30

u/nighthawk648 Aug 28 '21

You know what you're right I thought some of the system reserved variables like if we're converted to Japanese. Rough day

11

u/GrandBadass Aug 28 '21

I'll have a beer for you (and me) tomorrow.

→ More replies (1)

9

u/ywBBxNqW Aug 28 '21

Someone on the Python Discord wrote something to mangle source code (basically translating characters using these) and it was horrible. The code still ran fine though.

11

u/TinyBreadBigMouth Aug 28 '21

There's less room for jank there than you might think. Python normalizes variable names, so as far as it's concerned 𝓷𝕦𝘮𝖇ℯ𝚛, 𝓃𝔲𝕞𝚋ⅇ𝓻, and number all refer to the same variable.

3

u/ywBBxNqW Aug 28 '21

This is one of the things they did. It was one of the staff members or something on the Python Discord (I don't remember their name and I don't hang out there anymore). I remember that we were having a pretty hoity-toity conversation about unit testing and the Python AST among other things then we started talking nonsense like this.

10

u/[deleted] Aug 28 '21

I forked Pinecone and created a vernacular coding language. It was fun.

9

u/nighthawk648 Aug 28 '21

You're a sadomasochist?

7

u/SkidmarkSteve Aug 28 '21

He didn't say he gets off on it.

9

u/Tusen_Takk Aug 28 '21

The implication is there

2

u/the_vikm Aug 28 '21

It's pretty ignorant to call it foreign language here. Clearly it wasn't for the creators?

0

u/nighthawk648 Aug 28 '21

All programming languages are written in English....

1

u/the_vikm Aug 28 '21

No? Even if they were, doesn't make English the native language for everyone

→ More replies (3)

2

u/Nilstrieb Aug 28 '21

Writing a language in a different language is just as easy/hard as writing an English based language. The problem is just that this language would not be very used or liked and that's for a good reason. English is the way to go in programming, always.

→ More replies (1)
→ More replies (6)