Talk:Programming idiom

message: I'd like to have a category/list of idioms that would include things like Graceful exit, Schwartzian Transform, and so on. I'll have to think about the scope of that first. Joseph N Hall 02:30, 31 August 2006 (UTC)
thread_title: Talk

message: One idiom that has to be "written by hand" in many languages is to step over the members of two or more lists (or arrays, trees, etc.) at once.
In Lisp, there are idioms using DO or LOOP which explicitly allow you to move through two structures at once. In C, you can do it with comma-separated steps in a for(;;) expression, but it's unusual and considered obfuscated; the idiomatic thing is probably to write it by hand in a while loop. In Python, you use tuple unpacking and zip for lists, but for any other structure you'd probably do it by hand (or maybe use iterators). And in Haskell you'd probably lift the traversal operation for the data structure into the list monad. --FOo (talk) 05:45, 10 December 2009 (UTC)
thread_title:  Parallel looping / traversal of lists or other structures 

message: Programming idioms also show up in data structures. For example, there are particular ways to express graphs using (say) lists and/or maps. -- RichMorin (talk) 00:58, 1 August 2012 (UTC)
thread_title:  Idioms also show up in Data Structures 

message: Some WP:DUP content was trimmed down, but now article looks like a stub. Also, there weren't any sources, so I propose to merge it with bigger topic.
Programming language theory was closets page I was able to find, if there better candidates, I don't mind. Ushkin N (talk) 14:01, 27 May 2016 (UTC)
replies: text: These two topics are unrelated and should not be merged. —Ruud 14:07, 27 May 2016 (UTC)
replies: text:  Then suggest a better parent article. Ushkin N (talk) 14:08, 27 May 2016 (UTC)
replies: text:  No. It shouldn't be merged at all. —Ruud 14:10, 27 May 2016 (UTC)
thread_title:  Merge 

message: In the version of the book I was able to find, "programming idiom" used 2 times without definition what "programming idiom" is. 
User:Ruud Koot, can you provide direct reference from "Design Concepts in Programming Languages" where it is defined? Ushkin N (talk) 15:41, 30 May 2016 (UTC)
thread_title:  Programming idiom in "Design Concepts in Programming Languages" 

message: In my version of the book:
* p 169 ... "Consider the programming idiom illustrated in Example 3.22."
* p 180 ... "The ML type system, for example (Section 7.2.4), avoids the dynamic type checks of Lisp, but disallows certain useful programming idioms that Lisp supports. Similarly, the definite assignment rules of Java and C# (Section 6.1.3) allow the compiler to ensure that a variable is always given a value before it is used in an expression, but disallow certain programs that are legal (and correct) in C."
* p 265 ... "In functional languages, the ability to specify a function “in line” facilitates a programming idiom in which the body of a loop is written as a function,with the " <...>
* p 426 ... " The usual programming idiom looks like this:
if (!setjmp(buffer)) {
/* protected code */
} else {
/* handler */
}
"
* p 560 ... "This programming idiom—an unbounded generator with a test-cut terminator—is known as generate-and-test." ...
* User:Ruud Koot, which of the statemets you claim to be an definition of "Programming idiom" in "Programming Language Pragmatics"? Ushkin N (talk) 15:50, 30 May 2016 (UTC)
thread_title:  Programming idiom in "Programming Language Pragmatics" 

message: As was stated above, there no source, defining what "programming idiom" is or simply enumerates all "programming idioms" in existence. 
Can anyone provide source for Programming idiom? WP:V Ushkin N (talk) 15:54, 30 May 2016 (UTC)
thread_title:  Definition of the Programming idiom? 

message: It's suggested in this page that th use of idiomatic, to mean a typical means of doing something (in programming), is incorrect, and instead idiosyncratic should be used. Not only does this fly in the face of idiosyncrasy's definition, but I can't find any other reference to this use of idiosyncratic to somehow mean typical. 
Should this be amended somehow? Understandably idiom means something different from its standard definition in this context, but idiosyncratic doesn't seem appropriate either. 
Schmake (talk) 22:28, 13 October 2021 (UTC)
replies: text: I agree that 'idiosyncratic' is the wrong term here. I think the author of this section has conflated 'programming idioms' with 'programming idiomatically'. I've added a disputed tag for this. Ted BJ (talk) 22:02, 23 June 2022 (UTC)
thread_title:  Idiosyncratic = Typical usage?  

message: The list doesn't even contain idioms, those are just basic statements in prog.-langs that anyone would find in the official docs. I suggest we add better examples, and remove the current ones Rudxain (talk) 19:23, 25 April 2023 (UTC)
thread_title:  Examples are incomplete