Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Excuse me, but that's what you call elegant?

From a readability standpoint I'll take the "old" version any day:

   function getFromDB(foo) {
      var result = asynchronousCache.get("id:3244");
      if ( null == result ) {
         result = asynchronousDB.query("SELECT * from something WHERE id = 3244");
      }
      return result;
   }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: