Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the definition of 'Idiomatic' as in Idiomatic Javascript?

In Anders first talk on TypeScript, he uses the phrase 'idiomatic javascript" several times.

What is the definition of idiomatic as it is used here?

I have looked this up on Wikipedia, SO search etc, but still feel I don't fully understand what the word means in this context.

Greg

like image 892
Greg Gum Avatar asked Feb 16 '14 09:02

Greg Gum


People also ask

What does idiomatic mean in programming?

So, in software engineering “idiomatic” means “conforming to the natural mode of expression in a given context”, where that context can be a programming language, like Kotlin or JS, or even a framework like React or RxJava.

What is idiomatic and non idiomatic?

Idiomatic and non-idiomatic meaningsThe same expression or phrase can be used in more than two contexts. The word "break" has many meanings. The literal meaning is called non-idiomatic meaning and the other formed phrases (noun + preposition / verb + preposition) have idiomatic meanings.

Is there a word idiomatic?

peculiar to or characteristic of a particular language or dialect: idiomatic French. containing or using many idioms. having a distinct style or character, especially in the arts: idiomatic writing; an idiomatic composer.

What is idiomatic style writing?

An idiomatic expression is a turn of speech that makes sense in one language, but if translated literally into another no longer makes sense. Some examples: put out the cat, put out the light, take a walk, take a bath, take a moment. The use of English prepositions is largely idiomatic.


1 Answers

Idiomatic here means "How people who write JavaScript write JavaScript".

It means "Natural to the native speaker".

For example, returning an object is considered by some idiomatic JavaScript:

function foo(){     return {x:3,y:5}; } var point = foo(); 

While "out parameters" are considered less idiomatic:

function foo(out){     out.point = {x:3,y:5} } var out = {}; foo(out); point = out.point; 

Another example of idiomatic JavaScript is the use of closures.

like image 109
Benjamin Gruenbaum Avatar answered Sep 22 '22 22:09

Benjamin Gruenbaum