Software is hard!

Not too long ago, I was telling my uncle about an e-commerce site that a coworker and I were able to develop in about 4 months. I was shocked at his next query:

What is so hard about that? Why did it take so long?

What??? I write thousands of lines of code over dozens of pages, and you don't get it? In a way, that means the software was successful. Often, the simpler the end result, the more code it takes to achieve that simplicity. Most users are completely oblivious to what it takes to create something that actually works.

Frustrated Developer

Windows has over 50 million lines of code, which was written by over 5000 developers. I've heard that NASA spends over $10,000 per line of production code.

So why IS software so hard? It usually requires the entire mental ability of a software developer. In a given day, one would surely exercise their entire brain.

To write a feature, here is just a fraction of what must be considered:

  • Software creation is art and science. You must be creative, imaginative, logical, talented, and knowledgeable.
  • Layer synchronization - Data gets passed up and down between layers, and they all need to agree on how they will call other functionality, as well as how they need to be called. Decisions need also be made to determine if and where data will be validated.
  • Failure modes must be considered - For every line of code, there needs to plan to handle that failure.
  • Affected code needs to be evaluated - Ever heard the line "this is a small change, it won't break anything". I'm not falling for that one again. It's like changing out a block at the base of a pyramid.
  • A testing strategy needs to be formulated - Unit tests need to test the new code, and acceptance tests need to test the new functionality
  • More code must be maintained - Every line of code you write counts toward the theoretical maximum number of lines of code that you can realistically maintain.
  • Consider performance and memory - The questions in this area are virtually endless, and the answers might not come easy. Compromise is inevitable.
  • Technology considerations - How much does the target platform vary? What technologies will work, and which ones are the best?
  • Balance modularity and simplicity - Sometimes they go hand in hand, sometimes they're a tradeoff.
  • Balance the needs of the present with the needs of the future - Try not to play the "What If?" game, but at the same time, don't be ignorant of the future.
  • Many companies have cross functional teams that developers must report to. Instead of having a manager that feeds a developer their work, now you have multiple sources that are asking for conflicting information. So much for a developer abstraction layer.
  • You're not the only developer - You need to be cooperative and collaborative to simplify the integration of your code.

Nothing is ever as simple as it seems. You're not going to piece together code snippets from the web and create a great product.

Like this post? Please share it!

See a mistake? Edit this post!

Code Snippets in Windows Live Writer

I was asked how I insert code snippets with Windows Live Writer. I actually did it the hard way. I wrote a Windows Live Writer plug-in, and then I found out someone had already done the same thing.

I originally got scared away from it because when I switch to the HTML view in Live Writer, it shows up like this:

<div class="wlWriterEditableSmartContent" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:19d17d14-ac74-45e7-9276-5c6a3031b09d" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"><DIV class=dp-highlighter>
<DIV class=bar>
<DIV class=tools><A onclick="'ViewSource',this);return false;" href="about:blank#">view plain</A><A onclick="'CopyToClipboard',this);return false;" href="about:blank#">copy to clipboard</A><A onclick="'PrintSource',this);return false;" href="about:blank#">print</A><A onclick="'About',this);return false;" href="about:blank#">?</A></DIV></DIV>
<OL class=dp-xml>
<LI class=alt><SPAN><SPAN>test&nbsp;&nbsp;</SPAN></SPAN></LI></OL></DIV><PRE class=xml style="DISPLAY: none" name="code">test</PRE>

That is just unacceptable. Fortunately, I realized that it just renders that temporarily, so that you can see a better preview of what it will actually look like on your site.

When you post it, it still has the annoying div above the pre, but I can live with that. All of the other added tags are not there, and you just get your code wrapped in a nice pre. I'm assuming it's there so that it recognizes that as a code block if you want to edit it later.

I like the SyntaxHighlighter code because it uses JavaScript to parse apart the code and add in the appropriate styles. It's a nice separation between content and presentation.

I do recommend that if you use the SyntaxHighlighter, that you combine the JavaScript files into one, and then run it through a JavaScript compressor. That will minimize file sizes and page requests.

For example, in this blog, I simply include this in each page:

<link href='' rel='stylesheet' type='text/css'/>
<script src='' type='text/javascript'></script></pre></div>

Before the body tag, I then use this code:

<script type='text/javascript'>
    dp.SyntaxHighlighter.ClipboardSwf = '';

This has been working great on my site. Hope that helps you out!

Like this post? Please share it!

See a mistake? Edit this post!

Free Software! - Visual Studio 2008, Windows 2008 Enterprise and Windows Vista Ultimate

I have some free software that I'd like to give away! Here is your chance to win one of the following:

  • Visual Studio 2008 Standard Edition AND Windows 2008 Enterprise (64-bit and 32-bit) - Including the virtual keys.
  • Windows Vista Ultimate with SP1

These copies are fully functional, unused full versions. Microsoft asks that you stop using them after a year, but they have stated that there is no technical limitation that would keep you from using them past that date.

Free Software - Vista, Visual Studio, and Windows Server

There is no purchase necessary to enter. There are 3 ways to enter:

If you add this site to your blogroll, or subscribe, make sure you post a comment or send me an email so I can enter you.

The site that sends me the most unique visitors according to my logs will get first pick at which one they want. The other winner will be chosen randomly. That will give everyone a chance at winning, but gives some incentive to link to our site.

The good news is that this isn't the most popular site on the Internet, so you might actually have a shot at winning!

The contest ends May 31st, and I'll pick and announce the winners in a blog post on June 1st.

Like this post? Please share it!

See a mistake? Edit this post!

Jason Young I'm Jason Young, software engineer. This blog contains my opinions, of which my employer - Microsoft - may not share.

@ytechieGitHubLinkedInStack OverflowPersonal VLOG