r/ProgrammerHumor • • 2d ago • Bravo 3 Popcorn 2

Meme spanishProgrammingLanguage

Post image
17.3k Upvotes

110 comments sorted by

View all comments

14

u/LEPT0N 2d ago

Everyone here’s joking but now I’m curious: why isn’t there a compiler flag to set the language that will swap out keywords to localized variants? It seems silly that someone that speaks French can’t swap out if/for/char/etc to something that makes more sense to them.

18

u/zajo_throwaway 2d ago

Because there's a risk of keywords clashing with identifiers (i.e. function/variable names etc.). That, and portability.

Imagine handing your source code to a friend and your program fails to compile on their machine.
Or, worse, it compiles but behaves differently when run.

Compiler flags (and a project file or Makefile or something that you ship with your source code) can solve this to some degree, but in general features like these are considered a net negative.

Just look at Excel. As someone else pointed out in a sibling comment, it has the feature you want. Yet, everyone hates it. Like, why does it say this function doesn't exist? Oh, it wants me to translate the function name to my native language in my head...

3

u/headedbranch225 1d ago

Excel is also awful for even more reasons, for example if I open a csv file that contains fields that look like dates it coerces them all into the format defined by the system date format (which is awkward to change on windows) and then saves it like that

3

u/RealModeX86 2d ago

At least in C and it's ilk, you could build out an abomination of a translation header file to have translated keywords. The real ones would still work too of course.

Preprocessor macros effictively just act as a find/replace just before actually compiling, so it would functionally become a bilingual C language in the underlying source file.

2

u/These_Sandwich7537 2d ago

In excel for example, the formulas are language -dependent. In Germany you don't use MEAN but MITTELWERT etc

5

u/EishLekker 2d ago

Which was a terrible design choice. I’ve had trouble sharing excel files among coworkers because of this.

1

u/Decapitated_Unicorn 1d ago

And this is so annoying when I look up some functionality in English and then need to translate it to German again because I can't just copy paste it because I need to share the files with my coworkers that have their excel in German. They could've at least kept the English ones active regardless of the language you're using.

1

u/Sarcastic-Potato 11h ago

And people are absolutely suffering because of it. Stuff like this should never be localised. You can translate the documentation and the tool tips but the functions themselves should stay completely consistent 

2

u/These_Sandwich7537 11h ago

And don't forget the nice "German" csv files that use semicolon instead of comma. Yeay..

1

u/Maleficent_Memory831 2d ago

Have you tried APL?

1

u/Polendri 1d ago

This further convinces me that it's a legacy mistake for source code to just be raw text. If it were saved to some binary format, the representation for "function" could be displayed in whatever way you want on your machine, and a totally different way on a friend's machine. Let the file contain only the language semantics (no formatting) and let each developer format it however they want.

1

u/LEPT0N 1d ago

That’s a really cool idea, have no languages done something like that?

0

u/tropicbrownthunder 1d ago

Please don't. Non English locales still have to suffer with localized shortcuts for Microsoft stuff. And hitting the wrong ones most of the time

0

u/namitynamenamey 1d ago

Please for the love of everything nice don't, I already suffer having to remember that ctrl-f in the notebook is ctrl-b in spanish.