4 ms·
> #aargh Many system programmers will think this line is commented out. Indeed what a nightmare!
by walki 8y ago
> #aargh
Many system programmers will think this line is commented out. Indeed what a nightmare!
- jlokier 8y agoYup. The muscle memory is so strong, when writing Javascript/Typescript I type # by accident sometimes. But then, // is one of the most commonly used operators in another language I use, so it's weirdly symmetrical :)
- henrikeh 8y agoCurious: which language?
- madamelic 8y agoPython uses it for integer division. Typically it is meant as "divide and floor" as far as I've seen.
- jlokier 8y agoPerl, the defined-or operator. Like ||, but // tests definedness instead of truthiness. The equivalent in several other languages is ??, which is uglier imho, but it's just syntax. https://en.wikipedia.org/wiki/Null_coalescing_operator https://en.wikipedia.org/wiki/Null_coalescing_operator I use // and ?? often as it's conceptually clean, fast and concise. When available, it arises naturally in logic like caches, memoizations and defaults. //= is pretty useful too, and I'm surprised it's not more widely available.
- Memosyne 8y agoWouldn't most system programmers think it's a macro?