6 ms·
> I sometimes think it would've been better if a few things had visibly failed in January 2000. Having to spend billions of dollars on programmers' goofy means
by justin66 9y ago
> I sometimes think it would've been better if a few things had visibly failed in January 2000.
Having to spend billions of dollars on programmers' goofy means of saving a few bytes of memory is a pretty visible failure.
- andrepd 9y agoHow many bytes of memory were saved? 32-bits multiplied by potentially trillions of time, considering storage was not dirt cheap as it is now...
- wpietri 9y agoNope. Definitely not goofy. My dad was a programmer in the early days. The machines he started on in the 1960s had 8 KB of RAM. Saving a byte then is the equivalent today of saving 1 MB on an 8 GB machine. Multiply that times, say, the thousands of customer orders you're trying to process and the goofy thing would be burning a lot of additional RAM because it might help somebody 35 years later. Who among us is writing code today worried about how it will be used in 2052?
- justin66 9y ago- Who among us is writing code today worried about how it will be used in 2052? The good programmers who are fortunate enough to be working on software that matters.
- davidgerard 9y agoIn 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.
- justin66 9y agoWell, yeah, I absolutely agree. Replaceability and maintainability go hand in hand in a system. It's a cruel irony that the code that sticks around, often sticks around because it's crap. (that doesn't stop me from sometimes having a weird admiration for incomprehensible software kept going forever with weird hacks. It's like with movies, sometimes they're so uniquely awful that you have to admire the art of them)
- ianamartin 9y agoAs 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 or whoever gets on you about something you know is bad, you negotiate. "Yes, I'll do this for now because the company needs it now. But only if you guarantee me the time (and possibly people) to do it right later." You get agreement in an email, create the ticket and assign it to yourself as mustfix two months from now. And you shove it down their throats. That's not an ideal place to work if you have to do that, but I have worked at those places and this is how you deal with that situation. "Yeah, I'll give you a shit solution in 1 day right now. But only if you give me a a couple of weeks for a good solution later." In reality, I've mostly only had to deal with this situation in startups. Mid-level and mature companies are usually open to pushing back and getting things right. But there are exceptions. Today was an exception. But that's also one of the reasons I don't really want to work at startups anymore.
- new299 9y agoShitty 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 programmers and projects that it's hard to generalize.
- ianamartin 9y agoNothing 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 push.
- wpietri 9y agoI 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 cheap ones; the important thing was to ship on time. And I think that's the right choice for most people. Technological change has slowed down some, but 35 years is still an incredible amount of volatility. Betting a lot of money on your theories of what will be beneficial then is very risky.
- justin66 9y ago> 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. Maintainability is never a "hazy benefit." (If the problem isn't a total throwaway.)
- wpietri 9y agoSure. 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.
- chrisweekly 9y ago> "Technological change has slowed down some" wat
- wpietri 9y agoIt'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-now-what/ 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-cpu-performance/ 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.
- chrismcb 9y agoIn the 80s I questioned the use of using two bytes for the date. I was laughed at by the experienced programmers. They said the software would be rewritten by then. It should have been, but it wasn't... But there is a trade off between how much time you spend today vs future compatibility.
- wongarsu 9y ago>Who among us is writing code today worried about how it will be used in 2052? This decade I knowingly wrote code that will break in 2036 [1]. My supervisor was against investing the time to do it future-proof (he will be retired by 2036), and I have good reason to believe the code will still be around by that time. I don't think I'm the only programmer in that position. [1] Library specific variant of the y2038 problem https://en.wikipedia.org/wiki/Year_2038_problem https://en.wikipedia.org/wiki/Year_2038_problem
- justin66 9y ago- This decade I knowingly wrote code that will breaks in 2038 Sure, but how bad was it really? Something you could fix relatively quickly with a little time and money, or an instance of Lovecraftian horror unleashed upon the world like so much COBOL code?
- sbov 9y agoEven then, mix in people switching jobs, losing the knowledge of where or what all these landmines are, and add similar but unrelated issues across your entire codebase. This stuff adds up. I like to at least add stern log messages when we are at 10%-50% of the limitation. It's saved my ass before, especially when your base assumption can be faulty. In one of those scenarios, where we expected the growth of an integer to last at least 100 years, due to certain unaccounted for pathological behaviors, a user burned through 20% of that in a single day. But we had heavy warnings around this, so we were able to address the problem before it escalated.
- mikeash 9y agoLast time this came up, I ran the numbers and the cost of the RAM saved per date stored was hundreds of dollars. Not per computer, or per program, but per date. Comparing total memory sizes doesn't tell the whole story, because RAM for a whole machine is so much cheaper now. Spending that much money on storing "19" just so your code keeps working in the unlikely event that it's still in use 3+ decades into the future isn't a good tradeoff. Obviously things are different now.
- justin66 9y agoThe interesting thing about this from an engineering point of view is, you quietly pass a threshold where the clever hack which was worthwhile becomes literally more trouble than it is worth. When that happens is a multivariate problem that we couldn't truly predict at the time of the code's creation. (and when it happens, there might not even be anyone on the payroll thinking about it)
- odbol_ 9y agoYou're calculating what it would cost to store a string representation of a date. Which is silly. You should always convert to a timestamp for storage. You can cram way more info into a single integer than you can with a base 10 string. And the bonus is you verify the date's correctness before storing. Even a 32-bit int could hold 11 million years worth of dates. And if your software is used for longer than that, you can just change it to a 64-bit long and have software that will outlast the sun.
- varjag 9y agoSilly or not, that's the reality of punch card based technology (BCDIC later extended to EBCDIC). Punch cards pre-date electronic computers, and making a relay tabulator set-up working with binary formats is impractical. As computer hardware grew out of that, it maintained much of the legacy, down to hardware data paths and specialized processor instructions. It was more than a programming convention.
- mikeash 9y agoSystems from this era were probably using BCD rather than base-10 strings. A BCD date would take up 24 bits. Running a complicated date routine to convert to/from 32-bit timestamps would also have cost a huge amount. These machines had speeds measured in thousands of operations per second, and the division operations needed to do that sort of date work would take ages, relatively speaking. All on a machine that cost dozens of times the average yearly wage at the time, and accordingly needed to get as much work done as possible in order to earn its keep.
- deleted 9y ago[deleted]
- MichaelGG 9y agoBut a 2 digit date should take less than 7 bits. Were they using systems that didn't use 8 bit bytes? Why wouldn't the dates work from, say 1900 to 2155?
- alanbernstein 9y agoGood question! Nobody was writing 1900 + (year % 100), right?
- nandemo 9y agoSome people were. But it's worse than that. In the 90s a lot of code used 16-bit values, character strings. That is, it stored a char(2), parsed it as 2-digit number and then converted it to a date by adding 1900. So it was only really "saving space" when compared with storing a char(4).
- MichaelGG 9y agoBut if they wanted to save space why not store a 8 bit number? I imagine it must have something to do with punch card compat or some binary coded decimal nonsense. Still seems inefficient.
- nandemo 9y agoMaybe because they didn't know better? I was going to say "maybe they were bad programmers", but likely just "average" programmers. No punch cards or BCD, I'm talking about DOS/Windows systems.
- vizeroth 9y agoIf a system gives you two options for storing a date (using 2-digit or 4-digit years), how many dates do you need to store and use in calculations before you end up saving space by creating a new data type and all of the supporting operations to make the storage of the date itself more efficient? In recent years, it's more common to make this type of decision because something else is causing an issue, otherwise we rarely consider the space required for a date (and many languages no longer have a separate type for dates).
- Piskvorrr 9y agoSometimes this worry is thrust upon you by the problem domain. I do remember tackling the Y2K38 problem in 2008 - the business logic dictated that the expiration date should be tracked, and some of them were set to 30 years.
- Retric 9y agoIt really depends on how much data and how old. My dad's first programming job was initially to mechanically change how variables where stored thus saving 1 and only 1 byte of disk space. Someone ran the numbers and having someone do that for a few months was a net savings. A few years after that he was talking about some relatively minor optimizations that saved a full million dollars worth of hardware costs by delaying a single new computer purchase.
- justin66 9y agoRegarding the point I was speaking to: it's undoubtedly true that some of those hacks were initially worthwhile. Keeping them going until the year 2000 was, by that same standard of cost effectiveness, pretty definitely a visible failure.
- eru 9y agoYou keep them going because of status quo bias / not touching a working system.