9 ms·
The language of programming
- serge-nsk 9y ago"The year was 1997, Russia. None of us had a computer at home." You forgot to add few buzzwords: KGB, Stalin, Perestroyka. Enough for me. Year 1989 I had computer at home (386sx) Now I have them 5 or 7 and do not want to hear from guys who estimate PC number for a value of their prosperity. Don't worry. Be happy. And don't tell us tales.
- DonbunEf7 9y agoNames should be automatically generated. Alpha-equivalence should be trivial. English shouldn't be required, but you're not going to get away from requiring something of equivalent expressiveness at some level.
- posterboy 9y agoRuby allowing utf-8 identifiers is successfully used with Japanese. Using symbols instead of a few english keywords would completely solve the problem, maybe using configurable automatic string replacement to get the symbols, comparable to IDEs like coq.
- hprotagonist 9y ago>functions with names like reify or transduce are commonplace. Neither 'reify' nor 'transduce' are particular to english. They're both Latin. I'm reminded of Feynman's experiences lecturing in Brazil. He got complimented on his rapid grasp of Portuguese, when in fact he was exploiting the fact that all the big fancy Portuguese technical words were either Latin or Greek. He was perfectly able to talk about Physics, but he was unable to order himself a sandwich.
- rntz 9y agoYes, but they are familiar - or at least, not entirely unfamiliar - to English speakers because English has inherited a lot of vocabulary from Latin. Other European languages have, too, so maybe names like "reify" or "transduce" might be somewhat approachable to a Portuguese speaker (although I wouldn't bet on it); but are they approachable to a Mandarin speaker?
- jholman 9y agoDid you just claim that "reify" and "transduce" are "at least not entirely unfamiliar" to typical English speakers? Really?
- lemming 9y agoI disagree that most native English speakers would be able to give you a reasonable definition of 'transduce', let alone 'educe'. I love Clojure, but I find the naming cult a bit absurd from time to time. I suspect that most Clojure programmers just learn them as abstract words, much as a non-native speaker would and as the OP describes.
- swsieber 9y agoI agree with you on the definition, but ... It'd be easier for a native speaker to attach a somewhat correct meaning to transduce because of familiarity with words like translate, transfer, transform, induce, reduce and deduce.
- swsieber 9y agoI agree with you on the definition, but ... It'd be easier for a native speaker to attach a somewhat correct meaning to transduce because of familiarity with words like translate, transfer, transform, induce, reduce and deduce. So while most people couldn't define them, they are familiar with both parts of the word and that would make it easier to remember and to understand in when seen in its context.
- hprotagonist 9y agoat least part of what i was getting at is that this statement is true not only for English, but also for French, German, Italian, Spanish, Portuguese, etc. while it's less true for Russian, it's true to some extent because Russian and greek share many roots, especially for technical language, and loan-words are prominent features of the language.
- ivan_ah 9y agoWhat about a format for code localization for code repos? A bit like a `.pot` file for string translation, but instead it applies to names. For reading code in another language, you apply the .pot file to the code base in a separate branch and it does search and replace in the source files so you have the same code base localized (assuming utf-8 everything). When running code with localized identifiers, any single word, underscore_connected, and CamelCase identifier is "looked up" and "symlinked" to the correct identifier in the default locale (English). Think "search and replace" at the AST level of the language.
- reificator 9y agoThe topic of learning to program as a non-english speaker has come up a few times with friends and coworkers, despite all of us being native english speakers. I've proposed that languages like Golang and Swift that support unicode should go a step further, and come with a translation file for their keywords, which is then fed into the lexer/parser. It doesn't solve the problem of an international codebase, or let you switch languages as shown in the Excel example, but it would at least make it significantly easier to learn and write code in one's native tongue. And it could be available today, without significant changes in tooling on either the compiler vendor's side (except the translation tooling of course) or the developer's side.
- sbmassey 9y agoTranslating the tens of keywords in a given typical language won't get you very far though - you need translations for all the terms in all the commonly used libraries, and documentation of how to use them.
- reificator 9y agoThat is true, bare minimum you'd need to translate the stdlib, and at that point you're translating identifiers, which means you might as well go for translating everything as shown in the Excel example.
- saghm 9y ago
- resf 9y agoEvery source code file is a story. A story with characters, relationships between them, and how the characters behave towards one another. Humans are hardwired to understand the world (and by extension computers) in terms of stories. The way that programming languages allow us to write these stories is by giving us the opportunity to name things. Naming transforms code from a dumb sequence of instructions, to something that can be understood. I don't believe non-textual names have any place in programming. I have used Haskell and it is an unmitigated disaster.
- yorwba 9y ago> I don't believe non-textual names have any place in programming. I have used Haskell and it is an unmitigated disaster. If you are referring to the use of non-alphanumeric symbols, then I wonder whether you believe that calling the monadic bind bind instead of >>= would really make things clearer? Sure, one of them looks like a word that already exists in English, so it might be marginally easier to remember; but it has nothing to do with the binding you do with a rope, so its familiar appearance is actually misleading. Personally, I believe you should use names that are already part of your vocabulary (even symbolic ones like +), or combine existing vocabulary items into a description (even mixing English and symbols, as in number->string), or make up your own arbitrary words or symbols, so long as the end result is internally consistent.
- DonaldPShimoda 9y agoI think it’s more likely they may have been referring to how it’s considered idiomatic to use extremely terse variable and function names in Haskell (and indeed in most functional languages).
- chongli 9y agoThis is a habit borrowed from math. It often makes a lot of sense, however. Giving a variable a long name often unnecessarily ascribes intent to the variable. When a variable is generic enough to represent almost anything, giving it a specific name is potentially misleading.
- ky3 9y ago> For better or worse, we must agree that English has won the world’s common tongue competition. I too labor under the yoke of a foreign tongue not sung to me at my cradle. But something to keep in mind about English is that she gives everyone a hard time. No-one gets a free pass. Absolutely no-one. In a few months, POTUS Trump will visit the Queen of English. Fo' shizzle they too will have problems with the language. She'll have bigly problems, and he'll have all the rest. So the thing I do is to have something worthy to say, find people who'll appreciate it, and improvise a shared tongue for that special moment. People have always gladly met me halfway.
- axaxs 9y agoI know this comment is tongue in cheek, but honestly, it's something I've come to really enjoy about English. It's so pervasive that it changes constantly, and often times you can guess where someone is from by how they construct it. As an American, I only speak English fluently but have a passing knowledge of other languages. I wonder if any other language has similar phenomena, in a single country(excluding regional dialects, which also exist here of course).
- nine_k 9y agoRussian demonstrates this to some extent, and German, prominently.
- sattoshi 9y agoI am currently in Moscow and I can tell anybody from Moscow just by their first sentence based on pronounciation - but almost only that. That is because Russian has a governing body that dictates what "real" russian is. English has no such body. In English, words mean what people understand by them, not what they are suppose to mean.
- martimoose 9y agoFrench has a governing body (l'Académie française) but, at least in some parts of the world, spoken french is very different from what is prescribed by the Académie. Plus the accents are so diverse, here in Québec we are 7 million people (and not all of them french speakers) and we have as much difference in the way we speak depending on the region as you have in the U.S. for example. Funny thing, when we visit France, the french sometimes answer us in english, because our accent is so thick that they think french is not our native language.
- dasil003 9y agoThe author's command of English as a second language is very impressive.
- lemming 9y agoAbsolutely, I know plenty of native speakers who wouldn't be able to write anything as correct as that without serious effort, if at all.
- spc476 9y agoBack in the 80s, Infocom [1] created a database program named Cornerstone. Because it was an integrated environment, identifiers were abstracted. A line of code displayed on the screen as: xn = (A * y) * x * (1 - x) was actually stored as: id17 = (id1 * id11) * id10 * (1 - id10) and there was a mapping of internal IDs to visible names: id1 A id2 B ... id10 x id11 y ... id17 xn The upshot---you could change the name of a variable anywhere in the editor and the code would still work because the "name" picked by the programmer was not the actual "name" used by the system. I often wonder if that can't even extend to keywords in a language as well, translating this [2]: medan not_done börja för x:= 1 till 5 gör börja om person^.age = 120 så too_old(person); om person^.age > 130 så gåtill person_should_be_dead; slut; slut; into: while not_done begin for x := 1 to 5 do begin if person^.age = 120 then too_old(person); if person^.age > 130 then return person_should_be_dead; end end Or heck, while we're at it: while(not_done) { for (x = 1 ; x <= 5 ; x++) { if (person->age = 120) too_old(person); if (person->age > 130) return person_should_be_dead; } } But I'm not holding my breath on this. [1] Yes, the company that made all the text adventure games. [2] http://boston.conman.org/2008/01/04.1 http://boston.conman.org/2008/01/04.1
- sethrin 9y agoALGOL 68 was published in multiple languages, but if you meant that the interpreter could switch between languages, Perl and some others have you covered: https://en.wikipedia.org/wiki/Non-English-based_programming_languages#Modifiable_parser_syntax https://en.wikipedia.org/wiki/Non-English-based_programming_...
- jhbadger 9y agoI realize that Perl is no longer all that popular of a programming language, but it had a lot of features along these lines -- you could even program it in Latin! #! /usr/local/bin/perl -w use Lingua::Romana::Perligata; adnota Illud Cribrum Eratothenis maximum tum val inquementum tum biguttam tum stadium egresso scribe. vestibulo perlegementum da meo maximo . maximum tum novumversum egresso scribe. da II tum maximum conscribementa meis listis. dum damentum nexto listis decapitamentum fac sic lista sic hoc tum nextum recidementum cis vannementa da listis. next tum biguttam tum stadium tum nextum tum novumversum scribe egresso. cis
- tominous 9y agoI can't stand the chromatic aberration theme of the site. Please stop giving me a headache! On my phone I had to copy and paste the contents into a note in order to read it.
- frou_dh 9y agohttps://news.ycombinator.com/item?id=9238739 https://news.ycombinator.com/item?id=9238739
- omarforgotpwd 9y agoAmazing article. I wonder just how much ties to English have held computer science / software back?
- keithpeter 9y ago"I won’t lie, this looks outrageous even to me. But not to my Dad, who is a civil engineer and doesn’t speak a word of English. He is dangerously fluent in Excel’s formulas, which he uses extensively in those hundred-sheet documents bristling with filters, conditionals, and pivot tables. Then the roads and bridges are getting built based on those calculations." A cheer or two for the humble spreadsheet - the longest lasting and most widely used end-user 'programming' metaphor I've heard of, despite the estimated 5% error rate in formulas. A git for spreadsheets would be ace!
- woliveirajr 9y agoI'd like to know more about those 5%, could you give more details?
- keithpeter 9y agohttp://panko.shidler.hawaii.edu/SSR/Mypapers/whatknow.htm http://panko.shidler.hawaii.edu/SSR/Mypapers/whatknow.htm References from 10 years ago but enough to start chasing more recent stuff.
- noiv 9y agoI've found Princeton's WordNet extremely useful to name things with a fitting English word in programs. It let's you traverse the hierarchy while proposing hyponyms, holonyms and synonyms. Entry level speaker will find the example sentences useful. By avoiding invented fantasy names code becomes more readable and thus maintainable. Just resist naming anything an 'entity'. ;) http://wordnetweb.princeton.edu/perl/webwn http://wordnetweb.princeton.edu/perl/webwn
- reificator 9y ago> Just resist naming anything an 'entity'. ;) Unless, of course, it has semantic meaning in your domain, such as when creating an Entity Component System.
- noiv 9y agoStill, I'd advice using it because 'entity' is the top holonym in WordNet. I'd also argue if everything in a system is called an entity all meaning is lost and you should pick something from the lower levels of WordNet like 'thing' or 'stuff'. Never said WordNet helps to sell your product, that's an entirely different task.
- kronos29296 9y agoMaybe there should be a google translate like thingy for programming languages. Atleast the main keywords get translated. Would make lives easier. (Python would be a great language to have such a feature as it has more verbose identifiers than most other languages like C or C++)
- jhbadger 9y agoThe idea of learning programming commands by rote with no concern as to their English meaning reminds me of how a lot of people working in science learn scientific terms as simple arbitrary identifiers rather than looking at the Latin and Greek roots of the term and understanding the term from those.
- sebnap 9y agoI'm not a native speaker either. But firstly, if you don't know english in computer science you can't follow any research, any documentation and worse you can't write code that is readable like a book. Basically you are stuck like Robinson Crusoe putting together yourself a roof and a bed from banana leaf, while the whole world is on an other civilisation level. I personally hate when people start using their language to code, it's just not how it evolved and how it should be done on a professional level. If you want to play music you need to learn reading the notes first. Call me a traditionalist.
- gkya 9y agoContext matters. If its your in office code, use whatever language you want. But if it's going to be open source, english please.
- froh42 9y agoGrowing up (Generation Commodore 64, later having an Amiga) taught me enough computing lingo that I one day started to read English books. Because at some point the really interesting books didn't have German translations anymore. So there I was struggling with my English, always being happy when there were enough technical terms which I understood. (And worst thing of all - English speaking authors dare to use puns and humour in technical books. Which I didn't understand, because of the vocabulary and because we Germans would never do anything like this, we're much too serious for that.)
- gumby 9y agoGiven that the set of language keywords is typically small, learning them as opaque strings is hardly a raggedy. Nobody complains that they have to learn Italian terms like "Da Capo A la Fine" to play music. With standard libraries becoming more important, non-keyword terms like 'vector' and 'set' are also important, but they tend to be common across languages. Good luck renaming them on the fly without a serious refactoring tool.
- b123400 9y agoIf I have to choose a language for programming, I would suggest Esperanto. An artificial language that is easy to learn, and more consistent than English.