Engineering is about tradeoffs: How hard will you work to save 68KB of disk space?


One of the recurring themes in the comments to my explanation of the historical reasons why there are two copies of Notepad was to use a hard link (or possibly a symbolic link) to save having to waste the disk space for two whole copies of Notepad. As I like to say, engineering is about tradeoffs. Let's look at the cost-benefit analysis.

On the one hand: Install two copies of Notepad. Cost: 68KB of disk space.

On the other hand: Use hard links or symbolic links. Cost: Add support for hard links or symbolic links to the FAT filesystem, to the operating system Setup program, to file formats such as the Windows Imaging Format, and to the various disk duplication systems that system builders (and corporate customers) use for deploying Windows to thousands of machines. Don't forget to count the cost for design and testing.

Imagine you're the scheduling manager for the Setup team. Which of these two options do you choose? 68KB of disk space or doing all the work to support hard links during Setup and then waiting for all the existing customers to upgrade their tools to versions which support hard links—which could take several years. Are you going to be the one to have to stand up in the Ship Room and say, "We can't ship Windows because ten of our customers hasn't upgraded their deployment tools yet, and I have no idea how long we're going to have to wait until they do"?

And for those commenters who said that Windows should just get rid of one of the copies, you'll be pleased to know that Windows Server 2008 got rid of the copy in the Windows directory. There is now only one copy¹ of Notepad, and it's the one in the system32 directory. It wasn't long after the product was released that I learned of a program that hard-coded the one that no longer exists; I wish the vendors good luck in getting a patch out quickly.

Footnotes

¹Nitpickers not welcome here. There is only one copy remaining of the two under discussion.

Comments (84)
  1. Satchmo says:

    Except for the fact that adding symlinks would provide all the users with a significantly better filesystem. It could have been worth the trouble.

  2. Mickey says:

    @Satchmo: NTFS supports symlinks since Windows Vista. This is solely about backward compatibility with FAT.

  3. steven says:

    Astonishing… NOTEPAD.EXE is always in Windows’ default search path. You’d think that hardcoding "%windir%notepad.exe" is more work than just "notepad.exe". I wouldn’t be surprised if they went one better (or rather: one worse) by hardcoding "C:Windowsnotepad.exe".

  4. Juan says:

    Heck!

    Windows Vista got rid off the copy of notepad located in system32 directory and kept the one in Windows Directory…

  5. !/. says:

    > Except for the fact that adding symlinks would provide all the users with a significantly better filesystem. It could have been worth the trouble.

    Wrong. It would provide them to the users who care, which are far less than "all".

  6. Jacob says:

    Steven wrote: "NOTEPAD.EXE is always in Windows’ default search path."

    This is true, but it’s bad practice for your installer to trust the default search path.  Think of what happens if you go to install on a machine where the search path has been changed, and the first "notepad.exe" in the search path is something different.  Maybe it’s a shareware notepad that the user didn’t pay for, so it doesn’t run.

    The example is contrived, but the headaches are real enough.  After you have this problem a few times, you start launching applications by full path.

  7. John says:

    The problem with being backward compatible with bad code is that it doesn’t encourage developers to write better code.  So they will continue to write bad code with which you will have to be backward compatible.  When you die your body becomes the grass, and the antelope eats the grass.

    [And the problem with being incompatible with bad code is that nobody buys your operating system because (as it turns out) there’s a lot of bad code out there. Pick your poison. -Raymond]
  8. Peter says:

    Is it really so hard for people to call ShellExecute()?

  9. Tony Cox [MSFT] says:

    "The problem with being backward compatible with bad code is that it doesn’t encourage developers to write better code."

    And the problem with not being backward compatible with bad code is that nobody wants to upgrade to your new system because of all the legacy apps that you break (and inevitably blame you for).

    As a business plan, ensuring the maximum reasonable backwards compatibility with new versions of Windows seems to me to have been a remarkably effective strategy. Are you suggesting it would have been better for Microsoft’s business to employ a different one?

  10. DWalker59 says:

    The other article has Nektar saying "I hope that one day we will have full explanation of all these directories under the Windows directory eg. Addins, etc, and what they are for. The same goes for all these registry entries. Why isn’t Windows operating system properly documented?"

    Are the other operating systems "properly" documented at this level?  The fruit one, for example?  Do you know what is in each of the subfolders of the operating system’s folders?

    You’re not supposed to care what all of those folders are for; you’re supposed to use documented interfaces to call functionality.

  11. DWalker59 says:

    By the way, 68K is a whopping 0.013% of your 500 GB hard drive.  If you have a smaller Windows partition, it’s going to take up 0.033% of a 200 GB partition, or 0.066% of a 100 GB partition.  Less than one tenth of one percent.

  12. Leo Davidson says:

    Juan wrote:

    "Windows Vista got rid off the copy of notepad located in system32 directory and kept the one in Windows Directory…"

    Are you sure? I just checked my Vista (32-bit, SP1) machine and there’s a copy in both Windows and System32.

  13. Spike says:

    DWalker59: "By the way, 68K is a whopping 0.013% of your 500 GB hard drive.  If you have a smaller Windows partition, it’s going to take up 0.033% of a 200 GB partition, or 0.066% of a 100 GB partition.  Less than one tenth of one percent."

    One percent of your 100Gb drive would be 1Gb.  One tenth of that would be (approximately) 100Mb.  

    So 68Kb is less than one tenth of one percent of one tenth of one percent of your drive.

  14. rs says:

    Same in 64-bit, too. BTW, the notepad in 64-bit vista (sp1) is (exactly) 165.5 KB – not that it changes the calculations.

    BTW, a related but off-topic question:

    The listview in explorer shows the size of notepad.exe as 166KB, while the bottom panel with the details info shows it as 165KB. Is this by design or just a bug in rounding?

  15. Dan Ridley says:

    "And the problem with being incompatible with bad code is that nobody buys your operating system because (as it turns out) there’s a lot of bad code out there. Pick your poison."

    Incompatibility is hardly the only reason Vista has a bad reputation, or doesn’t sell that well to upgraders. If the upgrade is compelling, customers will tolerate software breakage. See: Windows 95. See: Windows 2000. See: Mac OS X 10.4 and 10.5.

    Would MS seriously not ship a new release because ten customers hadn’t upgraded their deployment tools yet? Why wouldn’t you note the incompatibility, inform those customers, and continue to support the previous release for a while? Are slow-moving big corporate customers so much more important than everyone else that you will bring your product pipeline to a halt to accommodate their deployment tools?

  16. Alexandre Grigoriev says:

    WindowsNotepad.exe is only gone in Windows 2008R2 (Win7). It’s still there in Win2008.

    Speaking of the links, I would be VERY grateful, if anybody explained to me:

    1. Why there are links for the system directories with the legacy names (Documents and settings, etc)? Answer: for compatibility with the legacy crap?

    Then question 2: Why then when I click on those links, I get "Access denied"? And ‘dir’ command on them also returns nothing. How it would be legacy-compatible?

  17. Neil says:

    Hey, it’s only 68KB, so they can simply install their own version of Notepad with their app!

  18. dalek says:

    In my 64bit Win7 Beta build 7000 there are actually 3 copies of notepad:

    1 in C:Windows, 64 bit exe, 161kB

    1 in C:WindowsSystem32, 64 bit exe, 161kB

    1 in C:WindowsSysWOW64, 32 bit exem 148kB

    [I now have evidence that nitpickers don’t read footnotes. -Raymond]
  19. configurator says:

    Alexandre Grigoriev asked good questions (re links for the system directories with the legacy names); I had wanted to post them previously in the Suggestion Box – but it’s closed.

    Why isn’t there a symlink/hardlink for the two notepads in Windows Vista or Windows 7?

  20. njkayaker says:

    Satchmo: "Except for the fact that adding symlinks would provide all the users with a significantly better filesystem. It could have been worth the trouble."

    But why couple the two?

  21. Marcus says:

    @Tony Cox [MSFT]

    The thing about all this backwards compatibility hackery is that eventually Windows will fall over under the weight of it.  Covering for bad programmers is not a sustainable policy.

  22. Reginald Wellington III. says:

    "Why isn’t there a symlink/hardlink for the two notepads in Windows Vista or Windows 7?"

    Well, configurator, because engineering is about tradeoffs: How hard will you work to save 68KB of disk space?

  23. Alexandre Grigoriev says:

    Oh, and thanks Raymond for removing my rant. It feels so good to pretend the problems don’t exist, and imagine that the users are happy. This doesn’t change the reality, though, the the problems still exist, and the product is not getting better, and doesn’t bring money.

    [Your rant violated the ground rules. In fact, just to make things clear, I added a new example to the ground rules. -Raymond]
  24. John says:

    Neil: I like the way you think :)

    [And the problem with being incompatible with bad code is that nobody buys your operating system because (as it turns out) there’s a lot of bad code out there. Pick your poison. -Raymond]

    Well, I guess you’re just going to be stuck supporting bad code until the end of time.  Sucks for you.

  25. John says:

    @Aargh!:  Backward compatibility and good engineering are not mutually exclusive.  However, I agree with you that one should not give up the latter for the former.

  26. Yuhong Bao says:

    Except that hard links has existed since NT 3.1 to support the POSIX subsystem.

  27. Nick says:

    @Alexandre Grigoriev:

    Instead of whining about something completely unrelated to the topic at hand in the blog comments, why don’t you put in 30 seconds worth of effort to find the answer yourself?  I’ll save you 10 of those seconds:

    http://www.google.com/search?q=vista+documents+and+settings+access+denied

    @Raymond:

    For what it’s worth, I strongly respect and admire Microsoft’s attention to backwards compatibility and application support that lasts longer than the latest boy band’s popularity.  This dedication to users — both corporate AND consumer — is one of the reasons I’ve stayed with MS products (and one of the biggest headaches I have to deal with when working on Linux distributions).  Making a best effort to allow customers to use their computer as they want to and not as some random developer or hip new executive thinks everyone should is, in my book at least, key to a widely successful operating system.

    I realize it’s just a cute and likely inaccurate name, but I’m still rooting for the Raymond Chen Camp. Go team! :)

  28. Bob says:

    Plenty of people have hardcoded "C:Program FilesFoorBar.exe" and had no luck with users who dare to not use the english locale. I’m not surprised that an OS upgrade eventually broke the same wort of program.

    It must really suck working for Microsoft – you bend over backwards to keep your customer’s applications working then people complain about "bloat" and the second you do something about that bloat (by removing any work-arounds for their bugs) they’re crucifying you for breaking their applications when they caused the problem by not knowing what they were doing.

    Also, even if symbolic links would be better for mankind than a cure for cancer, if the only compelling reason to add them that anyone could find is "will save 68KB of disk space for one application, less a little overhead for tracking the link" then they can’t really be that great.

    If you wanted symbolic links (or hard links) added as an OS feature then you should have been talking to the filesystem team, not the setup team and not the notpad team (I kid, I kid).

  29. Courage Dog says:

    I have pretty default XP Pro with Office and only a few developer tools (VS+SQL+SDKs+symbols). C:WINDOWS is 12GB (Installer subfolder is >5,5GB), C:Program Files is 15GB and the swap file is 4GB. Should I really care?? Should YOU really care?? No, I think there are FAR MORE IMPORTANT problems here to solve. Cheers.

  30. Dean Harding says:

    On vista, C:WindowsNotepad.exe and C:WindowsSystem32Notepad.exe and C:WindowsSysWOW64Notepad.exe ARE hard-links – to the "real" version that sits in C:WindowsWinSXS :-)

    "Take for example a certain cupertino based company that completely broke with their previous OS a few years back, and look at how far ahead they are compared to MS."

    How far ahead are they? Last I checked, Apple still has < 10% of the market[1]… not exactly "ahead", is it?

    [1] http://marketshare.hitslink.com/operating-system-market-share.aspx?qprid=8 (I don’t know if this is reliable, it’s the first google hit I found)

  31. One way to settle this could be to employ the ol’ WinHelp approach:

    keep the two executables, and let one of them launch the other. (In the case of winhlp32.exe, the one in C:Windows is the real McCoy and the one in C:WindowsSystem32 is just winhstb.exe renamed to winhlp32.exe.) Write.exe in System32 is a similarly flavored stub that launches Wordpad in NT Accessories etc.

    And of course, having just one copy of the real executable makes for less confusion if ever a Windows Update would be required.

  32. Anonymous says:

    I know you said nitpickers aren’t welcome, but setup and WIM both support hardlinks.  And having FAT as the system volume is no longer supported.  :-)

  33. chrismcb says:

    @Aaaaaaargh

    "The role of an OS to run applications designed for it without hassles, not to run applications designed for version n-1, n-2 .. n-3431"

    Says who? Marketing aside, if I were to set out to develop a new OS, one of my goals would be to try and allow applications from other/preceding OSes to also work. Definitely anytime I work on version n+1 of ANY product (whether it is an OS or application) one of your goals should be backwards compatibility.

    Sure sometimes you have to bite the bullet and break with past experience. But it comes down to tradeoffs. And with the number of programs that currently exist today for Windows, backwards compatibility is a huge tradeoff.

  34. Alexandre Grigoriev says:

    Mr.Nick,

    The googles do nothing, they’re full with users asking (and with copies of the same threads, practically), why in the world I see these handy legacy links, but the OS applications (cmd.exe/dir) which supposedly are using the same mechanisms as the legacy applications, can’t dereference them? Aren’t those links there to just break legacy compatibility then? Or confuse the users and programmers alike?

    If an user is complaining, but MS isn’t there to hear him, does the problem really exist? What Zen says about that?

  35. David Brooks says:

    I’m tired of the UNIX fanboys (of which I was one, once) talking up the wonders of symlinks (which I used to, once, until I actually used systems that depended on them being set up right). The way symlinks are used – OK, were used last time I used them – is the very definition of a hack. Trying to maintain a rat’s nest of symlinks, created by developers with competing ideas of what they are for, is a far greater headache than paying a quarter of a cent for another copy of Notepad.

  36. DWalker59 says:

    @Spike: Sorry, you are not right. (68*1024)/(100*1024*1024) is 0.000664063.

    Converted to percent, that is 0.066%, so 68 KB is slightly less than one tenth of one percent of 100 GB.

  37. Alexandre Grigoriev says:

    Spike, DWalker,

    (68*1024)/(100*1024*1024*1024)

    is 0.000000664063, that is 0.0000664063%

  38. AlexG says:

    I am pretty sure the notepad in %WINDIR% and %WINDIR%System32 directories on my x86 Vista box are hard links to the same binary. I just confirmed by changing permissions on one of them and the other changed automatically.

  39. alias says:

    @DWalker59: Check your arithmetic. Notepad.exe is 68KB = 68*1024 bytes. You got that one. 100GB = 100 * 1024 * 1024 * 1024.

    68K/100G = 6e-7 = 0.00006%.

    As Spike pointed out, less than a tenth of a tenth of a percent of a small (these days) partition.

  40. Aaargh! says:

    > And the problem with being incompatible with bad code is that nobody buys your operating system because (as it turns out) there’s a lot of bad code out there.

    What everyone seems to miss is that this is *not* an engineering trade-off.

    Not breaking backwards compatibility because you can sell more copies(!) is not, and should never be, an engineering decision. It’s a markting decision. Engineering should strive to create the best damn OS possible, not the most profitable. Marketing is responsible for selling as many copies as possible. You both present your arguments to management and it’s their job to make a decision.

    And that’s exactly the problem with Microsoft, and the reason why I see more and more (non-technical!) people around me switching to alternative operating systems (mostly OS X). You don’t care about making the best OS possible, you only care about making the most profitable OS possible, and you forget to look at the long term.

    As the engineering department, you should be fighting for permission to break backwards compatibility, because you need that to make the best OS possible from a technical viewpoint, which is the *only* viewpoint you should care about. It’s not your job to care about anything else, there are other people to do that. Those people need correct input to do their jobs. They need to hear both sides of the story to make an informed decision.

    Either MS is being run by the marketing department or engineering has just given up.

    [From a technical viewpoint, I would think that an operating system that runs more applications with fewer problems is preferable. -Raymond]
  41. J says:

    "Not breaking backwards compatibility because you can sell more copies(!) is not, and should never be, an engineering decision."

    Selling more copies is directly related to many engineering trade-offs.

    * Maximizing the number of programs that don’t need to be changed for a new version.

    * Minimizing the amount of third-party effort (i.e., cost) to migrate to your new system.

    * Lowering the long-term cost of deploying your system.

    * Giving end users peace of mind about whether their programs will run.

    * Reducing time-to-market (i.e., cost) in some situations by retaining backwards compatibility.

    All of these reduce cost or otherwise make your product more appealing to the market.  As a developer who has shipped many products, I find the necessity for backwards compatibility to influence my designs tremendously. especially when it comes to fixing bugs in maintenence releases.

  42. MS says:

    @Aargh!: Uh, considering one of the major roles for an operating system is to, you know, run programs without hassles, it *is* in the best interest of engineering to work on backwards compat.  And it isn’t like they never make a conscious decision to make a break with the past — they just weigh it much more carefully than anyone making comments here would realize.  And it isn’t like some of the app-compat shims/work-arounds are going to make the OS appreciably worse.

  43. Jeff Tyrrill says:

    @DWalker59:

    Your math is wrong. It’s 0.0000136% of a 500GB drive. You were off by 3 orders of magnitude. It’s less than one thousandth of one percent of a 100GB drive.

    @Satchmo:

    "Except for the fact that adding symlinks would provide all the users with a significantly better filesystem. It could have been worth the trouble."

    Did you even read the post? It’s not about symlinks in the *file system* (at least not NTFS, which is what the vast majority of systems use and presumably you had in mind for adding such support).

  44. Ian Johns says:

    @DW59: Sorry, Spike is right.  You’re missing an extra 1024 in your denominator :

    (100*1024*1024) is only 100 MB — it needs another multiply of 1024 to be 100GB.

    So Spike was correct that your calculation was off by a factor of 1000.

  45. Xepol says:

    I assume you are baiting people just for fun now.

    One solution fixes a single problem, the other solution fixed an entire catagory of problems.

    True, the larger and more encompasing solution might be more painful and time consuming, but its long past time MS started solving problems the right way instead of the easy way.

    And you have painted a very clear picture that MS goes for the easy solution instead of the right one time after time.  

    What is worse, you seem to find no problem with that whatsoever.

  46. Aaargh! says:

    > From a technical viewpoint, I would think that an operating system that runs more applications with fewer problems is preferable.

    So why did MS decide to make an OS that runs fewer applications with more problems ?

    [In other words, “Why did MS take my advice?” Odd question. -Raymond]

    >  All of these reduce cost or otherwise make your product more appealing to the market.

    None of which have anything to do with the *technical* quality of the product.

    > Uh, considering one of the major roles for an operating system is to, you know, run programs without hassles, it *is* in the best interest of engineering to work on backwards compat.

    The role of an OS to run applications designed for it without hassles, not to run applications designed for version n-1, n-2 .. n-3431

    My iMac can’t run apps designed for a first generation iMac and I don’t care *at all*. I haven’t heard a single user complain that their new Mac can’t run photoshop 1.x

    > And it isn’t like they never make a conscious decision to make a break with the past — they just weigh it much more carefully than anyone making comments here would realize.

    They have *never* broken with the past in all their history. I bet a DOS 1.0 app can run without problems on Win7.

    > And it isn’t like some of the app-compat shims/work-arounds are going to make the OS appreciably worse.

    Maybe not worse, but certainly not better. Take for example a certain cupertino based company that completely broke with their previous OS a few years back, and look at how far ahead they are compared to MS. They got rid of a piece of crap OS and replaced it with something very good.

    Did their market share plummet after cutting away their excess baggage ? Did it when they completely changed CPU architectures (and not for the first time) ? And will it in the next version of their OS when they stop support for a major legacy API on which several major apps (like Photoshop and Office) are based ?

    Even if you don’t want radical change you could still break certain API’s over a number of releases, mark them deprecated and warn developers they will be dropped in version n+2. That’ll give everyone plenty of time to get with the program.

    Windows *is* worse for not breaking backwards compatibility, instead of comparing with the previous version and be happy with a minor improvement, think of what it could have been if you had chosen to break with the past. (Compare OS X with OS 9 and imagine how OS 10 would have looked if it were based on OS 9 ?).

  47. MS says:

    @Argh!

    "The role of an OS to run applications designed for it without hassles, not to run applications designed for version n-1, n-2 .. n-3431"

    Diminishing the pool of applications you can run really hurts adoption.  If I have all my critical must haves broken by the new version of an OS, well, I am not going to upgrade.

    "My iMac can’t run apps designed for a first generation iMac and I don’t care *at all*. I haven’t heard a single user complain that their new Mac can’t run photoshop 1.x"

    Ok, I will complain about it.  Now you’ve heard someone complain about it.  Lets pretend I have a photoshop 1.0 file (or rather, any file from an old program) I want to open for legal reasons or because I want to resurrect my old school marketing materials, whatever.  All I have is OSX 10.4, and the new version doesn’t open the old format.  I’m kind of screwed.  There are virtualization options, but even that isn’t guaranteed.  It’d be much easier if I could just run the old version!

  48. steveg says:

    @Aaaaaaarrrggggh: <paraphrased>Apple threw out their old OS and are now doing better</paraphrased>

    Yes, yes they are. However, they were not in the same situation that Microsoft are in now (eg massive % of most markets). MS has a lot to lose. Apple had a lot to *gain*. They bet the whole apple cart and, so far, seems like they made the right call. (boom-tish).

    @Others: Marketing suck, engineers rule.

    Yes, yes that’s true. However, marketing do sometimes encourage customers to buy products that engineers write. And that keeps engineers fed. They are a necessary evil, which is sad.

    @DWalker59: Tough audience. What’s 3 orders of magnitude between friends?

    Actually on topic: it’s probably a good thing, overall, symlinks are not that popular on Windows. Can you imagine trying to explain to your grandma the difference? How many people in UserLand know what the difference between the shortcut to Notepad and Notepad.exe is?

    Excellent. Now explain to grandma that she’s clicking on a shortcut to a symlink to an executable!

    I bet a unit of your currency that if Windows had had symlinks from version 1.0 we’d all be bemoaning how miserable they would be making our lives now (visualisation exercise: imagine 20 years of symlink entropy in the windows codebase).

  49. Rick Damiani says:

    [The example is contrived, but the headaches are real enough.  After you have this problem a few times, you start launching applications by full path.]

    …and end up dealing with localization issues or support calls from people with Windows installed into e:qbert.

  50. someone else says:

    Ah, the joys of hardcoded path names. "C:Program Files" would be wrong on my computer *two times*. First, Windows isn’t installed on C:, but on E:, so Program Files would be located there.

    But it isn’t. It’s on G:

    (On a related note, no program should expect to use more than 10 MB on C:. If I could write protect it, I would.)

    And concerning Apple’s disregard for backwards compatibility (and customers in general): They don’t have a large number of customers who are, in fact, businesses. Or have I missed the new Mac OS Server?

  51. porter says:

    > I’m tired of the UNIX fanboy talking up the wonders of symlinks

    Symlinks work across volumes, whereas a filename referencing the same inode doesn’t.

    > 1 in C:WindowsSystem32, 64 bit exe, 161kB

    I love that, for backwards compatibility the directory reserved for 32bit code contains a 64bit binary

  52. Tom West says:

    "My iMac can’t run apps designed for a first generation iMac and I don’t care *at all*. I haven’t heard a single user complain that their new Mac can’t run photoshop 1.x"

    Lack of backward compatibility is not that much of a problem in the consumer market.  If 10% of the population needs to use an old program, then that 10% simply don’t upgrade.

    For the business market, you standardize.  If more than 1% of your users can’t use the new software, then 0% get the upgrade.  There’s a reason *every* large (>10,000 desktops) company I’ve had dealings with has tried to exterminate their Macs.  (Admittedly, not always successfully.)

    An engineer’s job is to build the best system he or she can *given the job requirements*.  It’s not to whine about the requirements.

    In general, real life is not particularly beautiful.  It’s full of kludges and limitations that real problem solvers have to deal with.  Ever looked at the design of the human body?  No clean sheet design that!

    Criticizing MS for for solving the problems that real organizations have rather providing solutions that you find esthetically pleasing seems misplaced effort on your part.  Might as well criticize the x86 instruction set for its lack of elegance.  Except here there’s the definite chance of annoying Raymond enough that we lose one of our best resources for understanding *how* and why that system evolved.

  53. Kyle says:

    @someone else

    You mean this one?  http://www.apple.com/server/macosx/

    They do have a lot of customers that are businesses — take a look at any creative industry.  They’re not Fortune 500 companies, and most of them probably don’t even have server rooms.  They might have a Mac Pro sitting in the corner running OS X Server as a fileshare and providing rudimentary directory services.

  54. someone else says:

    Ah, it appears I forgot an adjective. We are talking big businesses. The ones where an upgrade means upgrading a three-figure number of workstations and at least on server. The kind of business, who are actually distinguishable from private customers. The one’s that, realistically, count.

  55. Stephen Eilert says:

    @ David Brooks

    Care to explain why symlinks are a hack? Because I don’t think they are. They are fully supported across the whole OS and its applications, you can link to anything in the filesystem, even devices. Compare that with Windows "links"…

    And you only have to maintain a rat’s nest of symlinks if you create the nest yourself. What you are describing is a strawman, and a non-issue.

  56. Ferruccio says:

    NTFS has always supported hardlinks. At first the support was exported only under the Posix subsystem. But (at least since XP, maybe sooner) you can manipulate hardlinks throught the fsutil command line utility which comes with Windows.

  57. Rob says:

    "From a technical viewpoint, I would think that an operating system that runs more applications with fewer problems is preferable." -Raymond

    I would tend to think that an OS that doesn’t implement the big ball of mud anti-pattern would be preferable. Bonus points if it implements basic features like hard/soft links. (Yeah, yeah, NTFS…)

    Best thing that ever happened to the Mac platform was OS X requiring rewrites of all the crappy software out there.

  58. Suits says:

    Great! I love the fact that windows is moving forward and that we get to see it doing so. I also love reading these blogs so I can see that microsoft isn’t some massive closed up giant but a nice open company.

  59. Kenneth says:

    Since people brought up Apple, how about if Microsoft took the same approach, and created a virtualised legacy-subsystem for old code, and a brand-spanking new OS built with all of the hard lessons earned over the years, free of cruft?

    Old applications would then run in the legacy environment, which could be maintained (or even uninstalled) separately.

    Win-win?

  60. SuperKoko says:

    Old applications would then run in the legacy environment, which could be maintained (or even uninstalled) separately.

    OBVIOUSLY, rather than having two copies of notepad, we should run all "old" applications in a virtual environment where notepad.exe is in %windir% and a new environment where notepad.exe is in %windir%system32!

    That has been discussed.

    <http://blogs.msdn.com/oldnewthing/archive/2005/10/05/477317.aspx&gt;

  61. peterchen says:

    @Kenneth:

    This sounds great, but Windows, from a certain POV, does even better: I can take my Win2000 / XP app, plunk it on Vista, and if I wasn’t to much of a bad boy, it will actually run like a "true" Vista app.

    That’s good for consumers: They have a consistent UI when moving to the new OS. Otherwise, they’d e.g. have to learn the old and the new File Select dialog.

    That’s mostly good for developers: they can release more often, since they can upgrade gradually: fix the glaring bugs so it runs on vista, reduce the UAC annoyances, improve shutdown behavir etc.


    In the discussion of "let developers suffer" vs. "be nice to users", the "deprecated warning" is missing: a non-blocking but mildly annoying notice to the end user that %WINDIR%notepad.exe is deprecated.

    Now, admitted, I don’t know how that should look like,  and probably most users would think it’s silly and turn it off.

  62. N says:

    The real WTF is why such a poor text editor such as notepad.exe is included instead of something more capable.  Windows 3.0 called, it wants its lousy text editor back.

  63. James Schend says:

    Aaargh: I switched from OS X to Windows specifically because Apple broke backwards-compatibility with tons of my OS 9 applications. (Well, that and because after 5 years, Apple still couldn’t create a version of Finder that didn’t suck. If I have to use a crummy file browser, I might as well use Explorer, which is at least stable.)

    I’m a living counter-example to your point.

  64. James Schend says:

    Kenneth – Ask an actual Mac OS 9 user who tried using Apple’s Classic emulation environment to run their own apps. It didn’t work well; it hit maybe 75% of apps, to be generous, but also broke a ton of features in the process. Oh, and it drained your battery and sucked CPU even with no Classic apps running.

    The "Classic" environment was a bad hack, Apple knew it, everybody knew it. It was only there so they could pretend they cared. (I’ve used the Classic API, there’s no reason it couldn’t have adapted for OS X instead of introducing that abomination Carbon API, then making it obsolete in less than 5 years anyway.)

    Microsoft’s too smart, and has too many legacy applications, to do something like the Classic environment.

    What it really comes down to is you have to give up maybe a few megabytes for compatibility shims/code/duplicate copies of Notepad when running Windows. I think you’ll find a way to cope somehow!

  65. Alexandre Grigoriev says:

    The real WTF is why such a poor text editor such as notepad.exe is included instead of something more capable.

    I would appreciate if, at least, it could handle LF-separated text files, not only CR LF. Which every other editor (including wordpad) does.

  66. Replace one of those copies by one that executes the other. I’m sure you could even hack something together in ASM to take no more than a few dozen bytes.

  67. Spike says:

    @DWalker59 "@Spike: Sorry, you are not right. (68*1024)/(100*1024*1024) is 0.000664063.

    Converted to percent, that is 0.066%, so 68 KB is slightly less than one tenth of one percent of 100 GB."

    My mistake D.  If that’s how you define 100Gb then I’ll have to concede the point to you.  Just out of interest, what figures do you use for 100Mb and 100Kb and 100b?

  68. SuperKoko says:

    > >  All of these reduce cost or otherwise make your product more appealing to the market.

    > None of which have anything to do with the *technical* quality of the product.

    Executing applications is a technical quality, in my opinion.

    > The role of an OS to run applications designed for it without hassles

    In that case, OSes are useless.

    IMO, an OS should do HARDWARE abstraction, meaning that its interfaces should be independent of the hardware details.

    If its interfaces change every few years, it becomes a BAD abstraction, as it evolves faster than hardware and the whole point of hardware abstraction becomes moot.

    If you think executing old applications don’t matter, go buy a fruit-based computer.

    > They have *never* broken with the past in all their history.

    They eventually did break a few things when switching from the 9x kernel to the NT kernel.

    It’s pretty impressive that, at the core, Windows NT/2000/XP/Vista is a GOOD, well-engineered OS, and yet, manage to be backward compatible.

    Sure, there are lots of minor glitches, but overall, it’s a good system.

    Why the heck is wrong with having two copies of notepad? Does it REALLY harm.

    IMO, we can safely say that Microsoft got rid of the Windows 9x crap.

    About Mac OS X. I find it funny to replace a poor, but simple, OS (Mac OS 9) with a new incompatible OS coming with its own HUGE legacy.

    POSIX has at least as much glitches than Windows.

    1) Poor multi-threading interfaces due to many thread-unsafe syscalls, non-native threading library (you can’s poll/select on a semaphore), signal system not agreeing with threads, open/fork/exec concurrencies issue making it possible to leak file descriptors (security issue) to child processes.

    2) syscalls flawed by design such as realpath() or select()

    3) Awfully generic names. open() and close() are for files only. Obviously!

    4) Compatibility with 70’s typewriters, with in-depth kernel support for terminals, adding lots of weird things such as controlling terminals, processes groups, foreground processes groups, session leaders.

    Windows Vista may be (partially) compatible with MS-DOS 1.0 on IBM PC.

    Mac OS X is (partially) compatible with UNIX on PDP-11 with mechanical typewriters.

  69. Nick says:

    "The real WTF is why such a poor text editor such as notepad.exe is included instead of something more capable."

    Something more capable IS already included: Wordpad. It supports RTF, NL/CR endings, and Unicode.  If you want that, use it.

    Notepad does a great job at what it was designed to be: a no-frills text editor with a tiny footprint that starts fast.  If Microsoft wants to pretty-up Wordpad, more power to them, but I hope they leave Notepad (more or less) the way it is.

  70. Dammit says:

    Sweet Jeebus, the maths on this article is frustrating.

    68K/100G expressed as a percentage=>

    68/100M (cancelled out 1024, top/bottom)=>

    68/100*1024*1024 (expanded M to 1024*1024)=>

    68/104857600 (only numbers, result is ratio)=>

    0.00000064849853515625 (ratio)

    (ratio) * 100 = percentage

    68K/100G expressed as a percentage =>

    0.000064849853515625 %

    Maybe we need more calculator-free mathematics in university…

  71. Igor Levicki says:

    >How hard will you work to save 68KB of disk space?<<

    It depends on the amount of disk space you have. Back when hard drives were 10MB in size and Windows came on floppies 68KB was huge and worth saving.

    >After you have this problem a few times, you start launching applications by full path.<<

    And then someone will overwrite the original Notepad and you will still launch the wrong application.

  72. Snappy says:

    @Dan Ridley

    "Incompatibility is hardly the only reason Vista has a bad reputation, or doesn’t sell that well to upgraders. If the upgrade is compelling, customers will tolerate software breakage. See: Windows 95. See: Windows 2000. See: Mac OS X 10.4 and 10.5."

    I can’t speak for Mac OS … but Windows 95 and Win2k definitely had compatibility built in.  I was part of the Win2k App Compat team in my region and getting Win2k migration was hinging on customers who wanted their existing pre-win2k apps working.

    In this case, it turn out that the WOW environment was sufficient for 90%+ of legacy (DOS, 16bit, WinNT4.0, 3.5x) apps to run in Win2k.  Majority of incompatibility had to do with driver incompat (Win2k changed the driver model, direct hardware access was blocked).

    Win95 was pretty much the same as well if you ask me.

    DOS apps would run on Win95 for many years to come.  In fact, a dos app I wrote using QuickC back in college still ran in Win95/Win2k and WinXP.  Never tested in Vista … ‘cos I don’t use it.

    App compat is what bogged down Windows all these years.  But it is business decision that made it popular with consumers and corporate users.

    In Win95.

  73. PatriotB says:

    I find it a bit humorous that of the 145KB that Vista’s Notepad takes up, 100KB is its icon.

  74. The Imp says:

    People arguing about the percentages of disk space that this additional 68KB takes up, are missing the point entirely. ANY FAT-based drive will lose far more than that from cluster size overheads even if your Notepad executable is the only damn file on the disk, on multi-hundred-gigabyte hard disks.

    As for waiting for tens of customers to get up to speed before shipping; Microsoft does seem rather content to ignore such customers over solving problems, when it suits them to do so. Especially when the customers are the ones doing the wrong thing.

    Oh, and I agree completely with Nick; what’s great about Notepad is that it’s fast to launch (but do NOT use it for non-trivial search/replace operations). After UTF-8/UCS2 support was added in W2K, I can’t ask for any other improvements (well, maybe allowing WordWrap and the status bar simultaneously; it’s easy enough to do). As they say in the Unix world: "If You Want [Something Else], You Know Where To Find It." — there’s not shortage of notepad replacements out there, including several from Microsoft themselves (one or two of which are both free and supported, too).

    @Alexandre Grigoriev: I know that it would be a nice addition, but non-CR+LF text files are actually a rare example of Microsoft following the spec to the letter, and the rest of the world ignoring it for "compatibility reasons". I almost don’t want them to change it, for irony’s sake alone.

  75. Ulric says:

    Terrible, all of this complaining about backward comp.  MS does break back comp sometimes, it just takes time doesn’t go out of its way to do it.  

    The Mac example is relevant because 1) apple users are more likely to buy new software all the time  2) are not business users 3) had to trash the entier old operating system because it was obsolete and not memory-protected.

    And apple did put a lot of effort into Rosetta, to run old PowerPC apps.

    Btw, before someone again says that Windows still runs all old apps, Windows 64-bit dropped all the support for 16-bit applications.  And the move to XP SP2 and later Vista hasn’t been painless.

  76. someone else says:

    “The real WTF is why such a poor text editor such as notepad.exe is included instead of something more capable.  Windows 3.0 called, it wants its lousy text editor back.”

    Oh, I don’t know, last time they included a rather sophisticated app *cough* WMP *cough* some anti-trust lawyers came a-knocking.

    Also, while e. g. regexp-searches would be really cool, they are also likely to confuse end users (think of Granny). You don’t want that.

    Or maybe it’s really not worth the effort.

  77. Jim Lawless says:

    If I had been rushed to support both, I might’ve just had a stub EXE in one of the folders that would, in turn, launch the other.

    I’ve made small EXE’s that do this.  The NASM source below links to an EXE of about 2K in size. ( Linked with VC++ 5.0’s runtime libs ).

      extern _WinExec@8

      global _main

      global _mainCRTStartup

      SECTION  .text

    _mainCRTStartup:

      push   dword 1

      push   dword child

      call   _WinExec@8

      ret

    _main:

      ret

      SECTION .data

    ; you can hard-code the full path to

    ; notepad below

    child:  db “notepad.exe”,0

    [Um, that hard-coded path kind of ruins the whole thing. -Raymond]
  78. 640k says:

    That multiple copies of notepad.exe takes an extra 68k of diskspace is the LEAST problem. Bloating of other parts of Windows is a far serious problem. Placing unessesary files in the OS does slow down hundreds of common operations. Like listing files in directory. Fragmenting filesystem. Bloating registry in several ways. Putting the rest of the files on slower parts on the disk (diskar has usually slower transfer rate with higher sector count). Bloating prefetch cache. Bloating memory footprint when both exes are loaded. The list goes on and on and on. And the list of flaws will be even longer for every system feature that’s added to windows ver+1.

  79. Absurd Nitpick says:

    @Ulric

    Actually, if they were following the spec to the letter, wouldn’t Notepad have to support overtype for lines the only end with CR, and drop-down-and-contine on lines that end with only LF, instead of displaying little "bad character" glyphs? =P

  80. Absurd Nitpick says:

    Sorry, that was supposed to be:

    @The Imp

  81. DWalker59 says:

    Alias, and everyone else, you’re right, I skipped right over megabytes and went straight from kilobytes to gigabytes.  Which adds weight to Raymond’s contention that the amount of space is tiny.

  82. SuperKoko says:

    @Jim Lawless:

    Clever things like that don’t work properly.

    For example, applications calling WaitForInputIdle, or expecting the PID of the launched process to be equal to the PID of notepad, won’t work anymore.

    Also, having two different files with the same name (notepad.exe) harms.

    Now, suppose you broke your %windir%system32notepad and want to get it from another source (friend’s computer, internet…).

    Since there’re TWO notepads, you may end up getting TWO stub notepads…

    Then, you’ll get an infinite CreateProcess loop when launching any of these notepads, as %windir%system32notepad would launch itself!

  83. Jim Lawless says:

    @Raymond,SuperKoko: Agreed; the stub EXE was not a good idea.

  84. Duke of New York says:

    It’s great that Microsoft finally removed one of the duplicates, but why did they remove the WRONG one instead of the RIGHT one?

    @someone else: I’ve run into people who will claim that Notepad itself is part of a plot to stifle competition from low-capability text programs that could develop into Office competitors. Whether Microsoft bundles big programs or small programs, or removes them, the antitrust propagandists will always find a way to spin it.

Comments are closed.