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

> `-b` should be illegal

Sure... but I didn't use `-b`. Maybe I've misunderstood.

> give a dedicated error message if you write `a-b` but you happen to have both variables `a` and `b`

I guess, though the idea of having mutually exclusive sets of identifiers sounds like a nightmare. You can have `a` and `a-b`, or `a` and `b`, but not `a`, `b` and `a-b`... Maybe it wouldn't come up much in practice but it's still a pretty big WTF.

> In turn you have a bidirectional translator.

But the problem is that you have this translation in the first place. It makes the identifier ungreppable. Ideally any place you have an identifier it looks exactly the same through your whole codebase and if you have to translate it then that is no longer true. For example if you want to update all background colours in your project you might search for `background-color`... but miss `backgroundColor`.



They’re only mutually exclusive as far as getting a good error message is concerned.


I don't really follow you. If `a = 1; b = 2; a-b = 3; foo = a-b; bar = a - b;` is legal then there would be no error message. Do you mean a warning?




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

Search: