views:

1467

answers:

26
+16  A: 

Duff's device is pretty famous and seems to me to qualify as technique/idiom.

DVK
@Alicia: Why did you accept this answer?
Roger Pate
It is probably the most widely-known and obvious example among those I'm familiar with, although if I could accept >1 answer I'd also prefer to accept the Carmack one as well - it's probably less known but WONDERFUL.
Alicia
I'm not +1 ing this answer PURELY as a protecst to Duff's device, which is one of the most scary things I've ever seen listed as good (or at least acceptable) programming B-) jumping into the middle of a loop... *shiver*
Brian Postow
+4  A: 

In C++, the Barton-Nackman trick.

GMan
A: 

How about: Ada named after Ada Lovelace the first computer programmer??

Aim Kai
Doesn't really count as a technique, sorry.
Alicia
Also, not invented by Lovelace..
Brian Postow
+5  A: 

I think timsort would qualify. It's used in python and open jdk 7

daveb
But that's an algorithm, isn't it?
Rene Saarsoo
Also Shell sort: http://en.wikipedia.org/wiki/Shell_sort
MatrixFrog
Don't forget QuickSort named after a guy called Quick and BubbleSort which was named after Michael Jacksons orangutan:-)
graham.reeds
+15  A: 

I used to do a "Carmack" which was referring to the "fast inverse square root" but according to the Wikipedia entry the technique was probably found by the smarties at SGI in 1990 or so.

Even if it doesn't fit your description, it's still a pretty amazing read :)

Webinator
plus one - definitely great example!
Alicia
I saw the words "inverse square root" and thought "surely that's just 'square' - how did they make *that* faster?" \*grin\*
itowlson
This is an algorithm which uses the technique of type punning.
Roger Pate
+1. "Carmack's Reverse" is the most famous code he never wrote :)
Justin Ethier
IIRC "Carmack's Reverse" is the name given to the discussion between JC and Mark Kilgurd (then of SGI) regarding a faster way of doing shadows.
graham.reeds
+5  A: 

The method of constructing programs by computing weakest preconditions, as expounded in Edsger Dijkstra's book A Discipline of Programming, is usually referred to as Dijkstra's Method. It's more of a programming methodology than a technique, but it might qualify.

Norman Ramsey
+8  A: 

In Standard ML and other functional programming languages which use tuple and record literals, I sometimes see literals written thus:

( first
, second
, third
)

or

{ name = "Atwood"
, age = 37
, position = "founder"
, reports_to = NONE
}

This highly idiomatic layout, as opposed to layout where the commas or semicolons appear at the end of the line, is something that I have always heard referred to as MacQueen style, after Dave MacQueen (formerly of Bell Labs, now at the University of Chicago).

Norman Ramsey
I like to use the same style in my non-functional programs - for me the line of commas gives a visual cue like an indent bar; and extra or missing commas become immediately obvious.
Lars
@Norman - It is a VERY widerly used style in all languages (and not only applicable to commas), and most good developers I know use it for it leads to easier code maintenance. Yet, I never realized it had a name - thanks!
Alicia
+23  A: 

The functional programming technique currying is named after its (re)-inventor, Haskell Curry.

ire_and_curses
Hmm... I'm not sure if it qualifies as a technique, but I am almost sure it does... +1
Alicia
+4  A: 

Several hard to fix or unusual software bugs has been categorized after famous scientists. Heisenbug could be the most known example.

Jonas Elfström
I know the Heisenberg one, but what other examples are there of such? Thx!
Alicia
http://en.wikipedia.org/wiki/Unusual_software_bug has a list of other ones named after scientists
Scott Chamberlain
+3  A: 

Carmack's Reverse:

Depth fail

Around 2000, several people discovered that Heidmann's method can be made to work for all camera positions by reversing the depth. Instead of counting the shadow surfaces in front of the object's surface, the surfaces behind it can be counted just as easily, with the same end result. This solves the problem of the eye being in shadow, since shadow volumes between the eye and the object are not counted, but introduces the condition that the rear end of the shadow volume must be capped, or shadows will end up missing where the volume points backward to infinity.

  1. Disable writes to the depth and colour buffers.
  2. Use front-face culling.
  3. Set the stencil operation to increment on depth fail (only count shadows behind the object).
  4. Render the shadow volumes.
  5. Use back-face culling.
  6. Set the stencil operation to decrement on depth fail.
  7. Render the shadow volumes.

The depth fail method has the same considerations regarding the stencil buffer's precision as the depth pass method. Also, similar to depth pass, it is sometimes referred to as the z-fail method.

William Bilodeau and Michael Songy discovered this technique in October 1998, and presented the technique at Creativity, a Creative Labs developer's conference, in 19991. Sim Dietrich presented this technique at a Creative Labs developer's forum in 1999 [2]. A few months later, William Bilodeau and Michael Songy filed a US patent application for the technique the same year, US patent 6384822, entitled "Method for rendering shadows using a shadow volume and a stencil buffer" issued in 2002. John Carmack of id Software independently discovered the algorithm in 2000 during the development of Doom 3 [3]. Since he advertised the technique to the larger public, it is often known as Carmack's Reverse.

Michael Stum
Except Bilodeau and Songy beat him by two years. I can't think of a single thing Carmack has actually *invented* (as opposed to implemented)
Andreas Brinck
@Michael Stum: +1 because you got the Carmack's Reverse correct... My answer got +12 upvotes, I got the name right but my memory played tricks on me for I described something else : )
Webinator
+5  A: 

ADL - Argument Dependent Lookup is also known as Koenig lookup (after Andrew Koenig although I don't think he appreciates it, as it didn't turn out the way he originally planned it)

Exception guarantees are often called Abrahams guarantees (Dave Abrahams) see (http://en.wikipedia.org/wiki/Abrahams_guarantees)

Liskov substitution principle http://en.wikipedia.org/wiki/Liskov_substitution_principle - Barabara Liskov

tony
+1 for Liskov Substitution.
Brian Postow
A: 

Perhaps Hungarian notation might qualify? It was invented by Charles Simonyi (who was Hungarian).

JonnyBoats
nope, only counts if it was invented by a guy named Hungarian, like German Chocolate Cake B-)
Brian Postow
+7  A: 

How about anything related to Bayes: Bayesian filtering, Bayesian inference, Bayesian classification. While rooted in statistics, these techniques have found their ways into plenty of programming-related applications.

Steve
+8  A: 

K&R (Kernighan and Ritchie) and Allman indentation styles.

mikerobi
+10  A: 

At one point in time, the Karnaugh Map could have been considered a technique to facilitate programming (albeit at a low level).

Steve
+26  A: 

Boolean logic? I think that should qualify.

recursive
A: 

In C++, the Schwartz counter (aka Nifty Counter) idiom is used to prevent multiple, static initialization of shared resources. It's named after Jerry Schwartz, original creator of the C++ iostreams at AT&T.

Drew Hall
+3  A: 

Boyer-Moore string search algorithm: it can find a string inside a string of length N with fewer than N operations.

Gabe
+10  A: 

Kleene closure: it's the * operator in regular expressions. It means "0 or more of what precedes it".

Gabe
+7  A: 

Fisher-Yates shuffle, the standard way to implement an in-place random shuffle on an array.

Chris Jester-Young
+8  A: 

Markov Chains are named after Andrey Markov and used in programming to generate:

  • Google PageRank
  • Generating Spam-Mail Texts
  • Mnemonic Codewords to replace IDs/Hashvalues
dbemerlin
Is PageRank named after Larry Page?
Heikki Naski
+7  A: 

The graphics world is full of eponymous techniques:

Gabe
+2  A: 

The BWT (Burroughs Wheeler Transform) is pretty important in data compression.

Eric
+3  A: 

Seriously shocked to see that no one yet has mentioned Hindley Milner Type Inference.

missingfaktor
+5  A: 

I am shocked that no one has mentioned Backus–Naur Form (BNF), named after John Backus and Peter Naur.

Paul R
+1  A: 

Jensen's Device

Heikki Naski