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

Most C-inspired languages (most popular programming languages) allow this. The only ones I've used that don't are Go and Swift. And I find it a little annoying.

If you're worried about bugs, there are other things in C/C++ to criticize first ;)



It's true for Rust as well. What these three languages have in common is that they don't require parentheses around the switching boolean expression, and when you have things like:

    if expression1 expression2
it can be fiendishly hard to determine the boundary between expression1 and expression2.




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

Search: