Hacker News new | past | comments | ask | show | jobs | submit login

The word "idiom" has two different senses. First, there's the sense that the author is discussing. In this sense idioms are expressions whose meanings aren't derivable from the meanings of their parts (linguists call this "non-compositionality"). The other sense of "idiom" simply means "an expression that characterizes idiomatic speech.

Now "idiomatic" also has two senses. First, it can mean "having to do with idioms". Second, it can mean "peculiar to a particular group, individual or style". (See http://www.merriam-webster.com/dictionary/idiomatic)

So, I think when people speak of idioms regarding programming languages they're using the second of the above senses. While this sense might be characterized as having to do with social mores, I don't think it's a misuse of the word "idiom". People don't mean to say that .each statements are non-compositional in the way that "kick the bucket" is. Indeed, given that programming languages have formal grammars/semantics it's hard to imagine what non-compositionality would be at all (though I'm sure any good Perl programmer could probably give some examples!)




Looking at your own linked definition I think you're wrong:

1 : of, relating to, or conforming to idiom

2 : peculiar to a particular group, individual, or style

That again says it's a local construct that isn't a clear universal usage. If you want to be clear in your writing then you avoid idiomatic speech.

This also doesn't disprove my point that the way these supposed "idioms" cause derision and overreaction says they are now social mores.


I think the use of 'idiomatic' that daviddaviddavid had in mind is this one[1]:

1. a. Peculiar to or characteristic of a given language. b. Characterized by proficient use of idiomatic expressions: a foreigner who speaks idiomatic English.

That use of the word 'idiomatic' is very common, and although it's related to the word idiom, it's not quite the same thing. An idiom, as you say, is a phrase that you can't guess the meaning of just by glossing each of the individual words (a favorite example - in Puerto Rico, though not all Spanish-speaking countries, a flatterer is a 'lambeojo', literally 'eye-licker'). But someone who speaks Spanish idiomatically or who writes idiomatic French does so 'like a native'. It's a good thing. So when someone says that 'each' is 'idiomatic Ruby', that's probably what they have in mind.

All of that said, I can understand wanting to teach beginners the for loop first. But I don't think a Ruby course should finish without looking at each. If a person plans to read any real Ruby, they had better be ready for lots of iteration with each.

[1]: http://www.thefreedictionary.com/idiomatic


If you want to be clear in your writing you avoid idiomatic speech that will be unfamiliar to your audience. Using the idioms of your audience doesn't impede clarity. The woman in _Airplane_ who "speaks jive" employs idioms to increase clarity!

Idioms, by definition, aren't universal. (By etymology, too: an idiom is idio-, one's own; think idiosyncracy or idiolect.) it. It's very odd to contrast the idiomatic and social mores.

The linguistic analogy is really confused, anyway:

"These idioms are also not language dependent, but actually locality and culturally dependent. I could move to England, the home of English, and they'd use many new and different idioms.

What you don't see is people in England demanding that I say "the dog's bollocks" in order to visit."

1. There is no single language "English" which has its home in England but is also spoken in America, Australia, Canada, South Africa, etc. The contrast between language and locality/culture is extremely tendentious.

2. You had better believe that certain changes of locality and culture are accompanied by demands that one change one's idioms. If I go for a job interview at a conservative law firm, I am not going to praise something by calling it "the shit". If I normally spoke AAVE, I would do my best to suppress that.

3. American English and British English are mutually intelligible (but there are chains of mutually intelligible Englishes whose extremities are not mutually intelligible), so you can speak AmEng in Britain. If you want to speak the way your hosts speak, though, you'll say "boot", "lift", etc. when you would otherwise have said "trunk", "elevator", etc., and you might find that some of your American idioms actually aren't comprehensible. Your British hosts might well demand that you say something they understand to them.

4. You can speak AmEng in Britain, and you can write Fortran in Ruby. It is pretentious for an American to affect an accent while in, or having come from, Britain. By contrast, it is only reasonable to do things Rubyishly in Ruby.

"Because people quite literally freak out when they see non-idiomatic code, and go to great lengths to correct everyone who doesn't write idiomatically, these can't be idioms."

So ... what do you think gets taught in elementary, middle, and high school english classes? Idiomatic formal english! You are corrected if you don't write idiomatically! Many people freak out when they see nonstandard forms of English!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: