== The dangerous appeal of the obvious For reasons that do not fit into the margins of this entry, DWiki sometimes needs to get the current Unix load average. I developed DWiki on Linux, and getting the load average on Linux is really easy; you read a line from _/proc/loadavg_, split it into three floating point numbers, and you're done. So I wrote a ((get_load)) function that did that and forgot about the whole thing. Then [[this server http://gpu.utcc.utoronto.ca/]] got changed from Linux to FreeBSD, and suddenly that code didn't work any more. (Because I had been paranoid, it didn't fail explosively; I had assumed that someday system problems might cause things to fail and coped with it.) FreeBSD doesn't have a _/proc/loadavg_; instead it has a _getloadavg(3)_ function in the C library. I gloomily contemplated how to make a C library call from Python, and on the off chance someone had already written an extension module to do it I did a Google search on [python getloadavg]. Which promptly turned up the general and supported Python function to do just this, [[_os.getloadavg()_ http://www.python.org/doc/current/lib/os-path.html]]. This not only solved my problem but would have saved me the effort of writing my ((get_load)) function in the first place, if only I had thought to look for it instead of leaping on the obvious way of getting the load average on Linux that I already knew about. This is the dangerous appeal of the obvious: just because I know how to do something doesn't mean that I know the *best* way to do something. Maybe I should keep looking slightly harder, just to make sure. (You could say my issue with [[rounding DoubleNegationEquivalent]] [[up ../programming/ClearPersonalIdioms]] was the same effect in action, although it was less obvious to me then.)