3 ms·
"write efficient code" / "be as clever as you want" doesn't actually tell anybody anything, though. If they know C, try to explain the idea of higher-order func
by silentbicycle 18y ago
"write efficient code" / "be as clever as you want" doesn't actually tell anybody anything, though. If they know C, try to explain the idea of higher-order functions, etc. in terms of passing around function pointers, perhaps. Also, definitely something about trying to contain side effects as much as possible. Maybe relate it to the sort of problems with global variables that have bitten most people at some point? If they are sufficiently interested, I would point them to the John Hughes paper, "Why Functional Programming Matters" ( http://www.cs.chalmers.se/~rjmh/Papers/whyfp.html http://www.cs.chalmers.se/~rjmh/Papers/whyfp.html ) and Raganwald's post about it ( http://weblog.raganwald.com/2007/03/why-why-functional-programming-matters.html http://weblog.raganwald.com/2007/03/why-why-functional-progr... ). Then, OCaml or Haskell.
When talking to non-programmers (i.e., most people), try to speak their language, especially if you know their interests / areas of expertise. Failing that, I usually fall back on cooking, because even if somebody doesn't have any experience making bread from scratch or what have you, it's not completely out of left field the way science and math can be. Everybody eats.