Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why did the y2k bug exist?

Tags:

y2k

The explanation I got for this was that it was common practice for programmers to simply represent the year with 2 digits. But why would anyone do that? If anything I imagine it would take more effort to make a program roll back to 1900 instead of going on to 2000.

like image 594
user405163 Avatar asked Nov 17 '10 04:11

user405163


2 Answers

Premium of storage space + lack of foresight = Y2K bug.

Saving bytes was very important in many older systems. Plus, a common fallacy in software development is "no one's going to be using this in X years". So why not save those bytes now? 10/20/30 years down the line this will SURELY be scrapped for a completely new system.

To quote Lex Luthor -- "Wrong."

like image 99
Kaleb Brasee Avatar answered Nov 09 '22 14:11

Kaleb Brasee


Why? Their question was likely, "Why not?" If it saved a few bits in a world where memory usage was significantly more limited, then they figured they may as well save that space.

Obviously, the "why not" was because "your software might actually be in use for significant amounts of time." Some programmers had the foresight to plan ahead, but not all.

like image 21
Matchu Avatar answered Nov 09 '22 15:11

Matchu