How many lines of code does a Windows application really need? Thousands of lines of code and megabytes of memory? Perhaps something much less. Reflections on code bloat, and Dave Plummer (Dave's Garage) takes us for a ride.

We have worked with every version of Windows™. And endless quantities of floppy disks. We have often noted that "cut and paste" is the worst thing that ever happened to operating systems and applications because it's too easy to copy and "tweak" for new use than to go back and build a proper multi-purpose utility — thus avoiding the headaches of regression testing and, worse, the possibility of introducing defects causing existing code to fail. The result? Code bloat!

And the poster child for code bloat? Windows. These are estimates of lines of code for major Windows milestones:

VersionYearLines of code
Windows198529,000
Windows 3.019903,000,000
Windows 95199515,000,000
Windows 98199830,000,000
Windows XP200145,000,000
Windows Vista*200650,000,000
Windows 7200940,000,000
Windows 8**201280,000,000
Windows 10201550,000,000
* widely panned as unsuccessful
** not as widely adopted as Windows 7

In comparison, the Chevrolet Volt in your garage features about 10,000,000 lines of code.

When it comes to applications, it's not much better. At least half of the programs and services that are typically active on your Windows PC take at least one MB (1,000,000 bytes) in memory. Our currently running instance of Google Chrome is taking a whopping 1,296.6 MB (1,296,600,000! bytes) of memory. But does a Windows application really need to be quite as large?

Dave's Garage

Speaking of the Volt and garages, no, it's not an car or pickup garage, but a coding "garage." Dave Plummer is a self-described "token gray-bearded Wizard" and retired Microsoft™ operating systems engineer dating all the way back before Windows, to MS-DOS™.

We came across Dave's YouTube™ video where — as we follow along — he attempts to build a fully operational Windows application that is smaller than his previous record of 3.5K (3,500 bytes!) of required memory.

With no further delay, a treat for the truly geek at heart:

Friday, April 14, 2023
Site contents © 2024, Dynamic Resources, Inc. All Rights Reserved. External links are provided for convenience only.