Hacker News new | past | comments | ask | show | jobs | submit login

>Does true mean "is safe" or "is taking damage"?

You could name a function that returns a boolean isInSafeZone. From the name it would be clear that true means safe and false means that it isn't.

>Wouldn't something that actually says what you mean be a lot clearer

No, compare "if (player.isInSafeZone())" to "if (player.getSafeZoneState() == SafeZoneState.SAFE)". Endure is extra verbosity that isn't giving you value.

>Fewer ideas between the expression and the meaning?

I don't know what you mean by this. You are creating extra types for every possible condition is introducing more ideas. Why have 1000 boolean types when you can have 1 that interopts with itself.

>Why do you think it's more complex to eliminate a semantic step?

There is more steps in creating a new type, maintaining it, and having to convert it into what you want when you could just use booleans from the start.

>Do you think languages are required to privilege Boolean over any other 2-type

No, even C has typedef. I never implied there was wrapping going on. I meant that you are introducing layers of indirection. It's a case of everything in programming can be solved by creating an interaction except having too many indirections. Indirection is not always the answer even if there is no performance impact.

>processors don't understand zero and one

By the interface that is exposed to programmers they do. Read the manual. For the purposes of making a programming language there is no benefit in going down to the level of voltages. It is an implementation detail that is the processor creator's job to worry about.




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

Search: