variable naming

programming concepts

Curly's Law: Do One Thing

In Outliving the Great Variable Shortage, Tim Ottinger invokes Curly's Law: A variable should mean one thing, and one thing only. It should not mean one thing in one circumstance, and carry a different value from a different domain some other time. It should not mean two things

By Jeff Atwood ·
Comments

programming languages

Variable "foo" and Other Programming Oddities

If you've ever viewed UNIX documentation, you've probably encountered variables foo and bar at some point. Here's a Ruby example I found in the newsgroups: foo = 0 bar = 0 1.times do foo = 1 foo := 2 bar = foo+1 end puts foo, bar O&

By Jeff Atwood ·
Comments