Talk:Programming idiom
![]() | Computing Unassessed | |||||||||
|
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)
Isn't i++ example of Syntactic sugar, and not really a computer language idiom? 80.216.68.41 (talk) 19:05, 25 November 2008 (UTC)
Parallel looping / traversal of lists or other structures
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)
Idioms also show up in Data Structures
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)
Merge
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)