Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

What is the opposite of "idiomatic", other than not idiomatic? Is there a concise way of expressing this concept or describing such a code?

share|improve this question

migrated from programmers.stackexchange.com Mar 26 '13 at 16:18

This question came from our site for professional programmers interested in conceptual questions about software development.

3  
Can you explain which sense of 'idiomatic' you have in mind? Perhaps unnatural-sounding is closest to an antonym for the primary meaning, but transparent or decomposable, or literal come closer to antonyms for the other common sense. –  Edwin Ashworth Mar 26 '13 at 16:30
    
If something is not idiomatic, then it's unidiomatic. –  nohat Mar 26 '13 at 20:59
add comment

7 Answers 7

Unconventional or even simply, non-idiomatic.

By idiomatic, you refer to code that conforms to the standards of the language. If you are using non-conventional code, you do not fully conform to the language but instead somehow write a code to accomplish the task at hand.

In technical circles, it is safe to stick to non-idiomatic, because in that case, people knowing the technical definition of idiomatic will be clear about the intention.

share|improve this answer
2  
not sure you need non-idiomatic when unidiomatic will do. –  nohat Mar 27 '13 at 0:19
add comment

If I understand your question, you are looking for a term that describes code that would be implemented in such a way that few programmers would recognize.

A programming term that is used is anti-pattern, namely a practice that is the opposite of what the Gang of Four recommend. (I am thinking where an iterator pattern is called for, but the programmer uses, say, a numeric index instead. However, I can also imagine idiomatic code that would fall into an anti-pattern.)

If you're looking for a more generic adjective, then perhaps atypical, unconventional, or egregious might suit.

share|improve this answer
1  
I don't think you can just say egregious code by itself the way you could say ugly or awkward. –  tchrist Mar 26 '13 at 16:40
    
I was guessing a bit at the OP's underlying question, and believe the OP is looking for code that is not written in a conventional manner. I had the etymology of egregious in mind ("out of the herd"). In contrast, ugly is an attribute apart from the social dimension. –  rajah9 Mar 26 '13 at 17:18
    
I recall from "The C Programming Language" (also called K&R) an example about copying a string. The code was something like while (a*++) p* = a*; Understanding the code entailed knowledge that strings were null terminated; knowledge that the inside of a while loop continued until the expression evaluated was 0; and knowledge of pointer arithmetic. K&R's comment acknowledged that it was cryptic, but also admonished the reader to become familiar with it, because it was a standard practice. Here's a case where the code is both idiomatic and ugly. –  rajah9 Mar 26 '13 at 17:53
    
Hey, what’s so ugly about while (*dst++ = *src++); anyway? That’s what we call elegant, not ugly. ☺ –  tchrist Mar 26 '13 at 19:50
    
Touché, @tchrist. Because the OP has been reticent about describing idiomatic, we may only conclude that the opposite is non-idiomatic. (Elegant, ugly, or awkward are probably orthogonal. I'm still pulling for anti-pattern.) BTW, if you have K&R handy, would you be so kind as to pull their commentary about while (*dst++ = *src++)? And thanks for cleaning up the example. –  rajah9 Mar 26 '13 at 20:46
show 3 more comments

Idiosyncratic derives from the same Greek roots as idiomatic but has an opposite connotation. Both refer to peculiarity, but where idiom is a usage that has become customary in a community, idiosyncrasy is an individual quirk.

share|improve this answer
add comment

I would suggest "uncharacteristic", "atypical", or possibly "foreign".

share|improve this answer
add comment

Seems to me, all idioms aside, that all we really need here to describe good old straightforward code is to describe it as standard code.

"While Frank wrote idiomatic code that no one could understand, Harry wrote standard code, much easier to follow."

share|improve this answer
add comment

Since you mention code, you might consider using the word longhand.

You could express that loop idiomatically using a standard algorithm instead of writing it out longhand.

share|improve this answer
add comment

Based on the fact that this question was migrated from programmers.stackexchange and the fact that the question says "as in idiomatic code", I assume the OP means idiomatic in the sense of "structured" and/or "natural" (i.e. as in http://www.stackoverflow.com/questions/84102/what-is-idiomatic-code)

For this reason I would suggest either unnatural-looking code (since code is rarely read-out) or even more simply unidiomatic code.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.