Tuesday 18 August 2009

Did Microsoft Deliberately Bug Notepad?

Ever tried editing web-pages using notepad? If your like me notepad is a tool which is better for doing less rather than providing more. There is nothing more annoying for an expert web coder than a web-editor "gainsaying" well constructed code with some **it it feels is "equivilent" (and sometimes which it is just adding to promote itself).

So, in this situation, Notepad comes (came) to the rescue.. or so it used to be....

There is a bug? in the current version of Microsoft Notepad, that is either an incredibly stupid mistake or an incredibly sneaky attempt to discourage its use as a web editing, script editing or file editing tool.

Right, now, to the point... Every so often, when using Notepad (in this case in Windows vista) it will silently insert a line return [chr$(13)] character which will appear (and I use that phrase losely) as a space. I have found no definitive pattern to the cause of this behaviour.

This character only of course becomes a problem when your editing scripts (such as ASP scripts) using Notepad, so, when your neetly type your command of strTemp = 50 it instead becomes instead strTemp [cr] = 50 which is of course invalid ASP syntax.

Now, this bug is just "too" convinient for me to easily believe that its accidental. Microsoft don't want you using Notepad to edit your web files! Oh no, they want you to buy their (a) web tool.

Would they deliberately sabatage Notepad? They have been known to do such things. Its now imfamous that Microsoft had put a "check" in Windows 3.11 to prevent it running correcly on DR-DOS (Digital Researches excellent DOS product).

This is a particularly evil "bug" as it only happens randomly anf when it happens you don't "see" the CR in the ASP debugging output and you will have a job locating the "extra" line return in notepad. Unless you really understand whats happening you would just give up and buy a web-editor.

Another reason its hard to believe its a "bug" is that Notepad has been around for years and hasn't hardly been changed since its inception (excepting being re-compiled for newer systems).

Sadly, there is absolutely no way to know what the truth is. All we have is the following fact:

The current version of Notepad (e.g Windows Vista Notepad) randomly inserts hex 0x0D characters as you type with no observable/repeatable pattern at this time. Therefore, its becomes a danger to use (because it the extra character is missed... you may not find out until a client calls up venting a spleen about the web-site being down).

Funny thing is, I do quite like Microsoft on the whole. Maybe it is a bug... maybe.

2 comments:

  1. Ubuntu user here. I am writing my resume and of course I had to write it in Word to comply with corporate infrastructure on the other end. I didn't even try OpenOffice. I did it on XP running in VirtualBox. I encountered a problem when doing an ascii version. I did it in text editor that comes with Ubuntu. When I opened it in Notepad, it didn't look quite right, so I decided to fix it Notepad. When I looked at it again from Ubuntu editor, it had more than one blank lines where there was one in Notepad. I remembered fixing Windows ascii files in vi long time ago, so I started vi and started replacing double, triple, quadruple end markers that apear as ^M in vi. When I reopened my text resume in Notepad it didn't look bad, but as soon as I saved it in Notepad WITHOUT doing any CHANGES TO LINES I just fixed in vi, there were those end markers (^M) added to them. And exactly as you describe, there was no apparent pattern where those markers would be inserted. So, yeah: you can read a file edited in Linux editors in Notepad, but there is an effort to make files saved in Notepad look messy in non-MS editors. This reminds me of a "bug" in Front Page that generated garbled html that wasn't readable by html standard-compliant browsers, while Internet Explorer was able to display it nicely. And there are similar reports on sabotage against QuickTime.

    I don't particularly care about any of those big businesses, but I'm pretty pissed about spending unnecessary time editing while I could be taking my dogs for a walk. Or whatever.

    Since everybody's time can be converted to money, if these "features" are intentional, they constitute a criminal act of robbery.

    ReplyDelete
  2. Thank Ubuntu user. Its great to know its not just me.

    ReplyDelete

What do YOU think?