3 ms·
One of my favorite accessor method names I've run across is 'maybeGetCube()'. The idea was that if it was cached, then it would return the cube, otherwise null
by nicpottier 16y ago
One of my favorite accessor method names I've run across is 'maybeGetCube()'.
The idea was that if it was cached, then it would return the cube, otherwise null. Cube was actually relatively aptly named, it was a big matrix of data BTW.
I guess really it wasn't THAT horrible, but the whole idea of 'maybe' doing something in code has always made me chuckle.
- rpeden 16y agoI guess you've never tried Haskell then. :) http://hackage.haskell.org/packages/archive/base/4.1.0.0/doc/html/Data-Maybe.html http://hackage.haskell.org/packages/archive/base/4.1.0.0/doc...
- chadgeidel 16y agoThere are a few methods in the .Net library for converting types called TryParse(). It's actually pretty handy, because it's an easy way get some string data munged into the type you currently want. Not that I would use this on a method that returns a matrix...
- ctdonath 16y agoThat's the whole premise of Prolog (ok, if you squint at it from the right angle). Execute steps X Y and Z, but if Z fails go back and try Y again a different way, and if that fails back up further and try X again a different way...