by kerkeslager · 9y ago · 0 comments
I've strongly considered writing a Spanish-based programming language--Spanish is spoken by more people than English, and Spanish is a first language a larger percentage of Spanish speakers, while for many English speakers it is their second language. It seems like a Spanish-based programming language could reduce cognitive barriers to entry to programming for a large portion of the world. Of course, if the tool chain isn't up to par it will eventually hold users back, but it's at least worth investigating.
It not a programming language where keyword are in Korean but one based on non mainstream concepts like brainfuck.
I don't name my variables using Spanish and I wouldn't want to use a programming language where the keywords are Spanish-based. Spanish is a verbose, complicated language, which is why I think it's a poor fit for the task of programming. I surely prefer to use "userName" over "nombreDeUsuario", "database" over "baseDeDatos", "languageSelector" over "seleccionadorDeIdioma", "propertyToggle" over "conmutadorDePropiedad", and "wrapper" over..."envolvedor", I guess?
It gets worse with actions: "buttonClick" may, depending on who you ask, become one of these: "clickEnBotón", "clickEnBoton", "clickBoton", "botonClick"... (there isn't an obviously sensible choice, since all of them have their faults: 1 is tedious and long, 2 is slightly easier to type but incorrect, number 3 is incorrect Spanish, number 4 tries to mimic English and is thus incorrect too); "pageNavigationStarted" would be something like "navegaciónPáginaComenzó", which is long and incorrect according to this language (proper version would be "navegaciónEnPáginaComenzó", even longer).
You can't make verbs so easily, in English you can make a verb from any substantive, you can't do that as easily in Spanish.
In Spanish you have to use "filtrar", "filtra" and "filtro" (to filter, filter, filter), and to express "filterStarted" you'd have to choose between "filtradoComenzó", "filtradoComenzo", "filtroComenzó", "filtroComenzo", "filtrarComenzo", "filtrarComenzó".
Maybe I just don't like it.
Technically, `clic` is a noun in Spanish, not a verb, so, if you are talking about an action, the correct name for the variable would be `hacerClickEnBotón`.
At the same time, although more verbose, it would be interesting to see how a language in Spanish would work, once sensible conventions are set.
As a person who loves thinking about names, in your filter example I see that, just by changing one letter, one can be more precise in the exact meaning of the variable or method name.
Anyway, I am not saying that people should use Spanish when programming. Having English as the common language for our profession is a great advantage.
English is really good as a language for code, because it is a (mostly) analytic language rather than a synthetic one. Indeed, it's the places where it is inflected that usually cause trouble, like singular/plural distinctions (think about how ActiveRecord handles this in mapping class names to tables).
I suspect the reason this hasn't caught on is that there just aren't that many keywords to learn, and that paying the ongoing tax of having to translate every code example on the web is worse than the one-time cost of just learning the keywords in English. This is for "real" programming use cases anyway; it might be a different consideration for educational languages.
Not really, consider most of the established code/programming materials is in English. Learning programming is far more than learning the syntax of one language.
English is much bigger than the population of its native speakers. Frankly speaking, if a project is not presented in English on github, I won't take it too seriously.
Disclaimer: English is not my mother tongue.