logoalt Hacker News

albedoayesterday at 10:12 PM3 repliesview on HN

By "to do this" do you mean to not use booleans? It's because the value does not represent a binary true or false but rather a means by which the item is deleted or dead. So not only would it not make sense semantically, it would break if a third means were introduced.


Replies

endofreachyesterday at 11:05 PM

> It's because the value does not represent a binary true or false but rather a means by which the item is deleted or dead.

"Deleted" and "dead" are separate columns.

> So not only would it not make sense semantically, it would break if a third means were introduced.

If that was the intention, it would seem like a bad design decision to me. And actually what you assume to be the reasoning, is exactly what should be avoided. Which makes it a bad thing.

This is a limitation not because of having the bool value be represented by an int (or rather "be presented as"), but because of the t y p e , being an integer.

0cf8612b2e1eyesterday at 11:01 PM

Funny, because the HackerNews API [0] does return booleans for those fields. That is, a state, not a type of deletion or death.

[0] https://github.com/HackerNews/API

show 1 reply