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

    $x=a  
    if (condition) then $x=b
If you think of programs as logic then I see the lines above as a logical expression written in CNF conjunctive normal form, where each line is a clause.

whereas this...

    $x = condition ? b : a;
...is like a nested logical expression.

And breaking the program down into clauses makes it easier to understand, for humans and computers.



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

Search: