Scott on Writing

Musings on technical writing...

Wednesday, August 27, 2008 #

Why is Programming Fun?

I recently started reading Fred Brooks, Jr.'s The Mythical Man Month, an influential collection of essays on software project management.

In the introductory essay he has a paragraph that starts with the following words: "Why is programming fun? What delights may its practitioner expect as his reward?" He then goes on to list five reasons, in prose that is poetic:

First is the sheer joy of making things. As the child delights in his mud pie, so the adult enjoys building things... I think this delight must be an image of God's delight in making things, a delight shown in the distinctness and newness of each leaf and each snowflake.

Second is the pleasure of making things that are useful to other people. Deep within, we want others to use our work and to find it helpful. In this respect the programming system is not essentially different from the child's first clay pencil holder "for Daddy's office."

Third is the fascination of fashioning complex puzzle-like objects of interlocking moving parts and watching them work in subtle cycles, playing out the consequences of principles built in from the beginning. The programmed computer has all the fascination of the pinball machine or the jukebox mechanism, carried to the ultimate.

Fourth is the joy of always learning, which springs from the nonrepeating nature of the task. ...

Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination.

Of course, we all know that in addition to these joys that make programming fun, there are realities that subtract from the overall enjoyment. Brook addresses these later in the essay by enumerating the woes of programming. The first one dates Brooks's essays, which were written in 1975:

First, one must perform perfectly. ... If one character, one pause of the incantation is not strictly in proper form, the magic doesn't work.

While the programming language syntax rules are strict and literal, today's tools make this a non-issue. If I make a typo writing my code, Visual Studio underlines it with a squiggly. And the cacophony of information on the Internet provides a bounty of code snippets, tutorials, FAQs, and guides that virtually anyone these days can become a magician.

The next two woes Brooks lists are still applicable to today's programmers and are spot on.

Next, other people set one's objectives, provide one's resources, and furnish one's information. One rarely controls the circumstances of his work, or even its goal. ...

The next woe is that designing grand concepts is fun; finding nitty little bugs is just work. With any creative activity come dreary hours of tedious, painstaking labor, and programming is no exception.

The final woe Brooks lists is still applicable today, even more so than it was in 1975:

The last woe, and sometimes the last straw, is that the product over which one has labored so long appears to be obsolete upon (or before) completion.

For me, this is not a woe, as it does not subtract any fun from programming for me. Perhaps it's because I grew up with computers and the rapid and unceasing technology churn. It's second nature for me and most people whose birth date coincided with or came after the birth of the personal computer in the late 70s. But I can see an adult in 1975 would feel overwhelmed by the incessant improvements in technology, each new one rendering the older generation obsolete.

Brooks ends the essay on an upbeat note:

This then is programming, both a tar pit in which many efforts have floundered and a creative activity with joys and woes all its own. For many, the joys far outweigh the woes, and for them the remainder of this book will attempt to lay some boardwalks across the tar.

I'll leave you with some background on Fred Brooks:

  • He has the honor of having a "law" named after him - Brooks's Law states that "adding manpower to a late software project makes it later."
  • He founded the Department of Computer Science at the University of North Carolina in 1964, after leaving his job at IBM.
  • He received the highly prestigious Turing Award in 1999 for his contributions to computer architecture, operating systems, and software engineering.

posted @ 8:18 AM | Feedback (1)

Tuesday, August 26, 2008 #

Speculative Development and YAGNI

It's amazing how much time speculative development can swallow up during the course of a project. Speculative development happens when a developer implements features above and beyond the requirements based on the assumption that he'll need such functionality at a later point in time. I think it's a trap every developer has fallen into at one point or another. We are tasked with something simple - like exposing the latest news through an RSS feed - and turn it into something complex - like building an entire RSS generation framework that can syndicate any data source.

In The Productive Programmer Neal Ford explains why software projects - as opposed to other engineering projects - are so prone to speculative development:

Usually, in the physical world, things tend toward simplicity unless you add energy to disrupt it. Software is the opposite: because it is so easy to create, it tends toward complexity (in other words, it takes the same physical effort to create both complex and simple software). It can take great effort to pull software back toward simplicity.

In other words, it's expensive in time and cost to increase the complexity of a bridge or car or house, which is why you don't see needless complexity added to such systems. But for software, it may only  take a few more hours to add some extra functionality that, while not required now, may be useful down the road. Another factor that leads to a high occurrence of speculative work in software projects is the typical mindset of a programmer. We like order and rigidity and building black boxes that can be plugged in elsewhere and used again. We enjoy challenges and solving problems. Spitting out the latest news in a simple RSS feed is easy, boring even. It's much more mentally stimulating to craft an RSS generation framework. (This predilection of self-directed framework building also helps explain why developers working on existing projects oftentimes advocate pitching the existing code base and rewriting the application from scratch rather than build on top of the work that's already been done.)

The main problem with speculative development is that it adds potentially unneeded code to the project, bloating its size, increasing the surface area of the project, and contributing to the code that must be tested. It's also potentially wasted time. Of course, speculative development isn't a problem if the speculative work is actually needed and used at some future point in time. But because there's no way to definitively say that the speculative work will eventually be needed (or that it will be needed but in some alternate form), it's best to build only what is needed in the here and now.

There's an acronym to keep in mind to help temper speculative development - YAGNI, which stands for "You Ain't Gonna Need It." Ron Jeffries, one of the founders of Extreme Programming methodology, summarizes the idea behind YAGNI succinctly:

Often you will be building some class and you’ll hear yourself saying "We’re going to need...". Resist that impulse, every time. Always implement things when you actually need them, never when you just foresee that you need them. ... You’re thinking about what the class might be, rather than what it must be. You were on a mission when you started building that class. Keep on that mission rather than let yourself be distracted for even a moment. Your time is precious. You might not need it after all. If that happens, the time you spend implementing the method will be wasted; the time everyone else spends reading it will be wasted; the space it takes up will be wasted. ... The best way to implement code quickly is to implement less of it. The best way to have fewer bugs is to implement less code.

Wise words from a wise man.

posted @ 9:55 AM | Feedback (1)

Monday, August 25, 2008 #

Download CopySourceAsHtml

CopySourceAsHtml (CSAH) is a free Visual Studio Add-In created by Colin Coller that turns Visual Studio code - with its indentation, color coding, and line numbers - into corresponding HTML with a few points and clicks of the mouse. This Add-In is great for pasting code samples into blogs and online articles. In fact, I've mentioned CopySourceAsHtml in a previous blog entry.

Unfortunately, the web page that hosts the CSAH Add-In - http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/ - has been offline for over a week now. I've emailed Colin about this outage, asking if it was a temporary or permanent matter, but have not heard back from him. If anyone has a direct line to Colin and can get the inside scoop, I'd be interested in knowing whether the CSAH files have moved elsewhere or if the existing site will be coming back online.

In the meantime, I am posting the Visual Studio 2005 and Visual Studio 2008 versions of CopySourceAsHtml here for others to download.

The Visual Studio 2008 version uses the Visual Studio 2005 version with some additional files created by Guy Burstein. For more on the Visual Studio 2008 version see: CopySourceAsHtml for Visual Studio 2008 RTM. The files available for download above were provided to me by Jason Gaylord. Thanks, Jason!

posted @ 9:50 AM | Feedback (1)

Monday, August 18, 2008 #

The Cast is Off! I've Got Two Functional Hands Again!

On July 15th I broke my right hand playing basketball, which resulted in a cast that severely limited the mobility and dexterity of my right hand and fingers. Today the cast came off! I am back to having all ten fingers available for typing, writing, eating, dressing, and piano playing! Granted, things aren't back to 100% yet. My wrist and hand muscles are extremely weak right now, but that will strengthen over time. For now I can painlessly use the mouse and type. I get some muscle twinges when playing the piano or gripping small objects (like a pen or pencil). And the doctor said no basketball for at least another month.

After asking for suggestions on how to function at work on a day-to-day basis with one hand, many people chimed in with advice - thank you! Being reduced to typing and programming with one hand is no fun. At first it is extremely limiting and very frustrating. However, over time and with enough practice I was able to significantly increase my words/minute typing speed using my left hand and a lone finger on my right hand. Immediately after my injury I was typing around 30 wpm, but by the time the cast came off I was north of 50 wpm.

The best suggestion I received was to use voice recognition software. I ended up buying a copy of Dragon Naturally Speaking and used it for writing the majority of my emails and articles. It was not very useful when programming, although I did use it every now and then in SQL Server Management Studio to write ad-hoc SQL statements. As my typing speed improved I found myself using Dragon Naturally Speaking less and less. Now that I have full faculty of my right hand I doubt I will use DNS again (unless, heaven forbid, I have another hand injury at some point in the future). While voice dictation is nice, it cannot compete with my typing speed. Also, the error rate on voice dictation is still too high, in my opinion. In my experiences I'd get an error in dictation once or twice per paragraph. While that's not a lot, it does require going back and making the correction from the keyboard most times, and that is time consuming. What's more, I find that when speaking I have to collect my thoughts and decide what, exactly, I'm going to say before speaking it. With typing, however, I just start moving my fingers and the words come to me as I'm clicking and clacking away.

Thanks again to everyone who offered suggestions or shared their stories.

posted @ 5:25 PM | Feedback (5)

Friday, August 15, 2008 #

Problems Installing SQL Server 2008 After Installing Visual Studio 2008 SP1? Make Sure You've Updated or Uninstalled Visual Web Developer!

Certain features of Microsoft SQL Server 2008 require Visual Studio 2008 SP1. If VS 2008 SP1 is not installed the SQL Server installation will abort with the following error message: "A previous release of Microsoft Visual Studio 2008 is installed on this computer. Upgrade Microsoft Visual Studio 2008 to the SP1 before installing SQL Server 2008."

PROBLEM: You've downloaded and installed Visual Studio 2008 SP1, yet SQL Server 2008 still fails to install with the same error message.

SOLUTION: If you installed a beta version of Visual Studio 2008 SP1 you must first uninstall it and then install the RTM version. You can use the Visual Studio 2008 Service Pack Preparation Tool to effectively remove prerelease versions of the service pack.

If you did not install prerelease versions of the service pack, yet still get this error message, chances are there is a Visual Studio SKU that did not have the service pack applied. For example, if you have both Visual Web Developer 2008 and Visual Studio 2008 Professional on your machine, you need to install both SP1 for the Professional version and SP1 for the Express SKU. In other words, installing the Visual Studio 2008 Professional Server Pack 1 does not apply the Service Pack to Visual Web Developer. Consequently, you cannot install SQL Server 2008 with those features that require VS 2008 SP1 until apply the service pack to the Express SKU. (You can alternatively uninstall Visual Web Developer and then re-download and re-install it, as the current download has SP1 baked into it.)

For more information on installing SQL Server 2008 and the service pack requirements, check out SQL Server 2008, Visual Studio 2008 SP1, and .NET Framework 3.5 SP1 Explained.

For more information on the new features in SP1 pertinent to ASP.NET, see the .NET Framework 3.5 Service Pack 1 Overview.

posted @ 4:09 PM | Feedback (0)

Thursday, July 31, 2008 #

Final Two Master Page Tutorials Published

The final two tutorials (#9 and #10) of my Master Pages Tutorial series are now available on www.asp.net.  These tutorials explore two advanced master page scenarios:

  • Specifying the Master Page Programmatically [VB | C#] - in most cases a content page's master page is specified statically through the MasterPageFile attribute in the @Page directive.  However, it is possible to dynamically set a content page's master page, as this tutorial shows.
  • Nested Master Pages [VB | C#] - much like how a content pages can bind to a master page, it is possible for master pages to bind to other master pages. Such nested master pages are quite useful in scenarios where there is an overarching look and feel to a site, but various portions of the site require a more customized and unique template. With nested master pages you can define the global common layout in a top-level master page and then use child master pages to create more specialized layouts for particular sections of the site.

Like my past tutorials, these tutorials are all available in C# and VB versions, include a complete working source code download, and are available to download as PDF, as well.

Enjoy! - http://asp.net/learn/master-pages/

 

posted @ 4:50 PM | Feedback (4)

Tuesday, July 29, 2008 #

August's Toolbox Column Online

My Toolbox column in the August 2008 issue of MSDN Magazine is avaiable online. The July issue examines:

  • FileHelpers - .NET includes XML serialization capabilities, which makes it easy to load an XML file into a collection of objects and to save object state back out to an XML file. If you need similar functionality for delimited or fixed-length text files (like CSV files), check out FileHelpers, an open-source .NET library created by Marcos Meli that provides such serialization capabilities.
  • Blogs of Note - K. Scott Allen - a great blogger with in-depth and timely posts on ASP.NET, LINQ, ASP.NET MVC, and project management.
  • YSlow for Firebug - Firebug is a free Firefox extension that is a must-have for all web developers. It captures many important metrics and allows developers to dynamically adjust the page's markup, CSS rules, and to debug JavaScript, all from the browser! YSlow for Firebug is an add-on to Firebug that provides a bevy of performance metrics and targeted guidelines on how to improve a page's response time.

For The Bookshelf section I reviewed Accelerated VB 2008, by Guy Fouche and Trey Nash. An excerpt from the review follows:

As a freelance developer and consultant, I work with clients who have existing apps but need help in adding new features. Some applications are written in C#, others in Visual Basic, so I need to have a mastery of both languages. Visual Basic is easy to pick up; its prose-like syntax and straightforward semantics have helped make it one of the most popular programming languages in the world. But there's a wide gulf between knowing Visual Basic and mastering it. To help bolster my Visual Basic skills, I picked up Accelerated VB 2008 (Apress, 2008) by Guy Fouché and Trey Nash. This book dispenses with the typical page-filling content found in most computer trade books and replaces it with distilled information and code examples that get right to the point. Because of this terse style, however, Accelerated VB 2008 is not for beginners who are interested in learning Visual Basic, but it's ideal for intermediate developers who are either looking to bolster their understanding of Visual Basic or who are in need of a good desk reference.

Enjoy! - http://msdn.microsoft.com/en-us/magazine/cc721607.aspx

As always, if you have any suggestions for products or books to review for the Toolbox column, please send them to toolsmm@microsoft.com.

posted @ 12:16 PM | Feedback (1)

Saturday, July 26, 2008 #

Losing Tab and Esc Key Functionality in Microsoft Virtual PC 2007

I've been using Microsoft Virtual PC product for many years, posting separate VPCs for each client's work and for test beds for installing beta software or trying out products for my Toolbox column. A couple of months ago I started noticing that when in a VPC the Tab and Esc keys were being ignored. For example, when I would use Alt+Tab from within a VPC I would be toggling through the applications in the host environment. Likewise, if I hit Ctrl+Esc from within a VPC it would display the Start menu options in the host environment. Because I try to use the mouse as infrequently as possible and stick to keyboard shortcuts, having a nonfunctional Tab key seriously hindered by productivity. From Alt+Tab to moving from one form field to the next to inventing code, it's amazing how frequently I use the Tab key.

My initial assumption was that there was some problem with Virtual PC.  I found information noting such problems when using UK keyboards, but nothing specific to my problem.  My research revealed that a general rule of thumb was to check for programs in the host environment that might be capturing keystrokes and thereby "stealing" the keystrokes from the VPC. My approach was rather ham-fisted, but what I did was the following: I launched task manager and started killing off processes one at a time. After each process was killed, I would go over to the VPC and see if it now recognized the Tab and Esc keys.

The culprit ended up being FogCreekCopilotHelper.exe. Copilot is a desktop sharing tool from Fog Creek Software that I use now and then when providing telephone-based consulting services.  This process is supposed to shut down automatically when the Copilot software closes. However, sometimes it does not cleanly die off; instead, it lingers around and seems to swallow up the Tab and Esc keys in Virtual PC.

I first detected that FogCreekCopilotHelper.exe was the source of my problems several weeks ago, but I held off posting a blog entry because I wanted to observe how exactly this problem arose. I've had several sessions with Copilot where the FogCreekCopilotHelper.exe process shutdown cleanly and did not interfere with my Virtual PC experience. In the times when it has caused trouble I noticed that mid-way during the Copilot session the Tab and Esc keys stopped working in Copilot! The same behavior I noted in Virtual PC after the fact. And, sure enough, when Copilot loses the Tab and Esc keys the FogCreekCopilotHelper.exe process does not cleanly die, but rather sticks around and steals the Tab and Esc keys from Virtual PC.

Long story short, if you lose functionality for certain keys in Virtual PC first look for the FogCreekCopilotHelper.exe process and kill it if it's floating around. If you do not use Copilot (or if this process is not present) then start to systematically kill off processes until you find the troublemaker. This approach of methodically killing processes is not very elegant, but can help detect the problem assuming you do not inadvertently kill essential processes during the genocide.

posted @ 10:04 PM | Feedback (1)

Friday, July 25, 2008 #

Email Verification for New Accounts via ASP.NET's Membership Framework

In my last blog entry, The CreateUserWizard and Validation ErrorMessages, reader Andrei Rinea commented:

I wish the whole Membership set of controls would be replaced with better ones. Very often I need to have an authentication/authorization mechanism that doesn't need a username but an e-mail. I need email verification and in case the user loses the password he/she should be able to recover it without knowing (a) username.

This scenario is possible, but requires some customizations of the Membership controls. For instance, you can configure Membership so that an Email is not required, and then customize the CreateUserWizard control so that it uses the text “E-mail:” in place of “Username:” (thereby storing the user's e-mail address as their username.

The CreateUserWizard control can also be customized to require that user's verify their email address before being able to log in. See these two articles for more information and to download a complete, working example:

Personally, I quite like the existing Membership controls. They provide a suitable out-of-the-box implementation that allows one to get started without having to write a lick of code, yet are highly customizable through properties, templates, and events, allowing for virtually unlimited scearios and workflows. And if a particular control doesn't cut the mustard you can always create your own UI that uses the Membership framework behind the scenes (via the Membership class).

posted @ 8:54 PM | Feedback (4)

Thursday, July 24, 2008 #

The CreateUserWizard and Validation ErrorMessages

The CreateUserWizard control introduced in ASP.NET 2.0 makes it easy to create a new user account on a website that uses the Membership framework. (See my Creating User Accounts tutorial for more information on using this control.) Out of the box, the CreateUserWizard control offers a fully functional interface for creating new user accounts. You don't have to write a lick of code or declarative markup.  Instead, just set a few properties and you're off and running.

Teach Yourself ASP.NET 3.5 in 24 Hours reader Jason L. e-mailed me recently with an interesting observation about the behavior of the CreateUserWizard's validation functionality. The CreateUserWizard control's default user interface includes validation controls for the various input fields. For example, there are RequiredFieldValidator controls to ensure that the visitor enters values for the username, password, e-mail, and so on.  The ErrorMessage property values of these validation controls can be customized via the CreateUserWizard control's properties, such as UserNameRequiredErrorMessage and EmailRequiredErrorMessage.
Regardless of the values you use for the ErrorMessage properties, the RequiredFieldValidator controls have their Text properties values all set to the same thing, an asterisk (*). When a validation control is both its Text  and ErrorMessage properties assigned, the value of the Text property is displayed in the location of the validation control in the event of invalid data; the value of the ErrorMessage property is displayed in a ValidationSummary control (if one exists on the page).

For whatever reason, the default CreateUserWizard control user interface does not include a ValidationSummary control. Consequently, the values specified in the UserNameRequiredErrorMessage and EmailRequiredErrorMessage properties (among the other ErrorMessage-related properties) are never displayed. (Granted, these property values are assigned to the tool tip of the validation controls, meaning that a user can hover her mouse over the asterisk and see a more detailed ErrorMessage description.) Interestingly, the CreateUserWizard's default interface does show a message if the password and confirmation password do not match. This behavior is due to the fact that the default interface includes a CompareValidator control that does not have its Text property set. Rather, only its ErrorMessage property is assigned (and this can be customized via the CreateUserWizard control's ConfirmPasswordCompareErrorMessage property).

So how do you get the ErrorMessage properties for the RequiredFieldValidator controls to display when using the default interface? One way is to add your own ValidationSummary control to the page. If you do this piece sure to set a ValidationSummary control's ValidationGroup property to the ID of the CreateUserWizard control. In other words, if the CreateUserWizard is named MyCreateUserWizard then set the ValidationSummary control's ValidationGroup property to "MyCreateUserWizard". However, if the user enters a password that does not match with the confirm password the corresponding error message will be displayed twice: once by the CompareValidator and again in the ValidationSummary control.

The only sure fire way to get the validation messages to display as expected is to customize the user interface created by the CreateUserWizard. The good news is that it is very easy to convert the CreateUserWizard into a template, at which point you have virtually unlimited customization capabilities regarding the validation logic and display. For more information on customizing the CreateUserWizard control's user interface, check out Customizing the CreateUserWizard Control and Storing Additional User Information.

posted @ 10:41 AM | Feedback (7)

Saturday, July 19, 2008 #

Installing Dragon Naturally Speaking (DNS) on Vista / Windows Server 2008 64-Bit

Earlier this week I bought Dragon NaturallySpeaking version 9.5. It took me close to an hour to get the software install and configured properly on my system, primarily because I am using a 64-bit operating system. Dragon NaturallySpeaking does not support the 64-bit versions of Windows Vista or Windows Server 2008, but there is a workaround that allows you to install on a 64-bit operating system. Another challenge is that Dragon NaturallySpeaking has trouble with certain onboard sound cards.  This blog entry highlights the challenges I faced when installing Dragon NaturallySpeaking provides workarounds.

If you try to install Dragon NaturallySpeaking a 64-bit operating system you will be stopped by the installer. After a bit of searching, I found this helpful post by VelvetPoodle:

The problem is the installer bundled with the software. This has code preventing it from being run on 64 bit vista. This can be edited using the free application orca.exe which is part of the much larger Microsoft core platform SDK. If you only want the application orca.exe do a google search for it. Make sure you get the 64 bit version though… Alternatively get it from here:
http://blogs.msdn.com/astebner/archive/2004/07/12/180792.aspx.

1. Copy the entire contents of the DVD to a folder on your computer
2. Make a backup of the file Dragon Naturally Speaking 9.msi
3. Install Orca and open Dragon Naturally Speaking 9.msi from the installer directory
4. To the left under tables, scroll down and click on the “launch Conditions”. The error conditions will appear to the right.
5. Select the Condition “Not VersionNT64”
6. Right-Click and select “Cut Row(s)”
7. Save the edited "Dragon Naturally Speaking 9.msi"
8. Install as normal


While this method will certainly get Dragon NaturallySpeaking to install and work on 64-bit operating system, one thing to keep in mind is that NaturallySpeaking will not respond or respond very slowly when dictating in 64-bit applications. For example, if I try to dictate in Internet Explorer, Dragon NaturallySpeaking virtually hangs. Supposedly, the next version of Dragon NaturallySpeaking will support 64 bit operating systems.

After successfully installing Dragon NaturallySpeaking on my computer, the application started and I was greeted with a warning: "Audio Setup Wizard cannot find the sound system." This error threw me for a loop because my computer certainly does have a sound system - I can hear music coming from my speakers and am able to record voice from a microphone. Some online sleuthing turned up message board posts from other Dragon NaturallySpeaking users who encountered similar problems with onboard sound card systems not supported by Dragon NaturallySpeaking. My computer has an onboard RealTek sound card; other users with the same configuration had reported similar errors.

In the same post where VelvetPoodle shared how to install Dragon NaturallySpeaking 64-bit operating system, another poster named webbediva shared a workaround for the audio wizard problem that worked for me:

To get past the audio wizard error:
With Naturally Speaking bar running, right-click on the audio.exe file using Windows Explorer in Program Files\Nuance\NaturallySpeaking9\Program. Under "Properties" click "Compatibility" tab and select "XP". Double-click to run.

To summarize,  with Dragon NaturallySpeaking running need to set the compatibility level of the audio wizard program to be compatible with Windows XP and run this program from Windows Explorer.  With this step out of the way, Dragon NaturallySpeaking (finally) worked! It took a bit of research and effort to get Dragon NaturallySpeaking properly installed and configured on my machine, but I haven't had any issues since (except for slow or nonexistent response times for 64 bit applications).

Read the post with the two workarounds: http://forums.cnet.com/5208-6035_102-0.html?forumID=44&threadID=280578&messageID=2744514

posted @ 8:11 PM | Feedback (2)

Using Dragon NaturallySpeaking

Earlier this week I broke my right hand playing basketball.  I currently have a splint on, which renders my right hand useless.  I can wiggle the tips of my fingers but I lack the control to use a mouse or type with this lame hand.  I'm getting proficient typing with my left hand, but it is still significantly slower than typing with both.  For instance, with both hands I can type in the neighborhood of 100-120 words per minute.  With just my left, I type a shade under 40 words per minute, and even slower when keying in typical code syntax with its mix of punctuation and case changes. (Thank God for IntelliSense!)

On Thursday I bought Dragon NaturallySpeaking from my local Fry's. NaturallySpeaking a popular voice recognition software package.  I opted for the Standard Edition, which set me back $100.  Not having had experience with voice recognition software in the past, I was a bit skeptical at how accurate such software could be.  I knew it would not suffice for coding, but my hope was that it would make a good substitute for writing e-mails and authoring articles.  So far, I have been pleasantly surprised with the accuracy and ease of use.  The marketing literature claims over 99% accuracy. I have no clue how accurate it truly is, but keep in mind that even with 99% accuracy that still means that there will be one error every 100 words you utter. And if you are as verbose as I am, 100 words comes very quickly.  Every couple of sentences there are one or two corrections I have to go back and make with my keyboard or voice commands.

Speaking of using voice recognition software for coding, I did try writing a little bit of code with my voice. My only foray into this was with a simple "Hello, world" example. What I intended to write was:

Response.Write("Hello, world!");

I said: "response", "period", "write", "open parenthesis", "open quote", "cap hello", "comma", "world", "exclamation point", "close parenthesis", "semi-colon". What I got was:

Response.  Right ("Hello, world!");

Close, but no cigar.  One of the main problems is that the software injects spaces where it thinks they are needed when speaking English, not when being parsed by a programming language. Moreover, it has trouble with homonyms at times.  Note how it chose to use "Right" instead of "write".

In addition to writing text with your voice you can also use Dragon naturally speaking to issue a computer command such as copy, paste, formatting, and other common commands. The copy and paste features are quite useful, but what can be frustrating is when you say a word to type that to also maps to a command, such as "print" or "close".

All in all, I'd recommend using Dragon NaturallySpeaking or some other voice recognition software for people with some sort of typing impairment who spend much of their day sitting in front of a computer responding to e-mails or writing articles or other documents. It takes some getting used to, and there certainly are errors that you have to put up with, but it is a lot more efficient than typing with one hand and allows you to keep that one good hand on the mouse most of the time.

One warning regarding Dragon NaturallySpeaking: the software does not natively support 64-bit operating systems (although there is a workaround), and certain onboard sound cards are not recognized by the software without a bit of a workaround.  I'll discuss some of the challenges I had installing Dragon NaturallySpeaking, and the steps I took to surmount those challenges in: Installing Dragon Naturally Speaking (DNS) on Vista / Windows Server 2008 64-Bit.

posted @ 7:49 PM | Feedback (8)

Tuesday, July 15, 2008 #

Suggestions for a broken hand?

i broke my right hand playing basketball tonight. splint on, prognosis is 4-6 weeks in a cast that will likely be high enough on  my hand to greatly reduce finger mobility. as it stands now, i can only type w/my left hand and have moved the mouse to my left and switched the right and left buttons, but typing w/ one hand is excruciatingly slow and error-prone. i'm sure practice makes perfect but right now it is frustratingly slooooooooooow.

maybe best to ditch natural keyboard for a 'normal' one as the keys on the natural are so farther apart.

i wonder if there's a key mapping that's ideal for left handed only typing. like dvorak for lefties

any tips on how to get by on a computer with a busted hand?

thanks in advance

posted @ 10:27 PM | Feedback (23)

Sunday, July 13, 2008 #

Three New Master Page Tutorials Published

Tutorials #6, #7, and #8 in my Master Pages Tutorial series on www.asp.net have been published. These tutorials examine the interaction between the master page and its content pages:

  • Interacting with the Master Page from the Content Page [VB | C#] - there may be times when the content page needs to programmatically interact with its master page. This tutorial looks at common scenarios where this type of interaction is needed and shows various techniques for accomplishing this type of interaction.
  • Interacting with the Content Page from the Master Page [VB | C#] - the most typical type of master page and content page interaction originates from the content page. However, there may be times when the master page needs to signal the content page to take some action. This tutorial looks at such scenarios and shows a technique for this style of interaction.
  • Master Pages and ASP.NET AJAX [VB | C#] - web pages that use Microsoft's ASP.NET AJAX framework must include the ScriptManager control on the page. This control can be placed in the master page. This tutorial looks at the effects of adding the ScriptManager to the master page. It also walks through a complete AJAX example and shows how to use the ScriptManagerProxy control to add custom script references in a content page.

Like my past tutorials, these tutorials are all available in C# and VB versions, include a complete working source code download, and are available to download as PDF, as well.

There are two remaining tutorials in this series that should be published by the end of this month. The two remaining tutorials look at specifying a content page's master page at runtime and using nested master pages.

Enjoy! - http://asp.net/learn/master-pages/

posted @ 11:21 AM | Feedback (2)

Thursday, July 10, 2008 #

Two Monitors Are Better Than One, But Are Three Better Than Two?

In my ten year software developer career I've only worked for two companies, and both job experienced pre-dated the 21st century and my graduation from college. At both jobs, I only had one monitor, albeit a rather large one for the time (21” at both companies, if I remember correctly). After graduating, I decided to strike out on my own as a freelance writer, consultant, and trainer, and haven't looked back since. Not knowing any better, I used a solitary monitor until April 2006, when I finally updated to a dual monitor setup. I bought a second video card, picked up the same brand/model of monitor, and graduated into the 21st century. (What prompted me to upgrade to two monitors was, primarily, stories of enhanced productivity from my wife, who was, at the time, working for a company that supplied dual monitors to all its devs. Bill Gates is also a big fan of multiple monitors.)

Two monitors are superior to one for many development- and writing-related tasks. Having Visual Studio in one window and the browser in another and being able to see both simultaneously nets huge performance gains. Likewise, when writing, having Microsoft Word up on one screen and code or a browser is a great time-saver. Today I have a hard time functioning when at a client's site and am reduced to using a single monitor setup. But just how much better are two monitors than one?

Anyone who tells you that they are twice as productive with two monitors than with one is probably over exaggerating. For development- and writing-related activities I find that two monitors allows me to accomplish somewhere on the order of 25%-50% more work in a given unit time. That's a wet finger in the air estimate, but there have been more formal studies. Microsoft Research reports that multiple monitors “can increase your productivity by 9 to 50 percent.” A small study performed by Darrell Norton shows productivity as lines of code per day increased by 10% and defect levels decreased by 26% (hat tip Jeff Atwood). What doesn't get measured in these studies is the increased quality of worklife. Even if the actual productivity gain is nominal, having a second monitor feels better. It lets you see more screen real estate at a given point in time. It lets you compare two documents side by side rather than incessantly Alt-Tabbing.

A couple of months ago I upgraded to a new computer. The only components I salvaged from my old computer was a 350 GB S/ATA hard drive and my two monitors; everything else was bought new. While investigating parts and formulating my shopping list I debated whether to upgrade to three monitors. Jeff Atwood is a big fan of three monitors:

As good as two monitors is, three monitors is even better. With three monitors, there's a "center" to focus on. And 50% more display area. While there's certainly a point of diminishing returns for additional monitors, I think three is the sweet spot. Even Edward Tufte, in the class I recently attended, explicitly mentioned multiple monitors. I don't care how large a single display can be; you can never have enough desktop space.

I didn't think a third monitor would make me any less efficient, but I questioned as to whether the improvements in efficiency (or quality of worklife) were as grandiose as Jeff made them out to be. In the end I decided to give it a whirl. I bought two GeForce 8600 GT video cards for the new system. These have dual DVI outputs meaning that I could upgrade to a fourth monitor if I were so inclined. I kept the two monitors from my previous setup - 17 inch monitors from Sharp - and bought a new Samsung SyncMaster 2053 BW monitor, which is a wide screen that has about the same visible height at the Sharps, but is about 33% wider. The two Sharps run at 1280x1024, the Samsung at 1680x1050.

I've been using the three monitor setup for a couple of months now and regret to say that I have not seen the same productivity benefits or improvement of worklife that Jeff espouses or that I enjoyed when going from one monitor to two. For certain tasks I am more productive with three monitors than two, a prime example being if I need to review a client's email while bug bashing. I can have the email open that explains the error in one window, Visual Studio in another, and the web application running in the third. However, for most other activities the third monitor does not add too much value. Consequently, it's not uncommon for one of the three to sit unused for long stretches of time.

Three monitors also have some detriments that weren't present with two. Because of the width of the three monitors, I frequenty tilt my neck to see the side monitors; with two monitors I could see both with when looking straight ahead by just turning my eyes, but not with three. The net result is that if I spend an inordinate amount of time focusing on one of the side monitors my neck becomes a bit stiff. To combat this I try to make myself swivel my chair when I start looking at a side monitor, but it's second nature for me to turn my head and I don't realize that I'm not swiveling until my neck starts to bother me.

In the end, three monitors are better than two, just like I imagine four would be better than three, but the returns on multiple monitors quickly diminish as the number of monitors grow (at least for my line of work and from my personal work habits). Knowing what I know now, if I had to choose between a third monitor and some other upgrade (perhaps a super high-end hard drive or a high-end office chair), I'd stick with two monitors and take my luck with what's behind Door Number 1.

posted @ 8:52 PM | Feedback (8)

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<August 2008>
SMTWTFS
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Comment Stats

DayTotal% of Total
Sunday 1926.8%
Monday 39714.1%
Tuesday 47316.8%
Wednesday 52318.6%
Thursday 54519.4%
Friday 51118.1%
Saturday 1756.2%
Total 2816100.0%

Hour1Total% of Total
12:00 AM 692.5%
1:00 AM 712.5%
2:00 AM 642.3%
3:00 AM 762.7%
4:00 AM 592.1%
5:00 AM 1124.0%
6:00 AM 1113.9%
7:00 AM 1625.8%
8:00 AM 1776.3%
9:00 AM 1515.4%
10:00 AM 1746.2%
11:00 AM 1836.5%
12:00 PM 1926.8%
1:00 PM 1786.3%
2:00 PM 1605.7%
3:00 PM 1344.8%
4:00 PM 1134.0%
5:00 PM 993.5%
6:00 PM 923.3%
7:00 PM 993.5%
8:00 PM 873.1%
9:00 PM 812.9%
10:00 PM 832.9%
11:00 PM 893.2%
Total 2816100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 5.14144
Monday 5.28359
Tuesday 4.31448
Wednesday 7.51646
Thursday 6.82634
Friday 5.35417
Saturday 5.09168
Total 5.752816

Hour1 Entry MadeAvg.Total
12:00 AM 5.0035
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 7.0035
8:00 AM 5.24110
9:00 AM 6.09280
10:00 AM 6.35254
11:00 AM 4.28184
12:00 PM 6.86343
1:00 PM 2.87112
2:00 PM 5.29222
3:00 PM 8.57300
4:00 PM 3.7694
5:00 PM 5.79162
6:00 PM 4.56114
7:00 PM 9.58182
8:00 PM 8.78158
9:00 PM 5.18114
10:00 PM 5.9383
11:00 PM 4.5732
Total 5.752816

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles