logoalt Hacker News

benj111yesterday at 3:12 PM2 repliesview on HN

I'm not sure we are. My parent suggested you could, in the sense of why would you. I'm questioning if it's possible at all. And if so, is that just based on a local solution. Ie all numbers have an implicit 0 at the start.

To me storing as a number to save space is a fine goal itself. The issue is the underlying complexity which a bare int can't capture. Suggesting using an int indicates the proposer hasn't thought about the issue.

This isn't to say the parent was wrong person se. Asking why you are doing something is a good question. But also understanding the issue/complexity is important too.

In the example I would say that saving space is a sufficient reason, so the point is moot. The reason why you wouldn't want to do it is because a phone number is not 'just a number' (I'm sure there's a mathematical term for a number where leading zeros are important etc).


Replies

rbanffyyesterday at 6:54 PM

> I'm questioning if it's possible

It’s certainly possible, but you’ll regret it. Deeply.

Recognising terrible ideas is an essential skill for software engineers.

show 1 reply
hilariouslyyesterday at 3:25 PM

I read it as a Socraticish anti-question - answering it will answer why its a bad idea.