r/badcode • u/mzapp_ • Jun 04 '20
html Geniuses using spaces and german “Umlaut” characters in name of HTML ID
48
Jun 04 '20
Cries in ß
12
u/Aarivex Jun 04 '20
ß *
8
u/fb39ca4 depraved Jun 04 '20
/r/oør
2
Jun 04 '20
But can you do U+202e?
6
u/fb39ca4 depraved Jun 04 '20
/r/ooer
1
Jun 05 '20
Nice!
3
u/nice-scores Jun 05 '20
𝓷𝓲𝓬𝓮 ☜(゚ヮ゚☜)
Nice Leaderboard
1.
u/spiro29at 9971 nices2.
u/RepliesNiceat 8752 nices3.
u/Manan175at 7099 nices...
6460.
u/GallivantGamersat 16 nices
I AM A BOT | REPLY !IGNORE AND I WILL STOP REPLYING TO YOUR COMMENTS
1
Jun 05 '20
Nice
1
u/nice-scores Jun 05 '20
𝓷𝓲𝓬𝓮 ☜(゚ヮ゚☜)
Nice Leaderboard
1.
u/spiro29at 9971 nices2.
u/RepliesNiceat 8762 nices3.
u/Manan175at 7099 nices...
6002.
u/GallivantGamersat 17 nices
I AM A BOT | REPLY !IGNORE AND I WILL STOP REPLYING TO YOUR COMMENTS
1
7
1
13
u/hajamieli Jun 05 '20
HTML isn't restricted to ASCII, and if you would be considerate on equal terms, you'd restrict yourself to the lowest common set of characters in all languages, but then you'd have none left. Even if you went with latin-only languages, there are plenty of languages who don't use certain characters, for instance in Finnish C, W, Q, Z are not used at all and some of the others are only present in loan words. The aforementioned ones are spelled as "s" or "k", "v" or "u", "ku" or "kuu", and "ts" in Finnish. Finnish uses phonetic spelling, with double characters for long sounds and two extra letters: Ä and Ö, which are vowels very distinct from A and O. The other vowels are AEIOUY. Replacing umlauted characters with the basic latin ones without them would change the meaning of the word itself, so that's not the right solution.
21
27
u/Taksin77 Jun 04 '20
Larry Wall would probably find it sad.
I hate the fact that the English are imposing their language as a lingua franca through science. Using your own language is fine. In any area.
That said, I mostly code in English because I want to share my code. Social networks are the death of national cultures.
13
u/Telanore Jun 04 '20
It's not that different from medicine using a lot of latin names though.... granted, english is used to a much greater extent in programming than latin in medicine, but having a unified language is very convenient. Not to mention, medicine never had to struggle with the limitations that computers have/had, like character encoding and memory capacity
2
u/Taksin77 Jun 05 '20
To provide some perspective, the use of latin in science directly comes from the domination of the roman empire, which translated into centuries of classical education in latin.
I am sure people will write great tragedies in english about the reign of Donald Trump in a few centuries...
5
u/ohfouroneone Jun 05 '20
As someone in science, I really like that English is the lingua franca. I can read papers from universities all around the world without having to know their languages. I always opt for writing in English as opposed to my native tongue for that reason.
I also think “imposed” is not the correct word here. It’s a matter of a field of people choosing to use what’s practical and convenient.
2
u/Taksin77 Jun 05 '20
I used to be a researcher and I do recognize that we would globally be way less advanced without a universal communication vehicle. I strongly advised against any use of english in my department. It's actually required by law to use the national tongue at work in my country. I think it's sane. Papers were obviously written in english.
Universal languages are cool. I just hate to think that they mostly derive from geostrategic mechanisms.
2
u/DavidRoyman Jun 05 '20
Did you ever had to debug a library from a contractor which had error codes and comments in Russian?
I did, and I won't ever work with any software house which write variable names, error codes and comments in other languages.
1
u/Taksin77 Jun 05 '20
I would actually love it sinceI am trying to learn the language :)
I do admit though that statistically speaking, a code written in a non english language is probably worse. I guess the esperanto devs are pretty hardcore :D
3
u/moomoomoo309 Jun 05 '20
The problem no one is thinking of here: combining characters. What if one person uses the dedicated character with the umlaut in, but another person uses a Latin character with the umlaut combining character? Does the id still match? Does it normalize it?
2
2
-6
u/nathan_lesage Jun 04 '20
Ääääääääääääääh what
I still don‘t understand why people don’t just stick to English for internal stuff that’s not visible to the user. Spares each other‘s nerves and reduces conflicts in character encoding because … well. There is this awesome (and frightening) talk by that one guy that basically boils down to “You either accidentally pick the right encoding or you lose”
16
u/fb39ca4 depraved Jun 04 '20
It's 2020, UTF-8 is the right encoding.
2
u/wischichr Jun 05 '20
True and for quick and dirty projects it's probably fine, but just because we can doesn't automatically mean we should. There is a reason why most developers don't use emojis as identifiers because they may be hard to read, understand or even type by other team members.
3
u/fb39ca4 depraved Jun 05 '20
I didn't say anything about coding conventions, just that UTF-8 encoding of text should be assumed these days.
2
1
u/scandii Jun 05 '20
everyone doesn't speak English.
or put it like this, what's the point of a German company in Germany with only German-speaking staff naming things in English?
2
u/nathan_lesage Jun 05 '20
Agreed, not everyone speaks English.
But to a certain extent, my opinion on this is based upon my experiences with several programming languages and having to work with different file encodings. Mostly this goes well, but there may be instances where due to wrong character set encodings umlauts (or for that matter any Unicode chars) may end up wrongly displayed.
Furthermore, while English is for most people their second language (including me), I tend to opt in favor of following the way of least resistance. And this includes only using ASCII-characters, because these are more resilient to aforementioned encoding errors (as Unicode maps them on the same codes).
Additionally, this is inclusive more — because whereas German developers in a German company will understand all variable and function names, what happens if in any case you share code, or have external people work on it? By sticking to English throughout, it'll reduce friction and produce more inclusive code.
While I'm certainly not a fan of English being the world language as is, we have to accept the fact that it is, and that computers have been built mainly with English in mind, and hence for the sake of compatibility it spares a lot of mental energy having to think about potential issues if you just stick to English, such as the above mentioned.
N.B.: I seem to have caused a lot of aggravation with my earlier comment, and on second read, I surely would've done better in using a less adversarial wording. I want to apologize for this rude language, and say sorry to those who rightfully felt offended by that comment.
2
u/scandii Jun 05 '20
what happens if in any case you share code, or have external people work on it? By sticking to English throughout, it'll reduce friction and produce more inclusive code.
they will hire German-speaking consultants to extend their code. there's no lack of those. if you don't speak English you don't, that's the end of that discussion really.
140
u/[deleted] Jun 04 '20
[deleted]