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

~ is the similarity sign as mathematical symbols.


Agreed, this is a slightly better way to think about it, yet still seems out of place for Go. Where else does Golang diverge from what an operator means in C?


For one, in the operator in question: bitwise negation in Go is expressed using prefix ^ rather than ~ as in C. Go also differs from C in operator precedence, which I would argue is a significantly larger change than the visible syntax for an operator.


++ and -- are also statements rather than expressions (and =, but lots of languages diverge from C on this).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: