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.

Saturday 1 August 2009

Design Annoyances

I've been updating my web-site reciently and I am now taking a break from the task to be-moan a really annoying discovery about a design choice in Internet Explorer which wasn't readily apparent to me until just receintly.

Internet explorer uses the F5 key to refresh the page (seems ok), in newer versions it used the key sequence CTRL-F5 to force the page to be refreshed from souce (bypassing any checks made on the client side as to wether the page needs refreshing) also good.

However, when using IE on any regular basis its not long before you begin to realise how annoyingly close the shortcut to quit the browser is the shortcut to refresh the page!! Yes, you can see where this is going... I go to perform a CTRL-F5 and I am 1cm short and instead hit CTRL F4 and there goes the browser window.

This is now added to the another annoyance of IE which is the CTRL-W close window shortcut. Its so easy to accidently press this sequnce whilst typing in a web page and when the window closes, how hard is it to get what you typed back? Answer: Near impossible (probably actually impossible, I only say near impossible because if your a real clever hacker you just might be able to extract it from the page file).

Well, thats my "moan for the day". I am thinking of re-titling my blog... "General Complaining" because its all I seem to do in it lol.