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

And, to illustrate my point, hypothetical "if statement is also conditional expression" syntax, to illustate how much more readable "ifs" are than "?:":

  myvar = if(condition_1) {value_1}
      else if(condition_2) {value_2}
      else if(condition_3) {value_3}
      else {value_fallback};


While I agree that "if statements are expressions" is a nice feature, I disagree that your version is more readable. That being said, it's readable enough that, if the rest of my team preferred it, I'd be ok using it.




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

Search: