8 ms·
Programming uses the same words as regular English, but it is a completely different linguistic register, so there is never any conflict. It’s like working in a
by malodyets 7y ago
Programming uses the same words as regular English, but it is a completely different linguistic register, so there is never any conflict. It’s like working in any field with its own jargon — you use the meaning that is relevant to the context. In linguistics this is called the Relevance theory of meaning and interpretion, which explains why we do this contextual interpretation easily and mostly without thinking about it.
I am a native English speaker and former ESL teacher with a masters degree in applied linguistics, as well as veteran developer.
- tuesdayrain 7y ago> Programming uses the same words as regular English, but it is a completely different linguistic register, so there is never any conflict. That's debatable. It's impossible for me to say "if" in any context without thinking about programming now. I can't help it.
- malodyets 7y agoThat's a good point: "never any conflict" describes the final state rather than the growth process. When I was a younger programmer (as in, during the first few years), I discovered that assuming boolean / formal logic meanings for {if, or, else, and} in communication with my spouse (art + sales, and very smart, though not a programmer or trained in symbolic logic) resulted in, shall we say ... miscommunication. So I had some unintended help in building the separate registers of meaning / communication. :-) Building separate meaning registers for communication does take some time.
- narag 7y agoBy the way... has or in English a different meaning than in code? I cringe every time I hear the and/or thing translated to Spanish, usually several times in a row. Not sure if it's the usual mistranslation or it's also idiotic in the original text.
- Thorrez 7y agoYes, "or" in English often is more similar to xor in code. For example if someone says "I want pizza or a burger", that person probably does not want both pizza and a burger for the same meal, whereas in programming an equivalent expression would be satisfied if both are true simultaneously. But "or" in English doesn't always mean xor in code. Sometimes it is the same as or in code.
- gugagore 7y agoThere's another way that or_English is different, as illustrated by this frustrating "joke": 1: do you think it's A or do you think it's not A? 2: yes (assigning a truth value to the or expression rather than indicating which or operand is true.)
- skissane 7y agoEnglish "or" is ambiguous between inclusive and exclusive meanings. Most of the time, the intended meaning is inferred based on context, but one can make it explicit by using phrases such as "but not both", "exactly one of", etc. There exist languages which lack this ambiguity. Latin has two different words for "or" – "vel" (inclusive) and "aut" (exclusive).
- malodyets 7y agoIt depends on the intonation: / = rising, \ = falling "Do you want /pizza or a \burger\?" = XOR "Do you want /pizza or a /burger/? = OR (as in programming) It can make a good (though well-worn) joke to answer the XOR version with "Yes."
- namelosw 7y agoIn most programming languages the boolean operation 'or' is actually 'xor'. But in type system the disjunction concept represents 'either', the concepts are more like how people refer to 'or'.
- dragonwriter 7y ago> In most programming languages the boolean operation 'or' is actually 'xor'. I can't think of any where that's true; logical “and” and “or” are usually exactly what they claim to be, and many languages implement both as short-circuiting operators, whereas XOR can't short circuit because you can never know the result without considering both arguments.
- richrichardsson 7y agoThe old classic: Programmer's spouse: Honey, go to the shops and buy 1 bottle of milk, if they have eggs buy 6. Programmer brings home 6 bottles of milk.
- majewsky 7y ago> Programming uses the same words as regular English, but it is a completely different linguistic register, so there is never any conflict. Moreover, when you cross over those jargon terms into their regular meaning, hilarity ensues. For example, you can easily prove that oaks are infinitely tall in winter. Start by observing that in winter, oaks don't have leaves. Then consider the graph-theory definition of "tree" and "leaf".
- falcor84 7y agoAlternatively, oaks do not have any nodes at all in winter
- TuringTest 7y agoIt depends, do they have any branches?
- majewsky 7y agoAn oak without nodes? Pretty sure that's just a seed.
- TallGuyShort 7y agoThere's the old joke about the programmer who was told to go to the store for bread, and while they were there, to get eggs. Still at the store, getting eggs.
- _emacsomancer_ 7y agoWhile some things are arguably vaguely close in meaning, e.g. `loop`, there are plenty of things which are essentially meaningless (or only coincidentally are words in English) like `car`, `cdr`, `cons`.
- outlace 7y agoYep. Virtually no word has a concrete meaning without a context. For example the word “guys” which may mean a group of males or just a generic collection of people irrespective of gender depending on the context in which it is used.
- inopinatus 7y agoIt can also mean ropes that are anchoring an object. "When camping, I enjoy pegging the guys" for example.
- Falling3 7y ago"When camping, I enjoy pegging the guys" can also have a wildly different (sexual) meaning.
- hombre_fatal 7y agoOur friend @inopinatus was certainly making that joke.
- deleted 7y ago[deleted]
- inopinatus 7y agoNot sure what you mean. In this example, I’m just pitching a tent.
- daveslash 7y agoDuring nice weather, I usually like to open the fly.
- cmroanirgo 7y ago> Programming uses the same words as regular English Let us be clear that this is US English and not British, but I agree with your sentiment: that the keywords are more a linguistic jargon than anything. Although the main topic here is about other languages, there are also nuances within the two main streams of English that it's also a little wierd sometimes. For me, I spell color with a U: ie. colour, but when coding, it's always been the US variant. I've typed this word so much that when I need to type it in my variant, that colour just looks wrong, even though it's the correct spelling in (my area). Occasionally, when skimming British code, I've come across colour variables and it looks wrong. Similarly, I've looked at French code and there are similar strange things that leak out. The same for Russian and Japanese code I've encountered, eg: > function <insert_diacritic_or_kanji_here>(char p)...* The purist in me really wants to state: "everyone should type US English", but the more accepting part of me concedes that maybe keywords should be internationalised (/internationalized) too. Maybe a preprocessor system would suffice (eg somecode.c.jp -> somecode.c), but as you state: it doesn't seem right because of the 'jargon' nature of it. The good news is that machine code and punch cards have no language, so maybe we could revert to using that and then we can neatly skip over this issue entirely ;-)
- satori99 7y ago> The good news is that machine code and punch cards have no language Aren't most instruction names are English abbreviations? Maybe we can internationalize those too. Just to be consistent of course.
- cmroanirgo 7y ago> Aren't most instruction names are English abbreviations? I think you're thinking of boring old assembly...? eg (a move instruction): > MOV EAX,15 Yes you're right about the abbreviated english, but that's why I didn't suggest it as an i18n solution.
- satori99 7y agoyeah, indeed i was