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

!! gets weirdness points for not being a builtin operator, and ++ gets weirdness points for the subtleties of how it acts on certain things, and for being different in prefix and postfix.

I assume that's a yes to allowing ++ at all. In my opinion ++ generally does a good job of conveying intent, and !! does a very good job of conveying intent.



++ and -- are allowed as:

- single line statements always in postfix form

- for loops

- exception for the prefix form in for loops with C++ iterators due to performance reasons

Clever C code has its place in hackatons, not in code that needs to survive a few project generations.


> - exception for the prefix form in for loops with C++ iterators due to performance reasons

That is a reasonable thing to allow, but I personally find that particular use much more confusing and finicky than using !! to coerce to boolean.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: