Live data from Hacker News

Chess.com stopped working on 32bit iPads because 2^31 games have been played

chess.com

331–338 of 338 posts

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#331

Earlier quoted context omitted.

My understanding is that the actual number of bits used would generally have been 4 bits per digit, as they were using Binary Coded Decimal [1]. So dropping the 19 would save you a byte per date. Sure, they could have used a custom encoding. But that increases maintenance cost and extra development work. All to solve a problem that nobody cared about at the time. [1] https://en.wikipedia.org/wiki/Binary-coded_decimal

Just seems wierd. A 2 byte day count would give a huge range and use 2 bytes for the full date Vs 3 bytes for a BCD yymmdd representation.

But then you need special code to decode that. Code that you have to write yourself or borrow and include in your program. Remember, no shared libraries. And it means extra CPU time you have to display a date. Whereas BCD has special hardware support.

It means that data interchange is now much more complicated too. How do you get everybody to agree on the same 2-byte representation for dates? This is the 1960s, so you can't just email them. You have to have somebody type up a letter and mail it. Or if you want to get on the phone, a 3-minute international call will cost $12, which is about $100 in 2017 dollars.

Plus then you can't look at a hex dump or a punch card or front panel lights and see the date, so now you've made debugging much harder.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#332

Earlier quoted context omitted.

I doubt that's true, unless you mean it tautologically. There are plenty of good programmers working on software that matters that should absolutely not be trading off hazy possible benefits in 2052 for significant costs now. It's occasionally necessary. When I wrote the code for Long Bets [1], I took a number of prudent steps to make sure things would have a good shot at surviving for decades. But I only took the ch…

> There are plenty of good programmers working on software that matters that should absolutely not be trading off hazy possible benefits in 2052 for significant costs now. I guess it's not obvious, but I think there's really a continuum here. You don't necessarily need to write software that will run perfectly in 2052, but it'd be good if you wrote software that can be comprehended, adapted and altered later on. Main…

Sure. Maintainability pays off relatively soon, and often makes systems simpler and cheaper to operate. But the topic in this sub-thread is the Y2K bug, where the proposed solution would have been expensive and provided no benefit for 35 years. And at the time, those benefits would have been very hazy.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#333

Earlier quoted context omitted.

I doubt that's true, unless you mean it tautologically. There are plenty of good programmers working on software that matters that should absolutely not be trading off hazy possible benefits in 2052 for significant costs now. It's occasionally necessary. When I wrote the code for Long Bets [1], I took a number of prudent steps to make sure things would have a good shot at surviving for decades. But I only took the ch…

> "Technological change has slowed down some" wat

It's definitely true. Technical change in the 60s was enormous. During that period there was a lot of fundamental architectural change and experimentation; that's when they settled on 8-bit bytes as the standard, as well as many other things. Moore' Law became a thing. In the 70s is when we started seeing operating systems that look familiar to us, and even into the 80s it was plausible to introduce a new OS from scratch (see, e.g., NeXT, or Be).

But Moore's Law is now dead:

https://www.technologyreview.com/s/601441/moores-law-is-dead...

Per-thread performance has been basically flat after decades of exponential gain:

http://preshing.com/20120208/a-look-back-at-single-threaded-...

The iPhone is a decade old; every phone now looks like it, and it's highly plausible that they'll look basically the same a decade from now, possibly much longer. Laptops are 30 years old; they've gotten cheaper, faster, and better, but are recognizably the same. HTML is coming up on 30, and it will be in use until long after I'm dead. TCP is nearly 40; Ethernet is over 40; even Wifi is 20.

So it's just easier now to guess what programmers will be doing in 35 years compared to 1965.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#334

Earlier quoted context omitted.

In my experience it's not the good systems that stick around - they're cleanly replaceable. It's the quick hacks and bodges that stick around forever.

As someone who just wrote a quick hack for a temporary problem, I agree. It's not just the shitty programmers who do this. Sometimes we have shitty product managers who won't push back against this kind of thing. And you're forced into a creating something evil because most of the job is very good but this one time, you have to suck it up. My response to that, though I agree with you, is that when a supervisor or PM…

Good for you. That's my approach, too. And to rig the system such that technical debt gets cleaned up continuously and gradually without the product managers knowing the details.

When there are real business reasons to rush something, I'm glad to support that by splitting the work like you suggest. But the flipside is them recognizing that not every thing is an emergency, and that most of the time we have to do it right if they don't want to get bogged down.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#335
post #236

Earlier quoted context omitted.

Shitty solutions are usually the right answer. At least in the areas I work in (mostly startups). I would estimate 99% of the code I write gets thrown away. Most of it is trying something out. Even for code that was intended to hit production, the company/project often gets cancelled before it ever hits production. I'm not saying this is true in your case. But there are so many different classes and types of programm…

Nothing about this comment is okay. 99% of your shit code isn't getting thrown away. It's sticking around making life hell for people like me. Stop writing shit code because it's going to get thrown away. If you work for startups, you are always operating in protoduction mode. Everything you write ends up in prod. Write code that doesn't suck. It doesn't have to be perfect or optimal, but make it not suck before you…

Hmm no. That's what's happening in your world, but you're imposing that world view on me.

Probably about 80% of the code I write doesn't even get looked at or used by another developer. If the technique/analysis proves useful, it gets rewritten/refactored. That has the added advantage that I then understand the model better.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#336
post #335

Earlier quoted context omitted.

Nothing about this comment is okay. 99% of your shit code isn't getting thrown away. It's sticking around making life hell for people like me. Stop writing shit code because it's going to get thrown away. If you work for startups, you are always operating in protoduction mode. Everything you write ends up in prod. Write code that doesn't suck. It doesn't have to be perfect or optimal, but make it not suck before you…

Hmm no. That's what's happening in your world, but you're imposing that world view on me. Probably about 80% of the code I write doesn't even get looked at or used by another developer. If the technique/analysis proves useful, it gets rewritten/refactored. That has the added advantage that I then understand the model better.

Yeah, same here.

For me there's a giant difference between code that lasts, which needs to be sustainable, and disposable code, which doesn't. I'm also very big on YAGNI; my code gets so much cleaner and more maintainable when I'm only solving problems that are at hand or reasonably close. Speculative building for the future can get insanely expensive: there are many possible futures, but we only end up living in one.

Indeed, I think a "do it right" tendency can prevent people from really doing it right. If we invest in the wrong sorts of rightness up front, we can create code bases that are too heavy or rigid to meet the inevitable changes. So then people are forced into different sorts of wrongness, working around the old architecture rather than cleaning it up.

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#337

The other one to watch out for is the 53-bit javascript integer limit. That caused the twitpocalypse when Twitter tweet IDs hit it. They had to switch to strings in the JSON representation.

The 2009 Twitpocalypse concerned overflow of 31-bit precision. Twitter has not yet hit 53-bits for raw number of Tweets, in fact, they passed 32-bits in 2014 and might not have reached 33-bits, yet. Moving to strings for Javascript was really just safety planning for the future since: > Given the current allocation rate, they'll probably never overflow Javascript's precision nor get anywhere near the 64-bit integer s…

That discussion is about user IDs, not tweet IDs.

Tweet ID from today: 875423039323688960

Number of bits of precision necessary to represent it exactly: 60

Overflowed 53-bit precision long long ago. You can read about it here: https://dev.twitter.com/overview/api/twitter-ids-json-and-sn...

Re: Chess.com stopped working on 32bit iPads because 2^31 games have been played

#338
post #317

Earlier quoted context omitted.

I suffer from dandruff, tried a bunch of shampoos but they didn't work well. I saw this tip about vinegar, which I tried a single day then I gave up thinking this could be popular saying. I'll try again and report.

When you say 'this could be popular saying' are you meaning that it may be wrong because it's popular? I'd be curious to know your results, in any case. I've had mixed outcomes from conventional (commercial shampoos) and have also been trying to identify causal factors (worse in winter, especially after a few days of wearing a beanie, worse when I'm staying near a high-pollution area, etc). It's all anecdata, but OTO…

This unconscious bias went unnoticed to me (as expected, per definition). Thanks for pointing it :)

So far, my experiments with other shampoos where conducted a bit ad hoc. They're all anecdata. When I try with vinegar, I should try to rule out other causal factors first. I probably haven't done that in my first try. Otherwise, we can never be sure.

Post reply on HN