<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#34;Hello World&#34; - The SlickEdit Developer Blog &#187; Programming</title>
	<atom:link href="http://blog.slickedit.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.slickedit.com</link>
	<description>&#34;Hello World&#34; - The SlickEdit Developer Blog</description>
	<lastBuildDate>Wed, 25 Jan 2012 15:25:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Dr. StrangeUnix Or: How I Learned to Stop Worrying and Love the Mac</title>
		<link>http://blog.slickedit.com/2012/01/dr-strangeunix-or-how-i-learned-to-stop-worrying-and-love-the-mac/</link>
		<comments>http://blog.slickedit.com/2012/01/dr-strangeunix-or-how-i-learned-to-stop-worrying-and-love-the-mac/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 15:25:19 +0000</pubDate>
		<dc:creator>Dan H</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[slickedit]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=262</guid>
		<description><![CDATA[Early in the last decade, the number of requests we got for a Mac version started to increase dramatically.  One of our developers at the time was particularly afraid he would be chosen to do this work because he had some Mac experience &#8211; but he really didn&#8217;t want to.  Naturally, he came in one morning [...]]]></description>
			<content:encoded><![CDATA[<p>Early in the last decade, the number of requests we got for a Mac version started to increase dramatically.  One of our developers at the time was particularly afraid he would be chosen to do this work because he had some Mac experience &#8211; but he <em>really</em> didn&#8217;t want to.  Naturally, he came in one morning to discover on his desk an old Mac SE30 that used to be used for something around here (I believe it was used to print out labels for floppy disks) sitting on his desk with a Mac OSX CD hanging out of the floppy disk drive and a note that read &#8220;[Developer name changed to protect their identity] &#8211; see me &#8211; Clark&#8221;.  (Note to our new users: SlickEdit has been around long enough that it used to ship on floppy disks) (Note to users under 30 &#8211; <a href="http://en.wikipedia.org/wiki/Floppy_disk">USB sticks did not always exist</a>).</p>
<p>The prevailing wisdom at the time was that it would be easy for us to do a Mac version, &#8220;because it&#8217;s just UNIX now, and you guys are UNIX already &#8211; it&#8217;ll just be another port&#8221;.  I remember hearing this over and over at trade shows in between requests for Ruby support, and &#8220;Do you guys have any free t-shirts?&#8221; (Right now, there&#8217;s a guy in his basement inventing a new scripting language, convinced his will be the one that will take over the world, obsoleting all other scripting languages.  I really wish somebody would stop him, because it won&#8217;t take over and obsolete all other scripting languages, but it will become just popular enough we will have to support it.  When I say &#8220;stop him&#8221;, I don&#8217;t mean hurt him or anything &#8211; just take him out to dinner or introduce him to a woman).</p>
<p>It turns out the &#8220;It&#8217;s just UNIX now&#8221; logic is a bit, what&#8217;s the word I&#8217;m looking for&#8230;. <strong>wrong</strong>.  There is UNIX under there, and obviously that was a good place to start when they revamped MacOS.  Plus, I can get a console window which was always my complaint about Macs &#8220;back in the day&#8221; (yes, I know you could install something, I maintain it should just be there).  But what the fact that &#8220;It&#8217;s just UNIX now&#8221; got us was the ability to create an X11 application that would run on the Mac.  So we did that &#8211; and customers loved it.  Well, that isn&#8217;t exactly true.  They acted more like we gave them a new BMW but first used it for one of those things you see at the county fair where you pay a dollar and get to hit a car with a sledgehammer (granted they usually do this with demolition derby cars, not new BMWs).  It was SlickEdit &#8211; it worked, but it just didn&#8217;t look or feel like people expected it to. Hardcore SlickEdit fans were happy&#8230; ish.  They were happy to have SlickEdit, but they missed all the Mac-isms, and were a little perturbed by SlickEdit&#8217;s menu being attached right to the top of the application window.</p>
<p>So, starting sometime in 2010 our CTO began the process of exploring how to get us a native version on the Mac &#8211; and the GUI overhaul that ensued stayed largely in his office until sometime this past spring when different team members began to have certain controls assigned to them to port to our new GUI framework (I&#8217;m not going into which one here, the evidence is &#8220;out there&#8221;).  I was able to be part of this process, and it was very interesting work.  It is an exciting time to work here at SlickEdit.</p>
<p>We had a nice long beta test &#8211; a little longer than we planned. I would like to take a moment to say that our beta testers were some of the best we&#8217;ve ever dealt with.  Even when there were problems, the comments almost always went something like &#8220;It crashed, but thanks for doing a native Mac version, great work, looking forward to the next version!&#8221;.  The beta testers this time were aces &#8211; some of them old SlickEdit fans we&#8217;ve known for a while, and I believe we made some new friends too.  Thanks guys.</p>
<p>So, our native Mac version is &#8220;out there&#8221; now.  We hope everybody likes it.  Typically I haven&#8217;t been a big Mac fan, but I&#8217;m learning to appreciate the things that it does well.  I only wish I could get a few people to join me in an Indiana Jones like quest to track down the eleven remaining single button mice on the planet and then Ctrl+Click could work properly.</p>
<p>If you bought any of our X11 versions on the Mac you can get the new version for free. <a href="http://www.slickedit.com/products/slickedit-for-mac">Here&#8217;s the link</a>,or you can give our sales team a call at (919) 473-0070.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2012%2F01%2Fdr-strangeunix-or-how-i-learned-to-stop-worrying-and-love-the-mac%2F';
  addthis_title  = 'Dr.+StrangeUnix+Or%3A+How+I+Learned+to+Stop+Worrying+and+Love+the+Mac';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2012/01/dr-strangeunix-or-how-i-learned-to-stop-worrying-and-love-the-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up new file types with the SlickEdit Core plugin</title>
		<link>http://blog.slickedit.com/2011/12/setting-up-new-file-types-with-the-slickedit-core-plugin/</link>
		<comments>http://blog.slickedit.com/2011/12/setting-up-new-file-types-with-the-slickedit-core-plugin/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 16:52:32 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=856</guid>
		<description><![CDATA[Many developers work with source code which resides in files with &#8220;non-standard&#8221; extensions. By a standard extension, I am referring to something like .cpp or .java. By a non-standard extension, I am talking about .ryan, or .data. I will show you how to quickly and easily set up your SlickEdit Core editor in Eclipse to [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers work with source code which resides in files with &#8220;non-standard&#8221; extensions. By a standard extension, I am referring to something like .cpp or .java. By a non-standard extension, I am talking about .ryan, or .data. I will show you how to quickly and easily set up your SlickEdit Core editor in Eclipse to handle these files the way you want them handled.</p>
<p>Let&#8217;s assume you have some file extension which is not already set up accurately in the default SlickEdit Core configuration. It might be something your company only uses internally. Let&#8217;s use .data for this example.</p>
<p>I have a workspace created which includes some .data files, and what I first see in the Navigator view is this:</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2011/12/data_orig.png"><img class="size-full wp-image-860 alignnone" style="margin: 3px;" src="http://blog.slickedit.com/wp-content/uploads/2011/12/data_orig.png" alt="" width="201" height="107" /></a></p>
<p>When I go to open one of these files, Eclipse will use the standard Text Editor because it does not know better:</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2011/12/data_open.png"><img class="size-full wp-image-858 alignnone" style="margin: 5px;" src="http://blog.slickedit.com/wp-content/uploads/2011/12/data_open.png" alt="" width="378" height="283" /></a></p>
<p>Not terribly useful&#8230;clearly the SlickEdit editor has not been opened, and we have no language support whatsoever. These appear to be COBOL files&#8230;so we should set up Eclipse to recognize them as such, and also tell SlickEdit that these files should be treated as COBOL code.</p>
<p>The first step is to go to <strong>Window &gt; Preferences &gt; Editors &gt; File Associations</strong> and add <strong>*.data</strong> as a &#8220;New File Type&#8221;. Then select <strong>*.data</strong> in the list and click the <strong>Add</strong> button in the &#8220;Associated Editors&#8221; pane. Now select &#8220;SlickEdit Editor&#8221;. Make sure you mark &#8220;SlickEdit Editor&#8221; as the &#8220;Default&#8221; editor for this file type. Now we have told Eclipse to open all .data files with the SlickEdit Editor.</p>
<p>We are not quite finished yet. Now we need to tell SlickEdit to treat these files as COBOL. So, go to <strong>Window &gt; SlickEdit Preferences &gt; Languages &gt; File Extension Manager</strong> and create a new extension for <strong>data</strong> (just data&#8230;not *.data), and assign the language to be Cobol 85. Click &#8220;OK&#8221;, and then click &#8220;OK&#8221; on the SlickEdit Preferences dialog. Now when you open up one of these .data files, you will see the correct editor opened with the correct language support.</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2011/12/data_final.png"><img class="alignleft size-full wp-image-861" src="http://blog.slickedit.com/wp-content/uploads/2011/12/data_final.png" alt="" width="386" height="300" /></a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F12%2Fsetting-up-new-file-types-with-the-slickedit-core-plugin%2F';
  addthis_title  = 'Setting+up+new+file+types+with+the+SlickEdit+Core+plugin';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2011/12/setting-up-new-file-types-with-the-slickedit-core-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SlickEdit Core for Mainframe Developers</title>
		<link>http://blog.slickedit.com/2011/12/slickedit-core-for-mainframe-developers/</link>
		<comments>http://blog.slickedit.com/2011/12/slickedit-core-for-mainframe-developers/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 15:07:44 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=798</guid>
		<description><![CDATA[The problem of retiring mainframe developers has been well publicized in recent years. Mainframe systems are not going anywhere, and programmers now expect to be working within the comforts of a modern IDE, rather than on a simple terminal. Eclipse-based front ends have become great solutions for this new generation of programmers working on mainframe [...]]]></description>
			<content:encoded><![CDATA[<p>The problem of retiring mainframe developers has been well publicized in recent years. Mainframe systems are not going anywhere, and programmers now expect to be working within the comforts of a modern IDE, rather than on a simple terminal. Eclipse-based front ends have become great solutions for this new generation of programmers working on mainframe systems.</p>
<p>Since the Eclipse IDE has become so popular for mainframe developers, we have been dedicating more and more resources to our mainframe language support. The SlickEdit editor is even now integrated into the <a href="http://www.compuware.com/mainframe-solutions/workbench-mainframe-modernization.html" target="_blank">Compuware Workbench</a>:</p>
<p><em>Supports a vast array of programming languages for source code editing, powered by SlickEdit.</em></p>
<p>PL/I is one of the mainframe languages that got a major support upgrade in the newly released SlickEdit Core v3.7.1. The SlickEdit editor now has full support for parsing structures, includes, and even statement level tagging for PL/I code.</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2011/12/factorial-e1323118282861.png"><img class="size-full wp-image-812" src="http://blog.slickedit.com/wp-content/uploads/2011/12/factorial-e1323118282861.png" alt="" width="500" height="331" /></a></p>
<p>SlickEdit Core also has great support for COBOL, JCL, REXX, and other languages. If you are a mainframe developer coding in an Eclipse-based environment, try out the latest version of the SlickEdit Core plugin for <a href="http://www.slickedit.com/trial/slickedit-core" target="_blank">free</a>.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F12%2Fslickedit-core-for-mainframe-developers%2F';
  addthis_title  = 'SlickEdit+Core+for+Mainframe+Developers';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2011/12/slickedit-core-for-mainframe-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Didn&#8217;t Buy Your Book</title>
		<link>http://blog.slickedit.com/2011/10/i-didnt-buy-your-book/</link>
		<comments>http://blog.slickedit.com/2011/10/i-didnt-buy-your-book/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 15:56:42 +0000</pubDate>
		<dc:creator>Matthew E</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=766</guid>
		<description><![CDATA[Dear Computer Book Publisher: I didn&#8217;t buy your book. There are several reasons I walked out the door without shelling out for your title. First off, fifty bucks on the sticker price subjects a book to a lot of extra scrutiny. When I think of all I can do with that sum, the bar gets [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Computer Book Publisher:</p>
<p>I didn&#8217;t buy your book. There are several reasons I walked out the door without shelling out for your title.</p>
<p>First off, fifty bucks on the sticker price subjects a book to a lot of extra scrutiny. When I think of all I can do with that sum, the bar gets set pretty high. This used to be somewhat ameliorated when Borders was still a going concern. Their frequent 30% and 40% discount coupons made me a little more cavalier in my purchasing decisions. I am now limited to shopping Barnes and Noble. They have a good selection of titles, but they are a bit more stingy with the coupons, and a 10% discount barely covers our state sales tax. I&#8217;m still willing to part with two Jacksons or more, but you&#8217;ve gotta wow me.</p>
<p>Why does your book have 10 authors, including 9 I&#8217;ve never heard of? Unless I&#8217;m reading a short story anthology, I&#8217;d prefer to see just one or two subject matter experts. I get a little suspicious when the author count goes above 3.</p>
<p>Annotated code samples and snippets are wonderful. And bonus points can be earned for legibility-enhancing color coding. But I really don&#8217;t care to pay for the trees you chopped down to provide over 200 pages of mostly boilerplate code. I work with computers for a living, so I&#8217;m not afraid to download a zip file with source code. Look into it.</p>
<p>Your book won&#8217;t stay open. I know a nice binding, especially a hardback binding is going to cost more. But I don&#8217;t have two sets of arms. Most of the time I&#8217;m reading a computer book while trying to work on the computer. I&#8217;d prefer not to have to pin down a page with empty coffee mugs and my left elbow while trying to type in a code sample.</p>
<p>Your index isn&#8217;t helping me find what I need. If I&#8217;m in the market for a programming title, it&#8217;s often because I am unfamiliar with the language or technology. And since I&#8217;m not plugged into the lingo yet, I need all the help I can get finding the relevant passages. An index that is 90% class and function names does me little good.</p>
<p>Before you decry how internet retailers are pushing down your margins, let me assure you that I still buy most of my software titles in a brick and mortar store. I&#8217;ve been disappointed too many times buying books online, sight unseen. I need to hold a book in my hands and flip few a couple chapters. I&#8217;ll buy that book in the store, but you&#8217;re going to have to work a little harder for my money.</p>
<p>Sincerely,</p>
<p>TechBookShopper</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F10%2Fi-didnt-buy-your-book%2F';
  addthis_title  = 'I+Didn%26%238217%3Bt+Buy+Your+Book';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2011/10/i-didnt-buy-your-book/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>The Point Release (or When to Let Go)</title>
		<link>http://blog.slickedit.com/2011/07/the-point-release-or-when-to-let-go/</link>
		<comments>http://blog.slickedit.com/2011/07/the-point-release-or-when-to-let-go/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 16:05:07 +0000</pubDate>
		<dc:creator>Matthew E</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>
		<category><![CDATA[16.0.1]]></category>
		<category><![CDATA[hot fix]]></category>
		<category><![CDATA[point release]]></category>
		<category><![CDATA[slickedit]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=697</guid>
		<description><![CDATA[We&#8217;ve just released our first major update for SlickEdit 2011. And for some reason, point releases seem to me to be the oddest phase of the software life cycle. It doesn&#8217;t seem like that big a deal on the surface. You fix some bugs, polish a few features, and sneak in some customer requests. You [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just released our first major update for SlickEdit 2011. And for some reason, point releases seem to me to be the oddest phase of the software life cycle. It doesn&#8217;t seem like that big a deal on the surface. You fix some bugs, polish a few features, and sneak in some customer requests. You run regression tests and sanity checks, then release it into the wild. But a service pack release is not really all that simple.<span id="more-697"></span></p>
<p>The primary oddity I see is the scheduling of the release. Hot fixes are easy. A problem comes up, you investigate and fix it, then send out the small update. And for us at SlickEdit, major releases are dictated by our annual release cycle. We *will* have a beta in the early spring and we *will* have the major release out late spring/early summer. Lawns go un-mowed, playoff hockey goes unwatched, and &#8220;I&#8217;ll be home for dinner&#8221; promises are broken in order to meet the schedule. For hot fixes and major releases all of the time pressure is one-way: the sooner the better.</p>
<p>A point release is just harder to time as there are forces pulling at both ends of the schedule. An earlier release means customers don&#8217;t have to wait as long for the features we had to let slip initially. There is a shorter wait for resolutions to the small bugs that didn&#8217;t warrant a hot fix. An earlier release means that the quality of the trial version is better sooner. And the quicker it goes out the door, the sooner we can focus all attention on feature development for the next major release.</p>
<p>But there are also forces that want to delay the service pack. More time means more polish, fewer bugs, and more special requests that can be accommodated.</p>
<p>This release is a little more poignant for me personally. I primarily work on the Mac version of SlickEdit. And we are committed to providing a native version for 2012, meaning that we&#8217;re finally getting rid of our X11-based UI. It&#8217;s a welcome (admittedly overdue) change, and I&#8217;m enjoying the early progress we&#8217;re making. But this release of 16.0.1 represents the last chance we have to make the X11 version work as well as it can.</p>
<p>But now the release notes have been finalized, customers have received the update e-mails, and it&#8217;s time to call 16.0.1 done.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F07%2Fthe-point-release-or-when-to-let-go%2F';
  addthis_title  = 'The+Point+Release+%28or+When+to+Let+Go%29';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2011/07/the-point-release-or-when-to-let-go/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Threads and a Bicycle-built-for-two</title>
		<link>http://blog.slickedit.com/2011/05/threads-and-a-bicycle-built-for-two/</link>
		<comments>http://blog.slickedit.com/2011/05/threads-and-a-bicycle-built-for-two/#comments</comments>
		<pubDate>Tue, 24 May 2011 14:09:10 +0000</pubDate>
		<dc:creator>Dennis B</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=660</guid>
		<description><![CDATA[Building a bicycle-built-for-two isn&#8217;t a great metaphor for designing multi-threaded software, but I needed catchy title, so there you have it. Few companies and few developers like to talk about the warts in their software, but let&#8217;s face it &#8212; for decades, SlickEdit has been a single threaded application, nothing but a bicycle-built-for-one. That single [...]]]></description>
			<content:encoded><![CDATA[<p>Building a bicycle-built-for-two isn&#8217;t a great metaphor for designing multi-threaded software, but I needed catchy title, so there you have it.</p>
<p>Few companies and few developers like to talk about the warts in their software, but let&#8217;s face it &#8212; for decades, SlickEdit has been a single threaded application, nothing but a bicycle-built-for-one.  That single thread rode high and strong and did what it wanted, with all the powers and dangers of the world granted to it to do as it pleased.  Let&#8217;s call this thread George, King George, as it was.</p>
<p>Then we decided to let another thread into our world.  Well, needless to say, King George did not like this newcomer in his kingdom.  Suddenly, he had to synchronize his peddling and braking and balancing with another thread, and let me tell you, he was not used to doing so much paperwork.  Sorry, George, you have to acquire a Mutex before you can use the memory allocator.  Sorry, George, you have to release the Mutex when you are done.  George was angry, frustrated, and not accustomed to waiting in line behind these mere peasants.  They were supposed to make his life easier.  Instead, they pervasively filled his kingdom with landmines.  George had to step carefully from now on.  His smallest comfort was that those little threads also had to step carefully, very carefully.  The King was also comforted to know that there still were places that only he could step.</p>
<p>Converting a single-threaded piece of software into multi-threaded software is a task that requires vision.  It also requires strictness and thorough investigation of what-calls-what and what-uses-what.  The vision comes from finding ways to utilize asynchronous processing and deciding what parts of the application to make thread safe first.  The vision also comes from learning new ways to design less stateful APIs and data structures so that you can minimize access to shared data, or at least make the access thread-safe.</p>
<p>It can&#8217;t be done all at once.</p>
<p>The techniques for writing thread-safe software and multi-threaded software in general are well documented.  It is certainly not a new science, but each thing you convert poses new challenges.</p>
<p>My challenge in SlickEdit 2010 and SlickEdit 2011 was to make it possible for a thread to parse code and insert indexing information into a tag database.  Well, that certainly can&#8217;t be real hard.  That is, until you meet King George.</p>
<p><strong>Step 1:  A thread that parses code</strong></p>
<p>SlickEdit has great parsers for many, many languages; the problem was, none of them were written in a thread-safe manner.  The lexical analyzer framework was completely stateful and also lacking in flexibility and power.  Every parser would need a new lexer, and it had to perform well.  The invocation mechanism depended on the Slick-C interpreter, which is still far away from being a thread-safe component.  The parsers used global data when they wanted to and communicated directly with the database.  To make a long story short, a lot of code had to change.</p>
<p><strong>Step 2: A tagging job queuing framework</strong></p>
<p>Once we could parse code, we couldn&#8217;t just start creating threads all willy-nilly.  We needed a block of threads to do the work and pass the results forward to the editor.  We needed to define what a tagging job was and how the indexing information was collected.  We needed to reconsider every place where the editor would launch tagging jobs and see if those jobs could be done on a thread.  As it turned out, the answer was &#8220;nearly everywhere&#8221;.  Oh, by the way, King George liked that.</p>
<p><strong>Step 3:  A thread-safe tag database</strong></p>
<p>This is one of the big steps forward in SlickEdit 2011.  A thread can write to the tag database, making it possible to do everything required to build or update a tag database completely in the background.  This was no easy task, because the tag database is a sophisticated component that was built specifically for King George.  We had to rethink how we traversed through items in the database.  We had to get rid of shared global variables.  We had to refine the database block cache so it could be shared by threads.</p>
<p><strong>Step 4: Getting a list of files to tag on a thread</strong></p>
<p>The final step was to scale the threading up from allowing the main thread to schedule jobs one at a time to having a thread schedule a a list of files to be tagged.  We needed this thread to find all the files in your workspace, check dates, figure out what language the files were, and finally schedule anything that was new or out-of-date to be tagged.  This meant rewriting a lot of single-threaded Slick-C code as thread-safe C++.  The speed gains from this change were significant.</p>
<p><strong>The final result</strong></p>
<p>SlickEdit 2011 is a huge improvement over SlickEdit 2010 with respect to its handling of background tagging.  King George is beginning to appreciate what these little threads are doing for him and how they are making his job easier now.</p>
<p><strong>The worst problem:  Mutex acquisition order</strong></p>
<p>This is what I regard as the worst thread-safe code synchronization problem.  Now, if you are fortunate enough to be writing thread-safe code from scratch, where you have an existing, clearly modularized code whose critical sections are small, short-lived, and well encapsulated, it is not a problem likely to hurt you unless you do something silly.  But, when you have a large base of single-threaded code with large amounts of shared data that you have to try to make access to thread safe, things get ugly really fast.  Here is the classic deadlock condition.</p>
<pre>   VSMUTEX mutex1;
   VSMUTEX mutex2;</pre>
<p>In the main thread, King George does this.</p>
<pre>    mutex1.lock();
    ...                        // I own mutex1 and rule supremely
    ...                        // except that I don't own mutex2 yet
    mutex2.lock();</pre>
<p>In another thread, some peasant does this.</p>
<pre>   mutex2.lock();
   ...                          // I own mutex2, nobody else can have it,
   ...                          // not even my reverent King
   mutex1.lock();</pre>
<p>When King George has mutex2 and is trying to get mutex1, and simultaneously, another thread has mutex1 and is trying to get mutex2, they will deadlock forever.  There are a few ways around this, but the best way is the classic solution of <em>don&#8217;t do that</em>.  The problem is that it is hard to see how pervasive this problem can be when some special case, such as error handing, causes everything you think you know about what order you acquire Mutex&#8217;s in to be reversed.  This is a problem that can only be solved with thorough analysis and testing and fundamentally sound designs.  But, given the circumstances surrounding migrating older single-threaded code to support threading, such designs are harder to come by than one would hope.</p>
<p><strong>Summary</strong></p>
<p>If you read this whole thing looking for deep insight on how to write solid thread-safe code, well, you probably finished sadly disappointed.  If you are planning on renting a bicycle built-for-two with your spouse and were looking for riding tips, then you really, really read the wrong article.  If you came here because you always thought SlickEdit should do tagging in the background and wondered why it took us so long to implement it that way, then maybe now you understand the obstacles and hurdles a little better.  We are still iteratively improving the system and working to improve the tagging throughput.  You can look forward to seeing even more performance gains and scaling in the first update (16.0.1).</p>
<p>SlickEdit is moving forward, and finally, George isn&#8217;t the only one peddling the bike.</p>
<p><a style="display: none;" rel="tag" href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=&lt;7950660&gt;">CodeProject</a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F05%2Fthreads-and-a-bicycle-built-for-two%2F';
  addthis_title  = 'Threads+and+a+Bicycle-built-for-two';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2011/05/threads-and-a-bicycle-built-for-two/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Things I Learned During the 64-bit Port &#8211; Volume 1</title>
		<link>http://blog.slickedit.com/2011/05/things-i-learned-during-the-64-bit-port/</link>
		<comments>http://blog.slickedit.com/2011/05/things-i-learned-during-the-64-bit-port/#comments</comments>
		<pubDate>Wed, 18 May 2011 14:32:55 +0000</pubDate>
		<dc:creator>Dan H</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SlickEdit 2011]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=648</guid>
		<description><![CDATA[I haven&#8217;t written a ton of posts for the SlickEdit blog.  I tend to save it for instances where I find something humorous that I can cross-reference.  I actually do not have a lot of humor to offer this time, but having worked through our 64-bit port in the last few months I do have [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t written a ton of posts for the SlickEdit blog.  I tend to save it for instances where I find something humorous that I can cross-reference.  I actually do not have a lot of humor to offer this time, but having worked through our 64-bit port in the last few months I do have a few interesting observations that are worth sharing.  Also, my manager asked if I would write something, and assured me that something noteworthy must have occurred during the 64-bit port.  He also mentioned that it should not involve any of the colorful string of adjectives that came out of of my cubical during that period of time.  It occurs to me as I write this that he might ask this again, so I&#8217;ve gone with the &#8220;Volume 1&#8243; naming scheme&#8230; of course if I never write about this topic again it wouldn&#8217;t be the first time that something named &#8220;Volume 1&#8243; is never followed up with a &#8220;Volume 2&#8243;.</p>
<p>As we began the 64-bit port we faced the same challenges as any company dealing with a large established code base.  A lot of typing issues.  In the 64-bit world, <strong>long</strong> means different things on different platforms.  In some cases it doesn&#8217;t make any difference, in others it does.  These cases have to be carefully examined.  In some cases the solution was not to use <strong>long</strong> at all.  There were cases where we had used <strong>long</strong> because it seemed like the right thing to do, but on careful examination, <strong>int</strong> is completely sufficient.</p>
<p>However, the most interesting case we came up against was a call to the X-Windows library.  The specific call had looked like this for years:</p>
<div>
<pre>   XtVaSetValues(xftXtTopLevelShell,
               XtNx, -1000,
               XtNy, -1000,
               XtNwidth, 100,
               XtNheight, 100,
               XtNmappedWhenManaged, False,
               0);</pre>
</div>
<p>And it was fine in our initial builds and testing.  But as we approached our first beta and started to compile our release configuration, the editor would crash on this line.  I spent an evening trying different compiler options, and different versions of the compiler, because I simply did not see a problem with this line.  But there is one.</p>
<p>The functions that start with XtVa take a variable number of arguments.  In this case, that last argument &#8211; the &#8217;0&#8242; &#8211; is a pointer.  On a 32-bit system, a pointer is 32-bits wide, and an <strong>int</strong> is 32-bits wide.  So passing 0 works just fine.  On a 64-bit system, pointers are 64-bits wide, and NULL is a 64-bit unsigned number. 0, however, is a 32-bit signed number.  Which actually works fine&#8230; until you turn on compiler optimizations.</p>
<p>&nbsp;</p>
<p>Here is the corrected code:</p>
<pre>   XtVaSetValues(xftXtTopLevelShell,
               XtNx, -1000,
               XtNy, -1000,
               XtNwidth, 100,
               XtNheight, 100,
               XtNmappedWhenManaged, False,
               NULL);</pre>
<p>This wasn&#8217;t the most confusing problem I encountered, in fact I&#8217;m sure to a seasoned 64-bit Linux guru it should not have a been a problem at all.  But it was one of the things I felt was interesting enough to share here.</p>
<p>Anybody have a good 64-bit porting horror story?  Let&#8217;s hear them.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F05%2Fthings-i-learned-during-the-64-bit-port%2F';
  addthis_title  = 'Things+I+Learned+During+the+64-bit+Port+%26%238211%3B+Volume+1';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2011/05/things-i-learned-during-the-64-bit-port/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Homemade SlickEdit Box</title>
		<link>http://blog.slickedit.com/2011/04/homemade-slickedit-box-3/</link>
		<comments>http://blog.slickedit.com/2011/04/homemade-slickedit-box-3/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:32:20 +0000</pubDate>
		<dc:creator>Lyndsey</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>
		<category><![CDATA[SlickEdit DVD Box]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=626</guid>
		<description><![CDATA[A SlickEdit user thought it would be nice to have SlickEdit displayed on his bookshelf, so we sent him an image and he created his own homemade SlickEdit box. It looks great! addthis_url = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F04%2Fhomemade-slickedit-box-3%2F'; addthis_title = 'Homemade+SlickEdit+Box'; addthis_pub = '';]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.slickedit.com/wp-content/uploads/2011/04/Homemade-SlickEdit-DVD-Cover1.jpg"><img class="aligncenter size-full wp-image-627" title="Homemade SlickEdit DVD Cover" src="http://blog.slickedit.com/wp-content/uploads/2011/04/Homemade-SlickEdit-DVD-Cover1.jpg" alt="" width="587" height="440" /></a></p>
<p>A SlickEdit user thought it would be nice to have SlickEdit displayed on his bookshelf, so we sent him an image and he created his own homemade SlickEdit box. It looks great!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2011%2F04%2Fhomemade-slickedit-box-3%2F';
  addthis_title  = 'Homemade+SlickEdit+Box';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2011/04/homemade-slickedit-box-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enhancing Eclipse with SlickEdit Core: Split Editor Windows</title>
		<link>http://blog.slickedit.com/2010/12/enhancing-eclipse-with-slickedit-core-split-editor-windows/</link>
		<comments>http://blog.slickedit.com/2010/12/enhancing-eclipse-with-slickedit-core-split-editor-windows/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 15:25:52 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=545</guid>
		<description><![CDATA[Most software developers love to use split editor windows within their IDE of choice. Opening the same file or buffer in different windows allows you to easily view different parts of the code at the same time, without moving your current editing location. While possible, working in this manner in Eclipse is not very convenient. [...]]]></description>
			<content:encoded><![CDATA[<p>Most software developers love to use split editor windows within their IDE of choice. Opening the same file or buffer in different windows allows you to easily view different parts of the code at the same time, without moving your current editing location. While possible, working in this manner in Eclipse is not very convenient.</p>
<p>Say you are using Eclipse as shown here (Eclipse 3.6.1), and you want to open another view of the same file.</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_eclipse1.png"><img class="aligncenter size-full wp-image-554" src="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_eclipse1.png" alt="" width="721" height="360" /></a></p>
<p>You can do this easily within Eclipse by using the &#8220;New Editor&#8221; command. Right-click on the buffer tab of the file and select &#8220;New Editor&#8221;. For faster access, you should bind this command to a key, or use the mnemonic <em>Alt + W, E</em> for the <strong>Window</strong> menu. This allows you to create a new editor window without ever having to reach for the mouse. Good so far&#8230;but what did we get?</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_eclipse2.png"><img class="aligncenter size-full wp-image-556" src="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_eclipse2.png" alt="" width="725" height="364" /></a></p>
<p>Not really what we wanted, because this is pretty useless. We want to be able to see a side-by-side view of these windows. How can I accomplish this in Eclipse? Well, unfortunately, you have to reach for the mouse. You have to click and drag the buffer tab for one of these windows over to where you want it to be. Then you get what you really want.</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_eclipse3.png"><img class="alignleft size-full wp-image-558" src="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_eclipse3.png" alt="" width="724" height="363" /></a></p>
<p>With SlickEdit Core for Eclipse (v3.6.1), you can accomplish the same thing very quickly, without ever reaching for the mouse. This might seem like a very small detail, and maybe it is to some folks, but if you try to limit (or eliminate <img src='http://blog.slickedit.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) your mouse usage, you will find that you are a much more comfortable and productive programmer.</p>
<p>If I have the same file open in Eclipse 3.6.1, but this time using the SlickEdit Core 3.6.1 plugin, I can run the command <strong>vsplit-window</strong> from the SlickEdit command line, and a new editor window is opened to the right of the current editor window. No intermediate step involving the mouse. Of course, you should bind <strong>vsplit-window</strong> to a key to be more efficient.</p>
<p><a href="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_core.wmv">vsplit-window demo</a></p>
<p>SlickEdit Core also has a command for <strong>hsplit-window</strong> (<em>Ctrl + H</em> by default) for splitting an editor window horizontally, and you can use <strong>next-window</strong> (<em>Ctrl + Tab</em> or <em>Ctrl + F6</em> by default) to rapidly switch between all open editor windows.</p>
<p>There are other plugins available which provide similar functionality. I believe there is an Emacs plugin out there which supports the Emacs-style <em>Ctrl X, 3</em> window splitting, which also does not require the mouse. But no plugin also provides the level of language support of SlickEdit Core. And SlickEdit Core does have a fully functional Emacs emulation, for any Emacs users out there who want to be able to <em>Ctrl + X, 3</em> within the Eclipse environment.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2010%2F12%2Fenhancing-eclipse-with-slickedit-core-split-editor-windows%2F';
  addthis_title  = 'Enhancing+Eclipse+with+SlickEdit+Core%3A+Split+Editor+Windows';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2010/12/enhancing-eclipse-with-slickedit-core-split-editor-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://blog.slickedit.com/wp-content/uploads/2010/12/gnudemo_core.wmv" length="227943" type="video/asf" />
		</item>
		<item>
		<title>Diminishing the Role of Folklore in Software Development</title>
		<link>http://blog.slickedit.com/2009/09/diminishing-the-role-of-folklore-in-software-development/</link>
		<comments>http://blog.slickedit.com/2009/09/diminishing-the-role-of-folklore-in-software-development/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 13:45:52 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Dev Management]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=347</guid>
		<description><![CDATA[There&#8217;s a great old commercial for Tootsie Roll Tootsie Pops that reminds me a lot of what happens on most software projects. The commercial features a crudely drawn cartoon of a boy trying to figure out a vitally important question. Boy: Mr. Turtle, how many licks does it take to get to the Tootsie Roll [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a great old <a href="http://en.wikipedia.org/wiki/Tootsie_Pops">commercial for Tootsie Roll Tootsie Pops</a> that reminds me a lot of what happens on most software projects. The commercial features a crudely drawn cartoon of a boy trying to figure out a vitally important question.</p>
<p><strong>Boy</strong>: Mr. Turtle, how many licks does it take to get to the Tootsie Roll center of a Tootsie Pop?<br />
<strong>Mr. Turtle</strong>: I&#8217;ve never even made it without biting. Ask Mr. Owl.<br />
<strong>Boy</strong>: Mr. Owl, how many licks does it take to get to the Tootsie Roll center of a Tootsie Pop?<br />
<strong>Mr. Owl</strong>: Let&#8217;s find out. A One&#8230; A two-HOO&#8230;A three.<br />
(crunch sound effect)<br />
<strong>Mr. Owl</strong>: Three!</p>
<p>This illustrates two common problems in oral communication. The first is the iterative process of finding someone who might know the answer to your question. In software development, the questions are typically of a more concrete nature, relating to a specific design or implementation choice.<span id="more-347"></span></p>
<p>Most software projects depend on a great deal of local knowledge. This is knowledge that is specific to the project, something you couldn&#8217;t know prior to working on the project. This include things like architectural and design details. The local knowledge is rarely written down in an organized manner but is contained in the collective experience of the development team. Because it isn&#8217;t written down and cataloged it cannot be searched, except through the iterative query process.</p>
<p>The other problem that this commercial illustrates is that of false experts. Like Mr. Owl, you will find people who will give you a definitive answer but one that is, unfortunately, wrong. In software development, it can be very difficult to spot these wrong answers&#8211;you don&#8217;t get to see someone just bite into the Tootsie Pop to come up with it.</p>
<p>In some cases, the person may truly believe the answer they give, and we&#8217;ll assume that until we have proof to the contrary. At other times, people just don&#8217;t like to admit that they don&#8217;t know something. So, they make up an answer. In either case, the damage to your work is just as bad. </p>
<p>Folklore is typified by this kind of oral communication. It is the main method for communicating important information in primitive cultures. Knowledge is passed from one person to another. Often, because of miscommunication, the knowledge is corrupted by each successive telling. </p>
<p>It&#8217;s like that <a href="http://en.wikipedia.org/wiki/Chinese_whispers">party game where you start off with a sentence and have each person whisper it to another person</a>. This is repeated several times and then the last person writes down the sentence. In the end, the meaning of the sentence is often radically changed with comical results. The same thing happens in software development, but the results are far less comical.</p>
<p>The solution to both of these problems is to document local knowledge. One form of that is code comments. So much has been written on that topic, that I don&#8217;t feel the need to add more. However, many things are not appropriate to store in code comments. It&#8217;s that kind of knowledge that is most often passed along as folklore.</p>
<p>Fortunately, technology has given us a solution. A <a href="http://en.wikipedia.org/wiki/Wiki">wiki </a>provides a centralized knowledge repository that is edited by the group. This allows for the information to be easily reviewed for accuracy. It also eliminates the need to wander around and find someone who might know the answer to your question.</p>
<p>It also addresses another problem. Many people are hesitant to go ask questions. Either they are afraid of looking stupid, or they don&#8217;t want to trouble their coworkers. So, they will often flounder around trying to figure it out on their own, wasting time, or they will try to make due without the answer. A wiki allows people to find an answer without the potential embarrassment of exposing their ignorance. </p>
<p>To be successful, a wiki needs to be searchable and browseable. The search capability is needed to find the answer to specific questions. Browseability allows someone to view a set of topics and delve deeper to get more information. This is important to allow someone to gain the initial knowledge on a topic, particularly for getting new team members up to speed.  Most packages do a good job providing the search capability. But very few provide a good mechanism to build a browseable knowledge structure. </p>
<p>At SlickEdit, we use <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki </a>for our shared knowledge. It provides both an excellent search and a convenient means to organize topics. The side menu allows you to structure your top-level categories, and each page automatically includes a table of contents if it contains 4 or more subsections. This makes it simple to build a logical knowledge decomposition. It&#8217;s this capability to create a browseable structure that sets MediaWiki apart from other wiki software we tried. </p>
<p>Finding the right wiki software and setting up an initial structure is only the first step, though. The main challenge is getting the team to populate it. You face a couple of common problems here. </p>
<p>The first is the normal reluctance of programmers to document things. Many programmers despise any activity that is not directly related to producing code. This is a tough nut to crack, since this attitude is often deeply ingrained in the developers psyche. How you overcome this depends on the person and the arguments that they will listen to. You can appeal to their sense of professionalism and explain that this is part of professional development. You can appeal to their sense of teamwork and explain how this helps make the team more effective. You will need your full set of management skills to get everyone contributing.</p>
<p>Even if everyone is willing to contribute, one problem that often prevents a wiki from reaching its true potential is that of obviousness. Once you know something, it seems obvious to you. If it&#8217;s obvious, then why document it? This same problem plagues code comments. The best solution is to make the wiki an essential part of the problem solving process. When someone is trying to answer a question, they should look in the wiki. If they don&#8217;t find the answer, they should make a note to come back and add this information to the wiki after folklore has delivered an answer. </p>
<p>So, how does having a wiki alter the scenario depicted in the commercial?<br />
<strong>Boy</strong>: Hmm, I wonder how many licks does it take to get to the Tootsie Roll center of a Tootsie Pop?<br />
(Boy looks in wiki for the answer and finds an entry by Mr. Owl: &#8220;How many licks does it take to get to the Tootsie Roll center of a Tootsie Pop?  Three.&#8221;)</p>
<p>Well, at least he didn&#8217;t have to go bother curmudgeonly, old Mr. Turtle.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2009%2F09%2Fdiminishing-the-role-of-folklore-in-software-development%2F';
  addthis_title  = 'Diminishing+the+Role+of+Folklore+in+Software+Development';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2009/09/diminishing-the-role-of-folklore-in-software-development/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The SlickEdit Command Line</title>
		<link>http://blog.slickedit.com/2009/06/the-slickedit-command-line/</link>
		<comments>http://blog.slickedit.com/2009/06/the-slickedit-command-line/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 17:08:33 +0000</pubDate>
		<dc:creator>Jeffrey</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[slickedit]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=325</guid>
		<description><![CDATA[Use SlickEdit commands instead of the mouse to save time as you work. Open the SlickEdit command line by pressing Esc (in most emulations), type the command and any options, then press Enter. If you use a command frequently, bind it to a keyboard shortcut to save even more time. Type “Slickedit command line” in [...]]]></description>
			<content:encoded><![CDATA[<p>Use SlickEdit commands instead of the mouse to save time as you work. Open the SlickEdit command line by pressing <strong>Esc</strong> (in most emulations), type the command and any options, then press Enter. If you use a command frequently, bind it to a keyboard shortcut to save even more time. Type “Slickedit command line” in the Help Index (<strong>Help &gt; Index</strong>) to learn more.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2009%2F06%2Fthe-slickedit-command-line%2F';
  addthis_title  = 'The+SlickEdit+Command+Line';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2009/06/the-slickedit-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8230;But It&#8217;s More Fun to Reinvent the Wheel</title>
		<link>http://blog.slickedit.com/2009/06/but-its-more-fun-to-reinvent-the-wheel/</link>
		<comments>http://blog.slickedit.com/2009/06/but-its-more-fun-to-reinvent-the-wheel/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 17:17:44 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=309</guid>
		<description><![CDATA[&#8220;Reinventing the wheel&#8221; is used as a common metaphor in software development for rewriting code that has already been written. For example, SlickEdit contains a number of features that traverse directories and process files, including Find in Files, DIFFzilla, Add Tree, and more. In each case the syntax used to exlclude files or directories is [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Reinventing the wheel&#8221; is used as a common metaphor in software development for rewriting code that has already been written. For example, SlickEdit contains a number of features that traverse directories and process files, including Find in Files, DIFFzilla, Add Tree, and more. In each case the syntax used to exlclude files or directories is different. Sometimes the exclude specs are space delimited; sometimes they are delimited with semi-colons. Some require the use of asterisks to specify a directory; some don&#8217;t.</p>
<p>The basic reason for this is that each feature was written in isolation without finding and reusing the capabilities of the other features. This is a very common problem on most software projects. To address this issue, I believe that software development should be broken down into two different workflows: mechanism application and mechanism creation.</p>
<p>We can define a mechanism as a component with a cohesive set of functionality, like the wheel. In most cases, mechanisms are meant to be reusable, though it is possible that there will be only one use for that mechanism in a particular program. Common mechanisms in software include login processors, calendar widgets, and sorted lists. These elements perform a specific function that is independent of what they are used for.</p>
<p>Mechanisms can also be specific solutions to common design problems, like error logging, object persistence, and thread synchronization. Ideally, these would be encapsulated in a library that is used by other developers, but in some instances it is more a matter of following a specified convention.</p>
<p>For example, one project I worked on specified that each function would contain #ifdefs for tracing and logging with specific information that each function should output. This still represents a mechanism that defines a cohesive functionality, in this case, tracing. But instead of writing a reusable library, the mechanism was primarily a set of conventions we all followed when writing our functions.</p>
<p>During mechanism application, the specialized functionality of a feature is built using existing mechanisms. You can work on your own unless you have a question about the specs or need assistance from another developer. The code being written is unique to the feature, so little attention is given to reuse unless a new mechanism is needed. Then you enter mechanism creation.</p>
<p>During mechanism creation, you are developing a generalized capability that is specifically intended to be reusable. This requires a totally different workflow. You have to stop and do a degree of analysis before you create the new mechanism. Several questions need to be answered. Are you sure there isn&#8217;t already a mechanism for this? If not, what are the essential behaviors of this mechanism? Where should it be stored?</p>
<p>These questions are best addressed with other members of the team. The goal is to produce a mechanism that can be used by everyone, not just by you. So, you need to get their input to make sure it does more than meet your immediate needs, or at least doesn&#8217;t prevent someone from extending it in the future.</p>
<p>When a developer tackles the new mechanism as part of their normal development, two common problems occur. Often the programmer includes the mechanism as part of the feature-specific code, rather than placing the mechanism into the library where others can find it. Even when they do put the code in the proper place, it often is written in such a way that it is only useful for this feature. You can&#8217;t make it reusable without breaking the feature that already depends on it.</p>
<p>In most applications, mechanism application is very straightforward, simple programming and requires little creativity. Mechanism creation, on the other hand, requires a great deal of creativity and design effort. You have to think more about algorithms and efficiency.</p>
<p>So why don&#8217;t programmers naturally break their work into these separate workflows? I think there are a number of explanations.</p>
<p>First, I think programmers get very focused on completing a feature. If they have to interrupt that work to enter the slower and more deliberate workflow required to create a new mechanism, then it delays the attainment of their goal.</p>
<p>Secondly, programmers like to program. Designing reusable components requires meetings, documentation, and reviews&#8211;all of which get in the way of programming.</p>
<p>Thirdly, most programmers aren&#8217;t too keen on collaboration. When you talk things over in a group, you have a chance of not getting your way. If you just build it yourself, you can do it the way you think it should be done.</p>
<p>Finally, by separating the two workflows, the creation of a needed mechanism might be assigned to a different programmer. Since the creation of these mechanisms is often more challenging and, therefore, more fun; developers are hesitant to initiate a workflow that would potentially deprive them of this fun.</p>
<p>Basically, it&#8217;s more fun to reinvent the wheel than to determine whether a suitable wheel already exists. If the wheel does need to be invented, it&#8217;s less fun to do it with a committee of your peers who may disagree with your vision for the wheel.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2009%2F06%2Fbut-its-more-fun-to-reinvent-the-wheel%2F';
  addthis_title  = '%26%238230%3BBut+It%26%238217%3Bs+More+Fun+to+Reinvent+the+Wheel';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2009/06/but-its-more-fun-to-reinvent-the-wheel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eliminating the Programmer</title>
		<link>http://blog.slickedit.com/2008/12/eliminating-the-programmer/</link>
		<comments>http://blog.slickedit.com/2008/12/eliminating-the-programmer/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 15:48:37 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=255</guid>
		<description><![CDATA[Occasionally I run across a tool or development project with the intent of eliminating the programmer. The goal is to have the business team control the behavior of the system. From a business management perspective, this sounds like a great idea. Think of all the money saved if we didn’t have to hire programmers or [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally I run across a tool or development project with the intent of eliminating the programmer. The goal is to have the business team control the behavior of the system. From a business management perspective, this sounds like a great idea. Think of all the money saved if we didn’t have to hire programmers or to waste time communicating requirements to them. In reality, I’ve never seen a tool or project succeed at this.</p>
<p>I worked as a contractor on one such project a few years ago. We were writing a call center application for a large enterprise client. The architect of this system convinced the client that the business analysts would be able to write in a high-level business language (invented by the architect) so that future changes wouldn’t require hiring programmers to modify the system. Each line of business script, it was claimed, had the power of 20 or 30 lines of lower level code. So, this promised even greater efficiency than just eliminating the programmer.</p>
<p>The business language had classes, constructors, destructors, and nearly all of the features of modern object-oriented languages. Maybe it started out as a simplified language that would be accessible to the business team, but it grew into the same level of complexity as the Java code we were writing to implement the rest of the system. There was no way that a business analyst without training as a programmer was going to be able to write effective code with this language.</p>
<p>Even worse, the programming team was struggling to write code with the language. There was no debugger or other tools, not even an editor with color coding. When you had an error, you had to determine if it was a bug in the script or in the interpreter, which was being modified almost daily.</p>
<p>Even if we accept that it is a worthy goal to eliminate the need for programmers, I don’t think it’s possible. That’s because programmers have skills and abilities other than just their knowledge of programming languages.</p>
<p>Whether this is by training or nature, I cannot say. Likely, it is a little of both. Programmers have aptitude in the skills necessary to succeed in our field and these get nurtured through practice. Regardless, I’ve noticed that programmers are often more capable in many ways than their non-programming coworkers.</p>
<p>Programmers think more logically. Working through if-then-else conditions is a core capability for any programmer. While working with business teams on requirements, I have often run across cases the where same ability was lacking.</p>
<p>During one project to develop an expert system for mortgage analysis, I was often given requirements for rules on how to handle loans with particular Loan-To-Value ratios or for a particular loan amounts. Not uncommonly, these requirements would have gaps. I’d have requirements for loans from $0 to $100,000; from $150,000 to $250,000; and for loans over $250,000. But there was a hole between $100,000 and $150,000. At other times I’d have conflicting requirements for overlapping ranges.</p>
<p>Programmers have a superior ability to analyze problems and come up with solutions. They excel at analyzing preconditions, sequences of events, and outcomes. Certainly, this is a key skill in programming, but it is also useful in troubleshooting and business case analysis.</p>
<p>Another key ability where programmers typically have an edge is the ability to make order out of chaos. I think that’s because the programmer is responsible for creating order within the program. We break systems into subsystems, subsystems into modules, and modules into units. There are no physical constraints that dictate the structure of the solution. Whatever order exists is created by the people who write the code. Reflecting on some of the codebases I’ve worked on, it’s clear that this is not a universal trait in all programmers.</p>
<p>While people typically think of programmers as coders, whose main talent lies in writing the arcane syntax of programming languages. I think that their main talent lies in their ability to analyze, troubleshoot, and solve problems. Code is just the physical manifestation that culminates the thought process of the programmer.</p>
<p>Let’s say that someone does manage to write a tool that allows people to define software and control its behavior without having to write code. The person using this tool will still need all of the other mental abilities of a programmer. If this were to happen, we haven’t eliminated the programmer; we just changed the job description a little.</p>
<p>Yes, I can envision a distant future where Artificial Intelligence is used to develop code—but that won&#8217;t eliminate programmers, either; it just ported them to a different platform.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F12%2Feliminating-the-programmer%2F';
  addthis_title  = 'Eliminating+the+Programmer';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/12/eliminating-the-programmer/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>&#8220;Please&#8221; and &#8220;Thank You&#8221; Macro</title>
		<link>http://blog.slickedit.com/2008/11/please-and-thank-you-macro/</link>
		<comments>http://blog.slickedit.com/2008/11/please-and-thank-you-macro/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 15:14:25 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=253</guid>
		<description><![CDATA[Though I now work as a programming manager I have been a programmer for many years. Programmers typically share many characteristics in common. Among them, a certain inpatience with inefficiency. I&#8217;m not sure if that trait was there before we became programmers or whether it is something we learn through years of coding. Perhaps we [...]]]></description>
			<content:encoded><![CDATA[<p>Though I now work as a programming manager I have been a programmer for many years. Programmers typically share many characteristics in common. Among them, a certain inpatience with inefficiency. I&#8217;m not sure if that trait was there before we became programmers or whether it is something we learn through years of coding. Perhaps we start with that characteristic and it gets nutured through our programming experience.</p>
<p>Regardless, I&#8217;ve grown weary of some wasteful pleasantries, and I&#8217;ve been trying to make things more efficient. In particular, I&#8217;m tired of saying &#8220;please&#8221; and &#8220;thank you&#8221; all the time, particularly with my wife. After nearly 25 years of marriage, haven&#8217;t I proven my love and respect? Do I need to continually show it through endless &#8220;pleases&#8221; and &#8220;thank yous&#8221;?</p>
<p>So, I asked her if she could just assume that every request I ask is automatically preceeded by a &#8220;please&#8221; and followed by a &#8220;thank you&#8221;. I mean really, if she expects one every time, why not just assume it&#8217;s there in the first place?</p>
<p>In programmer parlance, this would be equivalent to writing a macro. Macros are substitutions that are inserted inline so that the code is altered, as though the substitution were there all along. I won&#8217;t bore you with the syntax, but if you&#8217;ve used macros before then you know what a time-saver they can be.</p>
<p>Unfortunately, my wife didn&#8217;t go along with this notion. It appears that her ability to execute macros is substantially less effective than a C compiler. So, she still expects a tedious &#8220;please&#8221; and &#8220;thank you&#8221; for each request. Sheesh!</p>
<p>Some programmers have taken this notion of macros a little too far. From the many programmers I have worked with, I have noticed the following macros in use:</p>
<p><strong>The Greeting Macro</strong> &#8212; this is a common one, where the programmer has fully eschewed any responsibility for saying &#8220;Good morning&#8221;, &#8220;Hi&#8221;, &#8220;How&#8217;s it going?&#8221; or any of the regular acknowledgements of the other person&#8217;s existence.</p>
<p><strong>The &#8220;Yes sir, I&#8217;ll get right on it&#8221; Macro </strong>&#8211; with this macro, a programmer will no longer let you know that they have heard and understood your requests. You must infer that they will comply because they have ceased their efforts to make you feel stupid for asking.</p>
<p><strong>The &#8220;No I don&#8217;t think you&#8217;re a complete moron&#8221; Macro </strong>&#8211; here, the programmer has given up with trying to smile politely and respect your opinion. The macro is intended to soften his critical and belittling demeanor. It is important to note the stress on the word &#8220;complete&#8221; in this macro.</p>
<p><strong>The Personal Hygiene Macro </strong>&#8211; I know it&#8217;s boring to shower every day, but the rest of us really appreciate it. Trust me on this one!</p>
<p>please_and_thankyou(&#8220;If you enjoyed this article, leave a comment.&#8221;)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F11%2Fplease-and-thank-you-macro%2F';
  addthis_title  = '%26%238220%3BPlease%26%238221%3B+and+%26%238220%3BThank+You%26%238221%3B+Macro';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/11/please-and-thank-you-macro/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Too Busy Bailing to Plug the Leak</title>
		<link>http://blog.slickedit.com/2008/10/too-busy-bailing-to-plug-the-leak/</link>
		<comments>http://blog.slickedit.com/2008/10/too-busy-bailing-to-plug-the-leak/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 14:15:33 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Dev Management]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=250</guid>
		<description><![CDATA[My last post, Design Fail Patterns, dealt with the ways that people often select the wrong technologies for a project. That made me think of another way I&#8217;ve seen projects and people fail. Cast your mind back to the days of the tall ships, great wooden vessels that plied the oceans under wind power. Imagine [...]]]></description>
			<content:encoded><![CDATA[<p>My last post, <a href="http://blog.slickedit.com/?p=249">Design Fail Patterns</a>, dealt with the ways that people often select the wrong technologies for a project. That made me think of another way I&#8217;ve seen projects and people fail.</p>
<p>Cast your mind back to the days of the tall ships, great wooden vessels that plied the oceans under wind power. Imagine one of those majestic ships sailing along when suddenly it hits a reef, tearing a large hole below the waterline. All hands scramble to save the ship. They bail and bail, but the ship continues to sink. As the ship sinks lower, they bail more furiously until finally the ship is lost. The survivors are washed ashore on a nearby island.</p>
<p>As they stare out at the masts of the ship, still visible above the waves, the Captain asks, “Why weren’t we able to plug the leak?”</p>
<p>One of the crew pipes up, “Captain, sir, we were too busy bailing to plug the leak.”</p>
<p>OK, this is a contrived example, and it’s very hard to believe that it could occur in real life. However, very similar situations frequently arise in software development.</p>
<p><strong>Bad Codebase</strong></p>
<p>The most typical way I’ve seen this occur is on projects where the early work has set us up for failure. The infrastructural code is so full of bugs or badly designed that it has become a stumbling block to get the rest of the system built. The team furiously pounds away at the code, driving toward a critical milestone fixing bugs as they can. But with every iteration, things take longer to do and the codebase gets harder to work with.</p>
<p>In this case, the leak is the poor codebase. The only way to plug the leak is to rewrite that part of the system. Often, the programming team is unable to recognize that this code is a lost cause, particularly if they participated in its development. More commonly, the programmers know that this code is the problem, but they can’t talk management into the schedule slip that is necessary to fix it. In the end, the project takes longer to complete than if we had stopped and rewritten the offending code.</p>
<p>Unfortunately, a leak in software is rarely as visible or as easy to appreciate as a gaping hole in a hull. However, the programmers’ work to patch the system instead of fixing it is just as futile as the sailors who just keep bailing. And the result is nearly as predictable.</p>
<p><strong>Poor Process</strong></p>
<p>Another way this phenomenon is manifested is in adherence to bad processes. I worked on a project that used very poor configuration management techniques. The approach to version control was sloppy, and there were no controls for how integration servers were configured or how code was deployed for testing. Consequently, even though we would get successful tests on the integration server, we continually faced problems in production. These problems stemmed from several causes. Sometimes it was because of files that were edited on the integration server and not checked into source control, so they never got deployed to production. Or someone would set up the directory structure differently so that it would work on one machine but not the other.</p>
<p>When these problems appeared, the proffered solution was that people should be more careful. This case might be slightly different. Instead of thinking that you’re too busy bailing to plug the leak; in this case you believe that bailing may be all that’s needed.</p>
<p>I’m a firm believer that your test machines should mirror your production environment in every way possible and that you should deploy your code for testing exactly as it will be deployed to the production environment. And if I ever catch someone editing a file on a test or integration server, I’ll <a href="http://en.wikipedia.org/wiki/Keelhauling">keel haul</a> them!</p>
<p><strong>No Time for Personal Development</strong></p>
<p>I also see the “too busy bailing” mentality at work in peoples’ careers. As a hiring manager, I have interviewed hundreds of candidates for jobs over the years. I’m frequently amazed to learn how little people invest in their careers and the knowledge necessary to advance.</p>
<p>For example, most of my work has been on Object-Oriented projects. So, I typically ask OO questions of the candidates. One question is about how they learned OO programming. What books did they read? How did they hone this knowledge? Typically, I find that most candidates learned OO in college and have done nothing to build on that knowledge, other than their normal work experience.</p>
<p>I’ve also interviewed candidates for web development. So, I’ll get a resume from a bright young college student who is about to graduate. They tell me they want to be a web developer.</p>
<p>“Great!” I say. “So, have you ever built a website?”</p>
<p>“No.”</p>
<p>“Do you know HTML and JavaScript?”</p>
<p>“We had that in a class once.”</p>
<p>“Well, then what have you done to become a web developer?”</p>
<p>“I’m real busy with class right now.”</p>
<p>So, basically, this guy is looking for someone to pay him to become a web developer. I’ll always consider a new grad without formal experience, but I want someone who has done more than just sit through classes on their way to a degree. Show me some passion or interest in your area by working on something outside of class. Or at least have knowledge in the basic tools.</p>
<p><strong>Tool Selection</strong></p>
<p>The final way I see people being too busy bailing is through adherence to less effective tools. I often interact with people who have been using vi their whole career, or some other minimal editor, and just can’t be bothered to change. No amount of telling them how you can save them time will convince them to switch. They may even admit that they know they could be more productive if they switched, but they don’t want to take the time to learn a new tool.</p>
<p>Truthfully, this could be a case of the tool becoming the job rather than being too busy bailing. In that situation, a person spends so much time, say, hammering that they lose sight of why they are hammering: to build houses. So when a new way of driving nails comes along, they stick to their current way of working. “I’ve been hammering for 20 years. I’m not about to switch.”</p>
<p>Switching tools will always involve an investment in time. But if you pick the right tool, that investment will pay off rapidly.</p>
<p>So watch for signs of bailing in your own work and career. Consider whether there is a leak that needs to be plugged first. If not, then bail for all your worth. If you have spotted a leak and no one will listen, maybe you need to do a different kind of bailing.</p>
<p> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F10%2Ftoo-busy-bailing-to-plug-the-leak%2F';
  addthis_title  = 'Too+Busy+Bailing+to+Plug+the+Leak';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/10/too-busy-bailing-to-plug-the-leak/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Design Fail Patterns</title>
		<link>http://blog.slickedit.com/2008/10/design-fail-patterns/</link>
		<comments>http://blog.slickedit.com/2008/10/design-fail-patterns/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 13:34:17 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=249</guid>
		<description><![CDATA[On every project, there is a phase where you have to pick the essential technologies that you will use to build the system. You need to decide what programming language to use. Is there an available framework? Does the system need a database? If so, which DBMS should you use? Ideally, this is done logically [...]]]></description>
			<content:encoded><![CDATA[<p>On every project, there is a phase where you have to pick the essential technologies that you will use to build the system. You need to decide what programming language to use. Is there an available framework? Does the system need a database? If so, which DBMS should you use?</p>
<p>Ideally, this is done logically and methodically, making sure to choose the technologies that best meet the stated needs and provide for a future growth path. Like most human activities though, this process is often subverted by the foibles of those involved.</p>
<p>Here are a number of Design Fail Patterns, ways that bad designs get chosen.</p>
<p><strong>“To A Man with a Hammer, Everything Looks Like a Nail.” – Mark Twain</strong></p>
<p>Sometimes a team makes an ill choice because of their background. There are more technologies available than ever before (see <a href="http://blog.slickedit.com/?p=248">Software’s Cambrian Explosion</a>). It is impossible to stay on top of every language, framework, and system. You do have to make a choice from the set of technologies you are familiar with or ones you know to explore.</p>
<p>Sometimes the right choice is the tool you have expertise with, even if another is more capable. Predictability is a key factor in the success of a project. Many projects don’t afford the time necessary to learn and master a new technology. So, success depends on doing the best with the tools at hand.</p>
<p>However, I have seen familiarity promote technologies way past their utility. I worked on a real-time communications system a few years ago. The architect on this project was a former Database Administrator. While he was a first-rate DBA, he knew little of object-oriented design or the design of large, complex systems. His design reflected his knowledge. Consequently, the system was designed as a transactional database with a thin veneer of objects to interact with the user and other systems.</p>
<p>I’ve also seen this work the other way. On another project we were building a system to manage patient records. While this was obviously a database project, the team treated this primarily as an object-oriented system, using the database merely to serialize their objects. All permissions, synchronization, and look-up took place in the object layer. To do that, they loaded all of the objects into memory when the system started up, with predictably poor results.</p>
<p>Every system we build has an essence that defines the nature and purpose of the system. For each, there are always technologies that are better or worse suited to that essence. It is very important to look past your familiarity and find the ones that best meet that need.</p>
<p><strong>Design by Resume</strong></p>
<p>Sometimes a team makes a bad choice because of a technology they want to work with. For a technical field, software development is full of fads and fashions. At any moment in time there is some hot, new technology that is supposed to render all others obsolete, and developers clamor to gain experience in these systems.</p>
<p>One such technology was Enterprise Java Beans (EJBs). A few years ago, the media was abuzz with articles extolling the virtues of this almost magical technology. I can hear the voice of <a href="http://en.wikipedia.org/wiki/Billy_Mays">Billy Mays</a> now, “Try EJBs, the distributed data solution that removes stains and whitens your teeth.”</p>
<p>For several years, every Java project I worked on desperately tried to find a way to use EJBs. Developers who had never actually used EJBs fell all over each other trying to wedge them into the design. Ultimately, none of the systems I worked on found a good use for them.</p>
<p>Sometimes that hot, new technology will be the right fit. Just be sure you are picking it because it is the right tool and not because you want that experience on your resume.</p>
<p><strong>Design by Magazine Article</strong></p>
<p>There is an entire ecosystem in software engineering that exists just to tell you how glorious new technologies are. That used to be the domain of trade magazines—you know the ones, the large newspaper looking things that are always lying around the break room. Now, websites have taken over as the number one source of telling you what you should be using. Seminars and conferences are another source for this.</p>
<p>Regardless of the source, Design by Magazine Article occurs when the technology direction is chosen because of one of these experts telling you how to do things. This differs from Design by Resume principally in motivation. Design by Resume comes from the desire of the developers to expand their experience. Design by Magazine Article occurs when engineers put too much faith in the so-called experts. Often this occurs in management circles, like when a CTO has time to kill on a long flight in first class.</p>
<p>And this leads us to our final Design Failure Pattern…</p>
<p><strong>Design by Management Fiat</strong></p>
<p>This may be the worst of them all, and certainly is one of the most common. In this situation, upper management decides what tools and technologies will be used. Often this comes as an effort to standardize on a tool set, like when a company decides it’s a Microsoft shop or Java shop. Sometimes it is driven by cost, like when companies standardize on tools like Eclipse.</p>
<p>This pattern is wrong on many levels. First it robs the team of their sense of buy-in. This is an essential element in a team that is functioning at its highest level. Second, no tool or technology is right for every situation. I’ve used both SQL Server and Oracle. In many cases either will do just fine. In some cases, SQL Server is a clear win for its simplicity and lower cost. But sometimes you need the capabilities that only Oracle can give you.</p>
<p>Finally, this pattern is bad because the policy is written in stone. No matter how effective some other solution might be, once management has made up their minds they will not be swayed, at least not until the next hot-shot CTO comes in and talks them into the latest set of must-have technologies.</p>
<p>Friends, let me share with you the one sure thing I’ve learned about technology: it is hard. You are faced with innumerable decisions about which way to go. While there are no roads to guaranteed success, there are many roads to guaranteed failure. You need to keep your options open and make the best choices you can.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F10%2Fdesign-fail-patterns%2F';
  addthis_title  = 'Design+Fail+Patterns';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/10/design-fail-patterns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Software&#8217;s Cambrian Explosion</title>
		<link>http://blog.slickedit.com/2008/10/softwares-cambrian-explosion/</link>
		<comments>http://blog.slickedit.com/2008/10/softwares-cambrian-explosion/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 13:16:49 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=248</guid>
		<description><![CDATA[I remember when I was first learning to program, back in the early ’80s. There were a handful of mainstream languages. The Survey of Programming class I took included FORTRAN, C, COBOL, Basic, LISP, Prologue, and Pascal. Each of these languages was distinct and served a particular purpose. You might say that each was well [...]]]></description>
			<content:encoded><![CDATA[<p>I remember when I was first learning to program, back in the early ’80s. There were a handful of mainstream languages. The <em>Survey of Programming</em> class I took included FORTRAN, C, COBOL, Basic, LISP, Prologue, and Pascal. Each of these languages was distinct and served a particular purpose.</p>
<p>You might say that each was well adapted to a particular niche in the programming ecosphere. COBOL was a business language used on mainframes to write banking applications. FORTRAN was the language used by scientists and engineers. C was the choice for writing system code and operating systems. And so on…</p>
<p>Likewise, there were relatively few choices for libraries and frameworks. If you wanted a graphical front-end, you could use X Windows. There were a couple of Database Management Systems available, but usually one that was dominant on your platform.</p>
<p>Since then, there has been an explosion of new languages, technologies, and frameworks. In my mind, this is similar to the <a href="http://en.wikipedia.org/wiki/Cambrian_explosion">Cambrian explosion</a>, a rapid proliferation of life forms that occurred around 530 million years ago. During this period, Earth went from having a relatively few and fairly similar life forms to a vast number of highly diverse life forms.</p>
<p>One explanation for this proliferation is the <a href="http://en.wikipedia.org/wiki/Snowball_Earth">Snowball Earth hypothesis</a>. According to this theory, there was a period where the entire Earth was covered by a sheet of ice. This created a uniform set of conditions for life. There was little need or opportunity for life forms to adapt to different conditions. So, there were relatively few life forms.</p>
<p>Similarly, the early years of computing saw a fairly uniform ecosystem for programs. Code was written to run on mainframes and later on mini-computers and personal computers. Still, the programs were very similar in that they were largely compiled programs and ran locally. Programs used text to interact with users.</p>
<p>The ice sheet was finally melted, it is believed, by the build-up of greenhouse gases over millions of years. Suddenly there are new conditions for life. New life forms come into being to exploit these conditions, producing the Cambrian explosion.</p>
<p>Similarly, the World Wide Web likely launched software’s version of the Cambrian explosion. The web has added many new challenges and radically altered the way programs are conceived and delivered. There was a great proliferation of languages and technologies to exploit these new conditions.</p>
<p>Though earlier developments like the personal computer and Graphical User Interfaces spawned a degree of new technologies, they cannot compare to the web for sheer number of new mechanisms. Within the Java ecosphere, alone, you can choose from Swing, Spring, JSP, Struts, JFaces, and more to build your interface, most of which were created to help deliver web content.</p>
<p>The Open Source movement is another evolutionary accelerator. There was a time when languages and frameworks were produced by a few individuals working at places like Bell Labs. With open source, communities are collaborating together to produce new technologies. This has greatly increased the rate of change.</p>
<p>I wonder what a <em>Survey of Programming</em> class is like now. It’s hard to imagine how you could cover the major technologies in a semester. Heck, by the end of the semester whole new technologies will likely have come into being. It’s exciting!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F10%2Fsoftwares-cambrian-explosion%2F';
  addthis_title  = 'Software%26%238217%3Bs+Cambrian+Explosion';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/10/softwares-cambrian-explosion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>User Attention Span, the New Performance Metric</title>
		<link>http://blog.slickedit.com/2008/08/user-attention-span-the-new-performance-metric/</link>
		<comments>http://blog.slickedit.com/2008/08/user-attention-span-the-new-performance-metric/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 14:31:22 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=245</guid>
		<description><![CDATA[When I was a kid, I was raised on Sesame Street.  I learned some counting and some reading, but most importantly, I learned how to pay attention in 3 minute chunks of time.   Over the years, that time has been cut down to somewhere around 30 seconds, which means that the advertising industry has [...]]]></description>
			<content:encoded><![CDATA[<p>When I was a kid, I was raised on Sesame Street.  I learned some counting and some reading, but most importantly, I learned how to pay attention in 3 minute chunks of time.   Over the years, that time has been cut down to somewhere around 30 seconds, which means that the advertising industry has done their job well.  Unfortunately, there&#8217;s a large group of people that share my short attention span&#8230; end users.</p>
<p><strong>Read The Friendly Manual&#8230; or not<br />
</strong></p>
<p>Many software products have changed over the years to cater to end users who don&#8217;t want to spend a lot of time learning how to use new software.  I first saw this in the game industry, where people can&#8217;t seem to be bothered to read a manual at all.  These days, games don&#8217;t even come with instructions.  They provide a tutorial level or integrated help that watches what you do and introduces you to the things you need to know as you play.  It&#8217;s brilliant, really.  The users don&#8217;t have to read a thing before playing, and who&#8217;d want to?  When I get a new game, I don&#8217;t want to waste time reading when I could be already up to level 10.  The game companies win too, because they don&#8217;t have to pay for the printed materials.  Everyone&#8217;s happy.</p>
<p>But how does this translate outside the game industry?  It&#8217;s been tried before, with much less success.  Clippy was the spokesman for the first wave of learn-as-you-go user experiences.  We all know how that turned out.  &#8220;<em>One of the worst software design blunders in the annals of computing</em>,&#8221; wrote <a href="http://en.wikipedia.org/wiki/Office_Assistant#Overview">Smithsonian Magazine</a>.</p>
<p><img width="300" src="http://www.slickedit.com/images/stories/blog/clippy.jpg" height="262" /></p>
<p>So users didn&#8217;t like being told how to use the software while they used it.  Another form of learning that is not always well received is the tip of the day.  I know my first order of business after installing new software is checking the &#8220;Never, never, ever show me this again&#8221; checkbox on the tip of the day dialog.</p>
<p><img width="353" src="http://www.slickedit.com/images/stories/blog/tipoftheday.png" height="292" /></p>
<p>Wizards also tried to ease the user into getting up and going without having to wade through options pages and understanding all of the menus and toolbars.  Although wizards have had some success, it&#8217;s still a paradigm that&#8217;s seems old.  When I think of wizards, I feel like I&#8217;m flashing back on an episode of &#8220;<a href="http://www.vh1.com/shows/dyn/i_love_the_90s/series.jhtml">I Love the 90s</a>&#8220;.</p>
<p>At the very least , there hasn&#8217;t been a lack of effort to try to help users figure out how to use their software without the manual.  Yet, most of these attempts seem to fail.  It&#8217;s as if users don&#8217;t want to read how to use the software and can&#8217;t be bothered being shown how to use it by the software itself.  Part of me wants to rant about how idiotic that is and the other half of me recognizes that I fall into that group.</p>
<p><strong>Done programming?  Great, now get back to work.</strong></p>
<p>I&#8217;ve spent most of my programming career writing programs for in-house use, or writing programs that were bought by large companies to be rolled out in-house.  The thing that all of my work had in common was that the end users were not end users by choice.  The software I helped write was all rolled out in some fashion to a large group of people whose jobs depended on them learning the software.</p>
<p>Here at SlickEdit, I&#8217;m no longer writing software that users <strong>must </strong>adapt to.  Instead, I&#8217;m writing software that users  make a conscious choice to use or not use.  The choice to use it hinges heavily on the trial, and if the user can&#8217;t get the trial installed and doing spectacular feats in less than five minutes, then the opportunity is completely lost. The bottom line is that the most important software performance metric is not how fast my code works, but how fast the user can use it meaningfully.  If that doesn&#8217;t happen, then the user loses interest and all of the great work we&#8217;ve done will never be seen.</p>
<p>That&#8217;s quite a psychological transition for me, because I&#8217;ve never focused before on instant user gratification.  One of our strategies involves the software helping users through an optional tool window, called the Tools Assistant,  which is part of the &#8220;Tools for Visual Studio&#8221; product.  It stays off to the side or can be closed if the user doesn&#8217;t want the help.  But there&#8217;s also a lot more to this effort than just adding up-front convenience to the software.  We also have to think up new ways to get users to see the product in action with very little effort on their part, often without even downloading it and installing it.  This involves a lot of non-programming work, like video script writing, screen shots, articles, etc&#8230;  It&#8217;s certainly an interesting change of pace, but it really pushes the limits outside of my programming turf.  I took a break the other day to fix bugs and it was refreshing just to see code for a while.</p>
<p>I love a change of pace&#8230; it keeps things interesting.   However, trying to figure out how to pitch a software product may be one of the biggest challenges I&#8217;ve had as part of a software development team.  I certainly never took any marketing classes in college, and at this point they&#8217;d all be irrelevant anyway.  So I&#8217;m no longer focused on reducing the time it takes to perform complex operations&#8230; my focus now is on reducing the amount of time it takes a new user to say, &#8220;wow, that is so cool!&#8221;  So far I can&#8217;t find any way to calculate the big O for that, but I&#8217;m trying.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F08%2Fuser-attention-span-the-new-performance-metric%2F';
  addthis_title  = 'User+Attention+Span%2C+the+New+Performance+Metric';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/08/user-attention-span-the-new-performance-metric/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s Do a Code Review With SlickEdit Tools (Part 2)</title>
		<link>http://blog.slickedit.com/2008/07/lets-do-a-code-review-with-slickedit-tools-part-2/</link>
		<comments>http://blog.slickedit.com/2008/07/lets-do-a-code-review-with-slickedit-tools-part-2/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 14:56:10 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=241</guid>
		<description><![CDATA[This article continues Part 1 of the series, where we began the code review process by demonstrating some ways to find the best candidate files to review. We then introduced some techniques to identify what code a specific developer had written, using some of the features in the Versioning Toolbox. The next task is to [...]]]></description>
			<content:encoded><![CDATA[<p>This article continues <a href="http://blog.slickedit.com/?p=237">Part 1 of the series</a>, where we began the code review process by demonstrating some ways to find the best candidate files to review. We then introduced some techniques to identify what code a specific developer had written, using some of the features in the Versioning Toolbox. The next task is to actually comment on the code. This is always best done in an electronic format, in a way that can be pulled together with other developers&#8217; comments during the code review meeting.</p>
<p><strong>Using Code Annotations to Write Review Comments</strong><br />
The Code Annotations feature in the Editing Toolbox is extremely useful for writing code review comments because it lets you attach comments to specific locations in the code without altering the code itself. You can bring up the Code Annotations tool window by clicking <em>SlickEdit &gt; Show Code Annotations</em>.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/codeannotationstoolwindow.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/codeannotationstoolwindow_small.jpg" /><br />
[Click for full size image]</a></p>
<p>The first step when writing code review comments is to create an annotation file to store all of your code review comments. You can then send this file to the code review organizer when you&#8217;re done. You can use the <strong>Annotation File Manager</strong> to create a file called &#8220;<em>Code Review &#8211; Bob</em>&#8221; (or whatever your name may be).</p>
<p><img src="http://www.slickedit.com/images/stories/blog/code_review/codeannotationsfilemanager.jpg" /></p>
<p><strong>Writing Comments About the Code</strong><br />
After applying the <a href="http://www.slickedit.com/images/stories/blog/code_review/defaultuserscheme3.jpg">&#8220;Scott&#8217;s code&#8221; visualization scheme</a> that we made in the first article, we can navigate through the sections of code that Scott has written. On line 497 of <em>PackageBaseWhidbey.cs</em>, we see that he&#8217;s doing a GUID comparison using a literal string. This goes against coding standards, so we&#8217;ll log a comment that the string literal needs to be defined as a constant. Put the cursor on that line and click the <strong>New Annotation</strong> button on the Code Annotations toolbar. This will bring up the <strong>New Annotation</strong> dialog.</p>
<p><img src="http://www.slickedit.com/images/stories/blog/code_review/newannotation.jpg" /></p>
<p>We&#8217;ll create a review comment, which is one of the standard annotation types. We&#8217;ll also select the &#8220;Global : Code Review &#8211; Bob&#8221; scope, or category, which will put the annotation into the code review file we created earlier. After filling out the fields and clicking OK, a purple highlighted marker is placed on the line of the new comment.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/annotatedline1.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/annotatedline1_small.jpg" /><br />
[Click for full size image]</a></p>
<p>Once you create an annotation, it gets an entry in the annotation list. You can select that entry to see a summary of the annotation, or you can double click on it to jump directly to the code it is assigned to. This makes it easy to get to the code that you&#8217;ve commented on.</p>
<p>We also found a bug on line 431 of <em>FileUtility.cs</em>, so a bug annotation can be logged for that. This new annotation has a red highlight to indicate that it&#8217;s a bug type.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/annotatedline2.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/annotatedline2_small.jpg" /><br />
[Click for full size image]</a></p>
<p>It&#8217;s helpful to only show annotations that you have created for the code review, without the clutter of others in the list. You can filter out all non-code review annotations by using the <strong>Annotation Filter Configuration</strong> dialog, available on the code annotations toolbar. Select <strong>Filter by Scope</strong> and select the &#8220;Global : Code Review &#8211; Bob&#8221; item. Now, only your code review annotations will be visible in the list.</p>
<p><img src="http://www.slickedit.com/images/stories/blog/code_review/annotationfilter.jpg" /></p>
<p><strong>Wrapping Up Your Review</strong><br />
Once all of your code review comments have been completed, they will all be contained in the file &#8220;<em>Code Review &#8211; Bob.sca</em>&#8220;, which we created at the beginning of the article (code annotation files have an extension of .sca by default). That file can then be sent to the code review organizer.</p>
<p><img src="http://www.slickedit.com/images/stories/blog/code_review/annotationfileattachment.jpg" /></p>
<p>All of the received code annotation files can then be imported by the organizer during the code review meeting, where they can be discussed. Reviewing code this way maintains a tight link between the code review comments and the actual source code, and is far better than trying to manage the process with pen and paper, or a set of text documents.</p>
<p>You can also create a report of the annotations to print before the meeting, or to send to other developers. To do this, click the <strong>View annotation Detail</strong> toolbar button. The <strong>Code Annotation Details</strong> dialog will be shown and each annotation in the list will be shown in the report. A small red document icon will appear by each annotation that may be clicked to navigate to that annotation in the source code. The report can be exported to HTML or printed.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/annotationreport.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/annotationreport_small.jpg" /><br />
[Click for full size image]</a></p>
<p>The next step will be the actual code review meeting, which will be the focus of part 3 of this series. Once the code annotation files are pulled together from all of the reviewers, those comments can be discussed and updated. After the code review meeting, they can be exported to a single code annotation file and emailed back to the group. The developer being reviewed then has a clear set of action items as a result of the meeting.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F07%2Flets-do-a-code-review-with-slickedit-tools-part-2%2F';
  addthis_title  = 'Let%26%238217%3Bs+Do+a+Code+Review+With+SlickEdit+Tools+%28Part+2%29';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/07/lets-do-a-code-review-with-slickedit-tools-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting With the End User</title>
		<link>http://blog.slickedit.com/2008/07/connecting-with-the-end-user/</link>
		<comments>http://blog.slickedit.com/2008/07/connecting-with-the-end-user/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 15:05:43 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=239</guid>
		<description><![CDATA[Coding is as much of an art as writing literature. It&#8217;s a forgotten sentiment in programming these days. It&#8217;s easy to get lost in the sea of API&#8217;s, libraries, frameworks, and everything that&#8217;s out there that must be understood before you can start to program effectively. But many programmers see this as the end. Once [...]]]></description>
			<content:encoded><![CDATA[<p>Coding is as much of an art as writing literature. It&#8217;s a forgotten sentiment in programming these days. It&#8217;s easy to get lost in the sea of API&#8217;s, libraries, frameworks, and everything that&#8217;s out there that must be understood before you can start to program effectively. But many programmers see this as the end. Once they learn how to use an API, their learning is considered complete until the next required API comes along.</p>
<p>Just like a novelist must have a solid foundation of grammar and vocabulary, a good programmer must understand the fundamental APIs for their language. But a novelist cannot write a novel with grammar and vocabulary alone. It takes creativity to turn the words into a meaningful connection with the reader. The equivalent of this in programming is usability for the end user.</p>
<p>Usability is such a bad word. Dictionary.com defines it as &#8220;capable of being used&#8221;. Thanks for that. However, scrolling down further, it also references the following as it relates to programming:</p>
<blockquote><p><em>The effectiveness, efficiency, and satisfaction with which users can achieve tasks in a particular environment of a product. High usability means a system is: easy to learn and remember; efficient, visually pleasing and fun to use; and quick to recover from errors. </em>[1]</p></blockquote>
<p>Now we&#8217;re getting somewhere! This is a perfect analogy to the novelist trying to connect to the reader. Investigating further, I found the <a href="http://en.wikipedia.org/wiki/Human-computer_interaction">HCI (Human Computer Interface) page at Wikipedia</a>. I was expecting to find the softer side of programming, sort of a feel good, warm milk and teddy bears approach to software. However, I pretty quickly realized that it&#8217;s a whole other science in itself.</p>
<p>After creating what I think are some really compelling features in our Tools product, I&#8217;m having to look back on it now and figure out how to optimize it for the user. That&#8217;s so hard to do when you&#8217;ve worked with a thing for so long, or even worse if you&#8217;ve created the interface to it. Just like I wrote in my &#8220;<a href="http://blog.slickedit.com/?p=232">Zen Mind, Programmer&#8217;s Mind</a>&#8221; post, I really need to go back and approach it as it I knew nothing about it. I&#8217;ve always approached HCI by imagining the way that I would want to use it. It&#8217;s so easy to forget that I&#8217;m just one person and there will be so many more people out there using my software that won&#8217;t agree with the way I use it.</p>
<p>HCI is fairly new to me, but I&#8217;m always interested in learning something new. The problem to me is how amorphous it is. There are principals, guiding rules, methodologies, and such, but there are no concrete steps. I guess that&#8217;s how it is though when you get into the areas of programming that make the leap from straightforward answers to creative problem solving.</p>
<p>I wonder if someday in a hundred years or so we&#8217;ll talk about software like we talk about classic literature now. Maybe someday there will be a Shakespeare or a Mark Twain of software. Maybe someday you&#8217;ll be able to see a piece of software and say that it&#8217;s a distinctive program for a particular developer group. The closest thing we have to that right now is Apple. Someday I hope I can look at may own software and think, &#8220;Yeah, that was <em>my</em> style.&#8221;</p>
<p>1. <a href="http://dictionary.reference.com/browse/00-database-info?db=foldoc">The Free On-line Dictionary of Computing, © 1993-2007 Denis Howe</a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F07%2Fconnecting-with-the-end-user%2F';
  addthis_title  = 'Connecting+With+the+End+User';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/07/connecting-with-the-end-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Disappointing Lack of Similarity Between Opposites, or The Ballad of Next and Prev</title>
		<link>http://blog.slickedit.com/2008/07/the-disappointing-lack-of-similarity-between-opposites-or-the-ballad-of-next-and-prev/</link>
		<comments>http://blog.slickedit.com/2008/07/the-disappointing-lack-of-similarity-between-opposites-or-the-ballad-of-next-and-prev/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 12:54:27 +0000</pubDate>
		<dc:creator>Dennis B</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=238</guid>
		<description><![CDATA[In writing software, there are a few words you see in your symbol names more than any others: First, Last Next, Previous Begin, End Push, Pop Draw, Erase Add, Remove High, Low Yes, No Stop, Go OK, Cancel And, Or Up, Down Left, Right True, False In, Out Plus, Minus Fixed, Floating Open, Close Each [...]]]></description>
			<content:encoded><![CDATA[<p>In writing software, there are a few words you see in your symbol names more than any others:</p>
<ul>
<li>First, Last</li>
<li>Next, Previous</li>
<li>Begin, End</li>
<li>Push, Pop</li>
<li>Draw, Erase</li>
<li>Add, Remove</li>
<li>High, Low</li>
<li>Yes, No</li>
<li>Stop, Go</li>
<li>OK, Cancel</li>
<li>And, Or</li>
<li>Up, Down</li>
<li>Left, Right</li>
<li>True, False</li>
<li>In, Out</li>
<li>Plus, Minus</li>
<li>Fixed, Floating</li>
<li>Open, Close</li>
</ul>
<p>Each pair is opposite in meaning and different in length. When I study these pairs of words, I can&#8217;t help but be absolutely convinced that the inventors of the English language gave absolutely no consideration to the fact that (thousands of years later) there will be millions of programmers writing code in mono-spaced fonts and really, really wanting it to line up nicely, but thwarted by this lack of similarity in length.</p>
<p>If you are smart, you&#8217;ll stop reading now, the rest is a bit predictable and boring. The point of this article is that it is annoying to write code that looks like this.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">T getNextItem();<br />
T getPreviousItem();</div></td></tr></tbody></table></div>
<p>So much is it annoying, that the monosyllabic, four letter abbreviation &#8220;Prev&#8221; has nearly became a universally accepted substitute for &#8220;Previous&#8221;, within the confines of software, at least.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">T getNextItem();<br />
T getPrevItem(); // ahhhhh</div></td></tr></tbody></table></div>
<p>You are still reading? Ok, fine. Really, if you have been programming at all, you have already encountered this, and you know everything I&#8217;m going to say. You <em>could</em> have stopped at the title, in fact.</p>
<p>There are a few exceptions to this rule of opposites &#8212; Get, Set, North, South, East, West, Insert, Delete, Internal, External, Throw, Catch. Get and Set are so loved, <em>I think for their matching size and rhyme</em>, that we have invented new words for those types of functions (getters and setters). Of course, &#8220;setter&#8221; isn&#8217;t a new word, but prior to the explosive discovery that both get and set had three letters, a &#8220;setter&#8221; usually referred to a breed of canine. What is really impressive are the applications you might find map directions applied to. Not in SlickEdit, but elsewhere, I have seen North and South used for cursor movement where you would have logically used Up and Down. Likewise, East and West have been applied to where you might logically think Left and Right and even, Next and Previous. My theory is that to some, alignment is a worthy cause, so much so that you may chose a naming scheme which involves a level of indirection.</p>
<p>Certain shell languages have employed mirror spellings of keywords as a level of indirection between opposites and like-sized keywords. Thus you find do, od, if, fi, case, esac. The first time you see it, you will think, &#8220;What is an esac? If it&#8217;s anything like an email, I do not want to touch it.&#8221; But, it may grow on you, as the Bourne shell has grown on Unix.</p>
<p>Acronyms were all the rage in the old days when it <em>really did matter</em> that your code be small and fit on a punch card. Some continue to survive and are frequently used, such as Gt for greater, Lt for less than, Eq for Equal, Ne for inequality, Hi for high, Lo for low, T for true, F for false. Sometimes you see hybrid abbreviation pairings, such as Up, Dn, or Add, Del.</p>
<p>Some programming language designers have addressed this issue with more symbols. APL is well known for it&#8217;s elaborate character set, &#8220;⌊&#8221; for floor and &#8220;⌈&#8221; for ceiling, for example. C++ introduced operator overloading and programmers followed that path of slow, destructive insanity towards standardizing &#8212; and ++ as next and previous iterator methods, among others.</p>
<p>But, in the end, this problem of opposites being different is not a programming language issue, it is a natural language issue. It&#8217;s a problem with the English vocabulary. And there is little we can do about that. Until we find a natural language invented by linguists who really thought about writing code in monospace fonts, our code will never be aligned as well as it could be.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F07%2Fthe-disappointing-lack-of-similarity-between-opposites-or-the-ballad-of-next-and-prev%2F';
  addthis_title  = 'The+Disappointing+Lack+of+Similarity+Between+Opposites%2C+or+The+Ballad+of+Next+and+Prev';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/07/the-disappointing-lack-of-similarity-between-opposites-or-the-ballad-of-next-and-prev/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s Do a Code Review With SlickEdit Tools (Part 1)</title>
		<link>http://blog.slickedit.com/2008/06/lets-do-a-code-review-with-slickedit-tools-part-1/</link>
		<comments>http://blog.slickedit.com/2008/06/lets-do-a-code-review-with-slickedit-tools-part-1/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 15:11:34 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=237</guid>
		<description><![CDATA[As a developer, I look for tools that help me get things done quicker, and make tasks easier. This series of articles shows you how to take a handful of the features in SlickEdit Tools for Microsoft® Visual Studio® and use them to effectively put together and perform a code review. I can&#8217;t say that [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer, I look for tools that help me get things done quicker, and make tasks easier. This series of articles shows you how to take a handful of the features in <a href="http://www.slickedit.com/content/view/408/244?utm_source=seblogtoolstut&amp;utm_medium=blog&amp;utm_campaign=seblogtoolstut">SlickEdit Tools</a> for Microsoft® Visual Studio® and use them to effectively put together and perform a code review.</p>
<p>I can&#8217;t say that I&#8217;ve met too many developers that eagerly looked forward to reviewing code. Most developers understand the importance of code reviews, but many have experienced the pain of poorly run code reviews. Although SlickEdit Tools does not have a &#8220;code review&#8221; feature, it provides several features that can be used together to make a code review run smoothly. A well done code review process can be the difference between developer loathing and developer buy-in.</p>
<p>Because code reviews are such a big topic, this article will focus on some of the steps that lead up to a code review. Code reviews typically focus on the work of a single developer, so we&#8217;ll start there. We are going to be code reviewing the developer with ID <em>SLICKEDIT\shackett</em> (or <strong>Scott</strong>) in source control, and we&#8217;ll be reviewing his work since March 3, 2008, which is the date of our last (fictional) release.</p>
<p><strong>Finding the Best Files to Review</strong><br />
Our first challenge involves finding the set of files that Scott has worked on since March 3, 2008. We&#8217;ll use the <strong>Find Version</strong> feature of the SlickEdit Tools Versioning Toolbox as our starting point.</p>
<p><img src="http://www.slickedit.com/images/stories/blog/code_review/findversion.jpg" /></p>
<p>Find Version allows you to query versions of the source code files in your solution. The code review organizer can use this feature to find an ideal set of files to review. Simply click <em>SlickEdit &gt; Find Version</em> to bring up the Find Version tool window. For this example, we&#8217;ll find versions with the following criteria:</p>
<ul>
<li><strong>Since date:</strong> Finds all versions checked in since a particular date, such as the last release.</li>
<li><strong>Developer name:</strong> Finds all versions checked in by one or more specific developers.</li>
</ul>
<p>These two criteria are used to find all versions checked in by Scott during the latest development cycle (March 3, 2008 &#8211; present).</p>
<p>No development team has the resources to code review every file in that list, so it&#8217;s important to find the best candidate files to review. Therefore, the next task is to look through the results and find a sampling of files that represent the most important or complex code. You might also include some files that have a high number of check-ins by that developer, which indicates high rate of change, or churn. These are the ideal candidate files to be reviewed. Email the names of those files to all developers who will be participating in the code review.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/findversionresults.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/findversionresults_small.jpg" /><br />
[Click here for the full size image]</a></p>
<p>In this example, <em>PackageBaseWhidbey.cs</em> has had several changes and is a very important file, so we&#8217;ll include that in our code review process.</p>
<p><strong>Loading the Files to Review</strong><br />
When a developer is ready to prepare their review comments, they should close all other files and open the files in the list sent by the code review organizer. This can be done quickly using the <strong>Load Files </strong>feature in the Editing Toolbox, which allows you to quickly filter the list of files in your solution and open the ones you&#8217;re looking for. Click <em>SlickEdit &gt; Load Files</em> to use this feature.</p>
<p><img src="http://www.slickedit.com/images/stories/blog/code_review/loadfiles.jpg" /></p>
<p>By typing &#8220;<em>basew</em>&#8221; in the filter, we narrow down the files in the list to only those that include that text in their file name. We&#8217;ll select <em>PackageBaseWhidbey.cs</em> and open it.</p>
<p><strong>Isolating a Developer&#8217;s Work</strong><br />
One of the most difficult things to do when reviewing the code of another developer is actually identifying the work that that developer did, especially if it was done as part of a team. Once you have <em>PackageBaseWhidbey.cs</em> open, we&#8217;ll use the <strong>Version Visualizer</strong> feature of the Versioning Toolbox to see which parts Scott has worked on. Click <em>SlickEdit &gt; Version Visualizer</em> to show this tool window. Next, select &#8220;Default User Scheme&#8221; in the drop down at the top of that tool window.</p>
<p><img src="http://www.slickedit.com/images/stories/blog/code_review/versionvisualizer.jpg" /></p>
<p>The versions of the file will be processed and the tool window will list the names of all developers who have contributed to the current state of the file. The editor also becomes colorized into segments of lines that identify who wrote each line of the file.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/defaultuserscheme1.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/defaultuserscheme1_small.jpg" /><br />
[Click here for the full size image]</a></p>
<p>You can find Scott&#8217;s name (<em>SLICKEDIT\shackett</em>) in the tool window list and double click on it to go to the first line of code he contributed. You can then use the next and previous button on the tool window to navigate through the blocks of his work.</p>
<p>To make Scott&#8217;s work stand out more distinctly, select his name (<em>SLICKEDIT\shackett</em>) in the list and click the &#8220;Toggle Selection Visibility&#8221; toolbar button. When toggled on, Scott&#8217;s work will stand out, and all other developer&#8217;s work will be dimmed out. This allows you to quickly see what code is Scott&#8217;s and what code isn&#8217;t. You can click this button again to toggle it back off.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/defaultuserscheme2.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/defaultuserscheme2_small.jpg" /><br />
[Click here for the full size image]</a></p>
<p>Another option is to assign a unique color to Scott. To do this, click the <strong>Configure Visualization Schemes</strong> button on the <strong>Version Visualizer</strong> toolbar. This will bring up the <strong>Scheme Builder</strong> dialog. We&#8217;ll create a new scheme to highlight all areas of code worked on by Scott. Click the <strong>Add new scheme</strong> button and give the scheme a name of &#8220;Scott&#8217;s code&#8221;. We can now add a scheme item for Scott and give it a color of bright red.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/schemebuilder.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/schemebuilder_small.jpg" /><br />
[Click here for the full size image]</a></p>
<p>We can save this visualization scheme and then apply it by selecting it in the <strong>Version Visualizer</strong> drop down. This same scheme can be applied to any file to highlight areas of the code written by Scott.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/defaultuserscheme3.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/defaultuserscheme3_small.jpg" /><br />
[Click here for the full size image]</a></p>
<p>If you find a block of code written by the developer being reviewed that looks questionable, you may want more context about the developer&#8217;s intent, such as the check in comment made when that section of code was checked in. This information is very important for creating meaningful code review comments. The easiest way to do this is to see which version that code was checked in as, and look at the comment associated with that version. To do this, select &#8220;Default Relative Age Scheme&#8221; in the drop down at the top of the <strong>Version Visualizer</strong> tool window.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/code_review/defaultrelativeagecheme.jpg"><img src="http://www.slickedit.com/images/stories/blog/code_review/defaultrelativeagecheme_small.jpg" /><br />
[Click here for the full size image]</a></p>
<p>Again, the versions of the file will be processed, but now the tool window will list the IDs of all versions that have contributed to the current state of the file. The editor also becomes colorized into segments of lines that identify which version last updated each line of the file. The colorizing of each segment corresponds to the age of the version it was checked in with (dark is oldest, light is most recent).</p>
<p>You can find the version associated with the questionable code and take a look at the comments associated with it. You can also use the next and previous button as before to see all of the code in the file that was updated as a result of that check in. For instance, we may have disagreed with the AddMenuCommandHandler function being public. We can see that change was part of version 762. By hovering over that version in the <strong>Version Visualizer</strong> tool window, we get a better understanding of why the function was made public. All of these features assist the team in making judgments about which code to review. They also provide some insight into the motivation the developer being reviewed might have had when checking a set of code in.</p>
<p>Next is the task of actually commenting on the code. This task is always best done in electronic format, in a way that can be pulled together as part of the code review meeting. The <strong>next article</strong> in the series will go through some of the features of SlickEdit Tools that facilitate writing comments about code and tying them directly to the source, without modifying the files.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F06%2Flets-do-a-code-review-with-slickedit-tools-part-1%2F';
  addthis_title  = 'Let%26%238217%3Bs+Do+a+Code+Review+With+SlickEdit+Tools+%28Part+1%29';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/06/lets-do-a-code-review-with-slickedit-tools-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Programming Book Graveyard</title>
		<link>http://blog.slickedit.com/2008/06/the-programming-book-graveyard/</link>
		<comments>http://blog.slickedit.com/2008/06/the-programming-book-graveyard/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 16:56:24 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=236</guid>
		<description><![CDATA[I&#8217;m a bit of a pack rat&#8230; I have a hard time getting rid of anything I think I might possibly need in the future, and that&#8217;s especially true of computer books and magazines. Once upon a time, there was no internet&#8230; a sad fact that makes me feel older than my parents who can [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a bit of a pack rat&#8230; I have a hard time getting rid of anything I think I might possibly need in the future, and that&#8217;s especially true of computer books and magazines. Once upon a time, there was no internet&#8230; a sad fact that makes me feel older than my parents who can remember a time without TV. There was no Googling MSDN, no easy access to message boards, no coding sample web sites. Back then all you had was paper and ink, and you learned what you needed to learn by going to the bookstore and picking up the latest programming book on that subject. <a href="http://bp2.blogger.com/_p-WnL3N525c/R3pk6H9OQBI/AAAAAAAAAE0/20PwSTGjnDk/s1600-h/DaCa-Grumpy+Old+Man.jpg">And we liked it!</a></p>
<p>A programmer&#8217;s bookshelf was more than a reference library though; it was your peer resume. Other programmers would look through your bookshelf the same way that animals size each other up in the wild. When you started a new job, your bookshelf contents were like the cologne and nice clothes you put on for a first date. It was a huge part of the first impression you made and helped define what you knew. Did anyone care if you&#8217;d really read those books? Of course not! Just seeing <a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=pd_bxgy_b_img_a">Design Patterns</a>, <a href="http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262032937/ref=pd_sbs_op_img_1">Introduction to Algorithms</a> and <a href="http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=pd_bxgy_b_img_a">The C++ Programming Language</a> was enough to grant you elite status your first day on the job (at least to those who mattered).</p>
<p>At my desk right now, I have approximately thirty books on the shelf. I&#8217;ve read them all from cover to cover, some of them several times. However, I haven&#8217;t read any of them in the past five years. At times, I&#8217;ll crack one open for a quick reference to something I can&#8217;t find quickly online, but seriously, they&#8217;re relics. I know that I should just do the smart thing and admit to them that the internet has caused their jobs to become redundant. I should tell them that the bookshelf is being downsized, and that they&#8217;re jobs have been outsourced to the web servers at Google. I just can&#8217;t bring myself to do that, though.</p>
<p>Every one of them has, in some strange way, come to mean more to me than just the information they contain. I can look at the cover of almost any book on my shelf and remember the reason I bought it, the project I was working on when I read it, and the difficult problems that it helped me work my way thorough. Many of the books have pictures of the authors on the cover, personifying them. All of the books make me reminisce to the period of time when they were read, the same way that so many songs from my first year of college do. I feel like I could take my programming books out for a beer and have a blast catching up on old times.</p>
<p>My programming bookshelf isn&#8217;t about learning anymore, and it&#8217;s certainly not about impressing anyone. I may at some point retire them, but not anytime soon. They sit on my shelf like old friends who I want to share my new programming experience with. They helped me out through tough times and I still want them to be there for all of my latest projects. I think my COM ATL books are grudgingly impressed with all the new-fangled .Net stuff, though I don&#8217;t think they trust it. My sockets books like to shake their walkers at web services. And of course, my first HTML book doesn&#8217;t think this fancy web 2.0 nonsense looks anywhere near as good as the first Geocities home page it helped me make.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F06%2Fthe-programming-book-graveyard%2F';
  addthis_title  = 'The+Programming+Book+Graveyard';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/06/the-programming-book-graveyard/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>&#8220;Management&#8221; is a Dirty Word</title>
		<link>http://blog.slickedit.com/2008/06/management-is-a-dirty-word/</link>
		<comments>http://blog.slickedit.com/2008/06/management-is-a-dirty-word/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 14:36:55 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Dev Management]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=233</guid>
		<description><![CDATA[Though it won&#8217;t be flagged as profane in most dictionaries, one word that is often viewed as a dirty word in programming is “management”. Managers are so maligned in engineering that Scott Adams created the “pointy-haired boss” as their representative (http://www.dilbert.com/). It may be true that managers are equally loathed in other fields, but having [...]]]></description>
			<content:encoded><![CDATA[<p>Though it won&#8217;t be flagged as profane in most dictionaries, one word that is often viewed as a dirty word in programming is “management”. Managers are so maligned in engineering that Scott Adams created the “pointy-haired boss” as their representative (http://www.dilbert.com/). It may be true that managers are equally loathed in other fields, but having spent my adult years working in software engineering, this is the only field I feel competent to address. I also have a somewhat unique perspective having been both a developer and a development manager.</p>
<p>I believe that all teams need management. That’s not to say that they all need a manager; some teams do manage themselves. Effective management gets the most out of a team by setting clear goals and minimizing time lost to indecision. A good manager bridges the gap between the business team and the technical team, making sure that both viewpoints are properly considered. A strong development manager can bring a process-centric view to the development team that seeks to improve daily workflows and operations.</p>
<p><strong>So, what’s wrong with “management”? </strong></p>
<p>I think the core reason that software management is so reviled is that it is so rarely done well. In my programming career, I can divide my previous managers into 3 categories:</p>
<ol>
<li><strong>Benevolent, useless, harmless</strong>—this is the category into which fall most of my previous managers. They did a reasonable job of passing along information and managing schedules, but I never really felt they were helping me get my job done. I spent a great deal more time giving them status reports than receiving guidance.</li>
<li><strong>Malevolent, clueless, harmful</strong>—fortunately this category contains only a few of my previous managers. These are the ones who made the job much harder than it needed to be. Sometimes it was done to further their individual goals, like the manager who stuck us with an unreachable milestone so he could get a 30% bonus. Others, it was because they had no idea what we were doing and didn’t have the courage to admit it.</li>
<li><strong>Effective, purposeful, supportive</strong>—by far the smallest population, this is the category we wish all managers fell into but so few actually do. These are the ones who truly help you get your work done by providing the kind of guidance and environment you need to succeed. Tom R., you were the best!</li>
</ol>
<p><strong>How did we get here?</strong></p>
<p>There are so many contributory causes for this problem. The first group, above, is composed of good people who just don’t know what to do. The second group shouldn’t be in charge of themselves, let alone others. I can offer little help to the second group, so let’s focus on the first.</p>
<p>There are two kinds of development managers: those with a strong programming background and those without one (henceforth called “programmers” and “non-programmers”). Even if you have some programming experience, it may not be enough to qualify you as a programmer. You have to have done enough to be considered as a peer on your programming team. I divide managers into these groups because they face different challenges. I’ve worked for managers from both backgrounds and neither is a guarantee of success or failure. My best manager learned his craft managing supermarkets before he went into software development.</p>
<p>To be a successful development manager, you need to know how to manage and enough about software engineering to make appropriate choices. Oddly enough, both groups seem to struggle with the first item. Though the non-programmers tend to have better communication skills than the programmers (if they didn’t, what the heck were they hired for since they’re not programmers?), few of them in my career were skilled managers.</p>
<p><strong>Unique Challenges</strong></p>
<p>The unique challenge faced by the non-programmers is their lack of knowledge about software development. This often hinders their decision-making. A common sign of this is an insistence on keeping to the schedule when a minor slippage could make a huge difference later. When you’ve been around software development long enough, you learn that schedules are fluid. What you do today can make your work tomorrow easier, or harder, depending on the quality of the design and implementation. It takes experience and insight to know when to make these tradeoffs.</p>
<p>Another common problem for the non-programmer manager is not being able to call shenanigans when a developer is snowing you. Even as a programmer, you will never know someone’s code like they will, but you will know from your experience when a developer is likely doing something wrong. My background has helped me to sniff out cases of “design by resume”, where developers chose a particular approach in order to get a trendy new technology on their resume. A non-programmer manager would have a hard time asking the appropriate questions to recognize this.</p>
<p>The programmer managers also face unique challenges. The first is the temptation to code and manage at the same time. I read where others actually recommend this as the desired situation. In my experience, the two activities are incompatible. Effective coding is about immersion, getting into a state of flow, and being very productive. Effective management involves being available to your team to tackle their issues when they arise. Even when I wanted to try to keep coding, I’ve never had a position where the management responsibilities didn’t crowd out any time I allocated for coding. As a manager, my favorite means of being involved with the code is to participate in design discussions and code reviews. This keeps things at a high level and still allows you to contribute your knowledge and experience.</p>
<p>Another problem for the programmer manager is trying to be “one of the guys”. This is manifested as a manager who is hesitant or unable to provide negative feedback. Often, these kinds of managers are promoted from within the team, making this even more of an issue. These managers still view themselves or want to be considered to be a member of the development team rather than its leader.</p>
<p>As a manager, your primary allegiance must be with the business team. Your job is to take their goals and translate them into effective plans to accomplish them. Where you think these goals will lead to problems, you need to point that out. However, if you can’t get them to change the goals, then you need to sign up to them and do your best to accomplish them. Programmer managers sometimes have a difficult time making this change.</p>
<p><strong>Shared Challenges</strong></p>
<p>The most common shared challenge is a lack of knowledge about how to manage. Most of the managers I have worked for had no formal training in management. At best they had a seminar or two. Few ever read any books on management or software development management. Since they, too, have had few truly effective managers, they have no guidance on how to manage. They just don’t know what to do.</p>
<p>An example where this shows up is the weekly status meeting. Most managers have one. They have one because their previous managers had one. In its most typical form, the status meeting lasts for an hour or so while the manager has a conversation with each member of the team, discussing what they are doing. The theory is that having this as a team fosters teamwork and helps everyone to know what everyone else is doing. In reality, the rest of the team already knows or doesn’t care. So this ends up being a large waste of time as the manager has a one-on-one conversation with each team member in front of the rest of the team.</p>
<p>Don’t get me wrong, I’m not saying that status meetings are wrong. But you need to choose to have one because of the benefits the team will get from it, because it is right for this team. Instead, most choose to have one because that’s how they’ve been managed in the past, and it is a visible sign that they are in charge. One of the primary goals of management should be to achieve stated goals with as little interruption in the daily work as possible.</p>
<p><strong>The Solution</strong></p>
<p>What we need to solve this is the same thing we need for all leaders: wise, beneficent individuals with a commitment to goals and compassion for their team. In software development, you need to add in enough knowledge to be mindful of the unique challenges in our field. To erase the pointy-haired boss from our minds or at least remove him as the dominant figure in engineering management, we need enough developers crossing over to become committed managers or enough business managers to gain an appreciation for software development.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F06%2Fmanagement-is-a-dirty-word%2F';
  addthis_title  = '%26%238220%3BManagement%26%238221%3B+is+a+Dirty+Word';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/06/management-is-a-dirty-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zen Mind, Programmer&#8217;s Mind</title>
		<link>http://blog.slickedit.com/2008/05/zen-mind-programmers-mind/</link>
		<comments>http://blog.slickedit.com/2008/05/zen-mind-programmers-mind/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:14:59 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=232</guid>
		<description><![CDATA[&#8220;In the beginner&#8217;s mind there are many possibilities, but in the expert&#8217;s there are few.&#8221; &#8211; Suzuki As programmers of an application or feature, we quickly develop our own preconceptions as to how the software should work. Every day that we spend working on something, the use patterns of that feature become more and more [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8220;In the beginner&#8217;s mind there are many possibilities, but in the expert&#8217;s there are few.&#8221;</em> &#8211; Suzuki</p>
<p>As programmers of an application or feature, we quickly develop our own preconceptions as to how the software should work. Every day that we spend working on something, the use patterns of that feature become more and more hard wired into our brain. The end result is often a piece of software that works the way that <strong><em>we</em></strong> would expect it to. However, once that software gets released into the wild, many people are going to be using it, all of whom have never seen or touched it before. As a rule of thumb, each of those people will approach it with different perspectives. Each person will use it in a different way, and have different expectations of what it should and shouldn&#8217;t do.</p>
<p>Requirements are always necessary, but it would be impossible to capture everything in the requirements that any user would want or need, especially when it comes to the more subtle areas like UI workflow. Important use cases can also go completely undetected until a real end user actually sits down to work with it. Because of that, it&#8217;s important to remember that even the best requirements are not guaranteed to be intuitive or even correct. To help with this, we&#8217;ll need to bring in a Zen Buddhist master.</p>
<p><strong>Zen Buddhism in Application Development</strong></p>
<p>There are a handful of books I&#8217;ve been fortunate enough to stumble across that have changed me in some way. Those books are the ones I keep going back to, to remind me of that moment when I&#8217;d learned something new, yet felt like I&#8217;d known it all my life. <a href="http://www.amazon.com/Zen-Mind-Beginners-Shambhala-Library/dp/1590302672/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1210593134&amp;sr=8-1">Zen Mind, Beginner&#8217;s Mind</a> by Shunryu Suzuki is one of those books. In it, the author and Zen master teaches the importance of &#8220;beginners mind&#8221;, which is the concept of constantly seeing with new eyes. It&#8217;s a teaching that he recommends for all aspects of daily life, though I doubt he ever imagined software development would be on that list.</p>
<p>As developers, we need to see our work from two perspectives:</p>
<ul>
<li><strong>Expert&#8217;s perspective:</strong> From this view, we make sure that the software is meeting the known requirements, which is our primary goal.</li>
<li><strong>Beginner&#8217;s perspective:</strong> From this view, we try to see the software as though we&#8217;ve never used it before and constantly ask the question, &#8220;Does that make sense?&#8221;</li>
</ul>
<p>These may seem very similar, but they&#8217;re not. For instance, let&#8217;s create a signature in Microsoft Outlook.</p>
<p><strong>Requirement:</strong> Allow the user to specify text to be automatically appended to every outgoing email. (Sounds simple enough&#8230;)</p>
<p><strong>Implementation:</strong></p>
<ol>
<li>Click Tools &gt; Options.</li>
<li>Click the &#8220;Mail Format&#8221; tab on the options dialog.</li>
<li>Click the &#8220;Signatures&#8230;&#8221; button on that tab pane. This brings up the &#8220;Create Signature&#8221; dialog.</li>
<li>Click the &#8220;New&#8221; button. This brings up the &#8220;Create New Signature&#8221; wizard dialog.</li>
<li>Enter a name for your signature and select that you want to start with a blank signature. Now click the &#8220;Next&#8221; button.</li>
<li>Type your signature. When you&#8217;re done, click &#8220;Finish&#8221;.</li>
<li>Click &#8220;OK&#8221; on the &#8220;Create Signature&#8221; dialog.</li>
<li>Your new signature is now added to a list of signatures on the &#8220;Mail Format&#8221; tab pane. Select it and click OK.</li>
</ol>
<p>Do those steps fulfill the requirement to create a signature? Check. Would a new user to Outlook have any clue how to do that without digging through help? Fail. This is a clear case where the development team did not look at final product and ask themselves, &#8220;Did that make sense?&#8221; The obvious answer is no.</p>
<p>There was a fantastic blog post recently called &#8220;<a href="http://contentconsumer.com/2008/04/27/is-ubuntu-useable-enough-for-my-girlfriend/">The Great Ubuntu-Girlfriend Experiment</a>&#8220;. In this post, the author has his girlfriend use his latest installation of Ubuntu as a way of getting a beginner&#8217;s perspective on it. He winds up with some very interesting conclusions, specifically &#8220;that the geeky programmers and designers assume too much from the average user&#8221;.</p>
<p>End users are demanding more and more ease of use out of the box without having to go to help (much to the dismay of our tech writer). Think about the <a href="http://en.wikipedia.org/wiki/GEICO_Cavemen">Geico caveman</a>&#8230; buying insurance with Geico.com is so easy even he could do it. Ease of use and intuitiveness are so in demand that Geico launched a massive marketing campaign with that as its centerpiece. The commercials don&#8217;t say anything about price, customer service or any of the details of their policies. It&#8217;s just easy to use&#8230; and that pulls in huge numbers of people.</p>
<p><strong>Putting It Into Practice </strong></p>
<p>Having beginner&#8217;s perspective on your own software <strong>sounds</strong> much easier than it really is. Stepping back and using the software without preconceptions involves being honest with yourself. Sometimes it&#8217;s easier to give in to the fact that the software might meet the requirements, and that task can be considered done. However, it&#8217;s those little touches like usability that can bring an application to the next level, and move it up from good to best. Finding those usability issues can only be done by being objective about your own work. It&#8217;s far better to find those issues during development than when an end user first sits down to try the software.</p>
<p>Whether you use Zen mind, caveman mind or girlfriend mind [ducking behind my chair], try and take the time to step back and ask yourself if you would love your software just as much if you were trying to figure it out for the first time. Just like meditation, it&#8217;s a practice that gets easier every time you do it. Soon, it should become a normal part of your daily approach to software development. Of course I&#8217;d be lying if I said that I had actually attained this goal, but I try.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F05%2Fzen-mind-programmers-mind%2F';
  addthis_title  = 'Zen+Mind%2C+Programmer%26%238217%3Bs+Mind';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/05/zen-mind-programmers-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: Adding Language Support to SlickEdit</title>
		<link>http://blog.slickedit.com/2008/05/tutorial-adding-language-support-to-slickedit/</link>
		<comments>http://blog.slickedit.com/2008/05/tutorial-adding-language-support-to-slickedit/#comments</comments>
		<pubDate>Wed, 14 May 2008 15:06:50 +0000</pubDate>
		<dc:creator>Dennis B</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=212</guid>
		<description><![CDATA[In this article, I am going to illustrate how to add very simple support for a language that, out of the box, is not already handled by SlickEdit. To this end, I am choosing &#8220;Logo&#8221; as an example. I made this choice partially as a follow-up to Scott&#8217;s article about using it as an educational [...]]]></description>
			<content:encoded><![CDATA[<p>In this article, I am going to illustrate how to add very simple support for a language that, out of the box, is not already handled by SlickEdit.  To this end, I am choosing &#8220;Logo&#8221; as an example.  I made this choice partially as a follow-up to Scott&#8217;s article about using it as an educational language.  At first, I was going to use LOLCODE as my example, but then a genuine fear fell over me that I would be contributing to the delinquency of programmers by putting together support for LOLCODE&#8217;ing in SlickEdit.</p>
<p>I have used the freely available book <a href="http://www.softronix.com/download/tgla.zip">&#8220;The Great Logo Adventure!&#8221;</a> as a reference in this article.  Please note that I am not an experienced Logo programmer, so if you bear with me, you can learn how to add language support and I can learn something about Logo.</p>
<p><strong>Step 1: Defining the language</strong></p>
<p>Go to Tools &gt; Options&#8230;, and navigate to Languages &gt; &#8220;Language Manager&#8221;, then click on &#8220;Add Language&#8230;&#8221;  Enter the following:</p>
<ul>
<li>Mode name:  Logo</li>
<li>Associated extensions:  logo lgo</li>
<li>Color coding:  leave blank</li>
</ul>
<p><strong>Step 2: Color Coding</strong></p>
<p>Now navigate to your Logo language settings and find the &#8220;Color coding&#8221; page.</p>
<p>Click on the top-most &#8220;New&#8230;&#8221; button to create a new Lexer and name it Logo.  Now, we need to define the color coding.  Let&#8217;s work left to right, starting with the Tokens tab.</p>
<p>Logo is case-insensitive, so uncheck &#8220;Case sensitive&#8221;.  The identifier characters can be left pretty much as they are.  Logo, in fact, will allow nearly anything to be an identifier, but in practical terms, the typical C language style identifiers are adequate.</p>
<p>Next, we add Keywords.  The list below is fairly complete, though there is a fair amount of room for interpretation with respect to what is a keyword and what isn&#8217;t in Logo.  Note that when you add new Keywords, you can add several at once if you separate them with spaces.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CS &nbsp; &nbsp; &nbsp; &nbsp; IFTRUE &nbsp; &nbsp; &nbsp;OR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SENTENCE<br />
ASCII &nbsp; &nbsp; &nbsp; &nbsp; CT &nbsp; &nbsp; &nbsp; &nbsp; LABEL &nbsp; &nbsp; &nbsp; PARSE &nbsp; &nbsp; &nbsp; SETUP<br />
ASK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EDIT &nbsp; &nbsp; &nbsp; LEFT &nbsp; &nbsp; &nbsp; &nbsp;PR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SHOW<br />
<br />
BACK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END &nbsp; &nbsp; &nbsp; &nbsp;LIST &nbsp; &nbsp; &nbsp; &nbsp;PRINT &nbsp; &nbsp; &nbsp; TC<br />
<br />
BACKSLASHEDP &nbsp;EQUALP &nbsp; &nbsp; LOAD &nbsp; &nbsp; &nbsp; &nbsp;READLIST &nbsp; &nbsp;TEST<br />
<br />
BYE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FALSE &nbsp; &nbsp; &nbsp;LOCAL &nbsp; &nbsp; &nbsp; READWORD &nbsp; &nbsp;TO<br />
<br />
CHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FLASHER &nbsp; &nbsp;LOCALMAKE &nbsp; REPEAT &nbsp; &nbsp; &nbsp;TRUE<br />
<br />
CLEARSCREEN &nbsp; FORWARD &nbsp; &nbsp;MAKE &nbsp; &nbsp; &nbsp; &nbsp;RUNPARSE &nbsp; &nbsp;TYPE<br />
CLEARTEXT &nbsp; &nbsp; IFELSE &nbsp; &nbsp; NOT &nbsp; &nbsp; &nbsp; &nbsp; RIGHT &nbsp; &nbsp; &nbsp; WAIT<br />
COUNT &nbsp; &nbsp; &nbsp; &nbsp; IFFALSE &nbsp; &nbsp;NUMBERP &nbsp; &nbsp; SAVE &nbsp; &nbsp; &nbsp; &nbsp;WORD</div></td></tr></tbody></table></div>
<p>Now switch to Preprocessing and add:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.DEFMACRO &nbsp; &nbsp; .SETBF<br />
.EQ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .SETFIRST<br />
.MACRO &nbsp; &nbsp; &nbsp; &nbsp;.SETITEM<br />
.MAYBEOUTPUT</div></td></tr></tbody></table></div>
<p>And Punctuation:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">( &nbsp; ) &nbsp; : &nbsp; [ &nbsp; ]</div></td></tr></tbody></table></div>
<p>And Operators:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">+ &nbsp; - &nbsp; / &nbsp; * &nbsp; =</div></td></tr></tbody></table></div>
<p>Now switch to Library Symbols.</p>
<p>This is where you would typically add coloring for functions that are built into the language or included with the standard language libraries.  Since Logo has nearly 500 built-ins, it would be senseless to try to type them all in manually.  The attached hotfix includes a file, &#8220;logo_builtins.txt&#8221; which contains all the built-ins.  This file was constructed by opening the help file for MSWLogo (<a href="http://www.softronix.com">Microsoft Windows Logo, by Softtronics, Inc.</a>) using SlickEdit&#8217;s Help Indexer (&#8220;Help&#8221; &gt; &#8220;Configure F1 Index Help&#8221;).  I added the help file, then clicked on &#8220;Export&#8230;&#8221; to extract the index entries, then edited out the few things which were not library functions.  In the Color Coding dialog, click on &#8220;Get&#8230;&#8221;, point it at this file, and it will pull in all the words in the list file.</p>
<p>Note that the color coding engine is not perfect is the keyword coloring.  Logo is very context dependent whether a symbol is being used as keyword or just a word or list.  Lists are sometimes code, sometimes strings.  The color coding engine has no idea about these rules, so it sees a word that matches a keyword and it colors it.  This is simultaneously quite useful, quite annoying, and quite unavoidable.</p>
<p>We can now turn our attention to the Numbers tab.  The default settings will be adequate here.</p>
<p>In the Strings tab, we have to do something ugly.  Check the two items:</p>
<ul>
<li> Double quoted strings are always 1 char long</li>
<li> Single quoted strings are always 1 char long</li>
</ul>
<p>This is necessary because Logo doesn&#8217;t have the typical kind of string constants we have grown to expect in other languages, so we need to trick it, otherwise nearly everything will look like strings.  This solution is not ideal, but it is readable.  Sometimes, unusual language features will not map to SlickEdit&#8217;s default color coding engine, and you have to settle for the best you can do and move on.  This is one such case.</p>
<p>The default settings are fine for the Language tab, so let&#8217;s move on to Comments.  Logo has one type of comment, the semicolon.  So, click on &#8220;New Line Comment&#8230;&#8221; and specify that it uses &#8220;;&#8221; as the delimiter.</p>
<p>We are now done with configuring color coding.  Color coding definition are saved in &#8220;user.vlx&#8221; in your configuration directory.  I recommend opening &#8220;user.vlx&#8221; and copying the entire definition for [Logo], then saving it to a new file &#8220;logo.vlx&#8221;, also in your configuration directory.  This will be used later when we package up the language support.</p>
<p><strong>Step 3: Tuning language settings</strong></p>
<p>We can now configure other Language specific options for Logo.  Start with the <em>Indent</em> options.  You will probably want to set your tabs to &#8220;+3&#8243;, or something more in line with your preferences.</p>
<p>Now switch to the <em>Comments</em> options.  Define the &#8220;Comment line&#8221; to use &#8220;; &#8221; on the left so that you will be able to use &#8220;Document&#8221; &gt; &#8220;Comment Lines&#8221; and &#8220;Document&#8221; &gt; &#8220;Uncomment Lines&#8221; in your Logo source files.</p>
<p>On the <em>General</em> tab, make sure &#8220;Logo&#8221; is selected as the Color coding Lexer name.  I also recommend turning on the &#8220;Current Line&#8221; check box to highlight the current line, since SlickEdit does current line and selection highlighting better than any editor out there.</p>
<p>While we are on the <em>General</em> tab, click on &#8220;Language-Specific Project&#8230;&#8221; to set up a command for loading and running Logo programs in MSWLogo.  Go to the &#8220;Tools&#8221; command and select &#8220;Execute&#8221;.  Enter &#8220;logo32.exe -l %f&#8221; for the Command Line, and specify the Run from dir to be &#8220;%p&#8221; (file path).  You may have to give a [quoted] absolute path to logo32.exe if it is not on your regular path.</p>
<p><strong>Step 4:  Configure aliases</strong></p>
<p>Switch to the <em>Aliases</em> options for Logo.  This will allow you to define some typing shortcuts for Logo syntax.  I will provide one example and let you go from there.</p>
<p>To define an alias for defining a function, click on &#8220;New&#8230;&#8221; and name the alias &#8220;to&#8221;.  Fill in the alias text with the following:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">to %\c<br />
%\i%\c<br />
end</div></td></tr></tbody></table></div>
<p>&#8220;%\c&#8221; specifies a cursor landing and &#8220;%\i&#8221; specifies indentation.</p>
<p><strong>Step 5:  Create a language support module</strong></p>
<p>All of the above work displays how you can add support for viewing color coded files in SlickEdit, entirely through the configuration dialogs without writing any Slick-C code.  However, if you want to hand what you have done over to another developer, the best way is to write a language support module that he can simply load and use.  For what we have done so far with Logo, the essentials can be accomplished with the following small amount of code.  A complete copy of the language support module (logo.e) is attached to this article.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#define LOGO_MODE_NAME &quot;Logo&quot;<br />
#define LOGO_EXTENSION1 &quot;logo&quot;<br />
#define LOGO_EXTENSION2 &quot;lgo&quot;<br />
<br />
// This function is called when the module is loaded.<br />
// It configures the &quot;logo&quot; and &quot;lgo&quot; file extensions.<br />
void defload()<br />
{<br />
&nbsp; &nbsp;_str setup_info=&quot;MN=&quot;LOGO_MODE_NAME&quot;,TABS=+3,MA=1 74 1,&quot;:+<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;KEYTAB=ext-keys,WW=1,IWT=0,ST=0,IN=2,&quot;:+<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WC=A-Za-z0-9_$,LN=&quot;LOGO_MODE_NAME&quot;,CF=1&quot;;<br />
&nbsp; &nbsp;_str compile_info=&quot;0 logo32 *&quot;;<br />
&nbsp; &nbsp;_str syntax_info=&quot;3 1 2 1 0 1 0&quot;;<br />
&nbsp; &nbsp;_str be_info=&quot;(to)|(end);i&quot;;<br />
&nbsp; &nbsp;int kt_index=0;<br />
&nbsp; &nbsp;_CreateLanguage(kt_index, LOGO_MODE_NAME,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setup_info, compile_info, syntax_info, be_info);<br />
&nbsp; &nbsp;_CreateExtension(&quot;logo&quot;, LOGO_MODE_NAME);<br />
&nbsp; &nbsp;_CreateExtension(&quot;lgo&quot;, LOGO_MODE_NAME);<br />
<br />
&nbsp; &nbsp;_str logo_vlx = _config_path() :+ FILESEP :+ &quot;logo.vlx&quot;;<br />
&nbsp; &nbsp;if (file_exists(logo_vlx)) {<br />
&nbsp; &nbsp; &nbsp; import_lexer_file(logo_vlx);<br />
&nbsp; &nbsp;}<br />
}</div></td></tr></tbody></table></div>
<p><strong>Step 6: Write tagging support for Logo</strong></p>
<p>Tagging is not rocket science, you can write your own tagging support with a minimal amount of effort, depending on the language you are trying to parse.</p>
<p>In the case of Logo, the critical item is the &#8220;to&#8221; statement, which defines a procedure.</p>
<p>User-defined tagging support is accomplished by writing a language-specific &#8220;proc-search&#8221; function, the signature for this function is as follows:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int logo_proc_search(_str &amp;amp;proc_name, int find_first);</div></td></tr></tbody></table></div>
<p>The function returns &lt;0 on error, and 0 on success, also setting &#8220;proc_name&#8221; to the encoded information about the symbol which was found.</p>
<p>The basic outline for a &#8220;proc-search&#8221; function is to start by searching for a regular expression which will find lines that symbol declarations happen on.  If the search fails, return the failure status and it&#8217;s all over.  Otherwise, you parse apart the line and get the name of the symbol that was declared.  Finally, you set proc_name and return 0.  A very simple example for Logo is included below.  The &#8220;logo_proc_search&#8221; included in logo.e is a little more thorough than this, but this is a good starting point for nearly any language.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;int status = search(&quot;^(:b|)(to:b|make:b[\&quot;]):v&quot;,&quot;@rih&amp;gt;Xcs&quot;);<br />
&nbsp; &nbsp;if (status) {<br />
&nbsp; &nbsp; &nbsp; proc_name=&quot;&quot;;<br />
&nbsp; &nbsp; &nbsp; return status;<br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;get_line(line);<br />
&nbsp; &nbsp;parse strip(line) with kw proc_name args;<br />
&nbsp; &nbsp;switch (lowcase(kw)) {<br />
&nbsp; &nbsp;case &quot;to&quot;:<br />
&nbsp; &nbsp; &nbsp; proc_name = tag_tree_compose_tag(proc_name,&quot;&quot;,&quot;proc&quot;,0,args);<br />
&nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp;case &quot;make&quot;:<br />
&nbsp; &nbsp; &nbsp; proc_name = substr(proc_name,2) :+ &quot;(gvar)&quot;;<br />
&nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;return(0);</div></td></tr></tbody></table></div>
<p>If you want to support tagging local variables as well as globals, you will need to implement the &#8220;list-locals&#8221; callback.  It&#8217;s signature is shown below.  The implementation is quite similar to the &#8220;logo-proc-search&#8221; above, except that rather than working in a start and stop pattern, the list-locals function is just expected to find everything and insert the symbols directly using the tagging API function tag_insert_local2().  I will not detail it&#8217;s implementation in this article &#8212; please take a look at logo.e to learn more.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">void logo_list_locals(int unused_output_view_id, _str unused_filename_p,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _str embedded_ext, int ltf_flags,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int unused_tree_wid, int unused_bitmap_index,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int cur_start_seekpos, int end_seekpos);</div></td></tr></tbody></table></div>
<p><strong>Step 7: Adding support for block matching</strong></p>
<p>For many languages, the default block matching which supports parentheses, braces, brackets, and configurable begin-end pairs is adaquate.  For other languages, you may want to do more.  The prototype hook function for implementing advanced block matching is below.  For an excellent example of how to implement this function, look at ada.e.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int _[lang]_find_matching_word(boolean quiet);</div></td></tr></tbody></table></div>
<p><strong>Step 8: Adding support for syntax expansion</strong></p>
<p>The typical way to add support for syntax expansion is to write commands to handle [space] (syntax expansion) and [enter] (syntax indent).  A simple example of this can be found in modula.e.  By using the &#8220;ext_keys&#8221; event table, your language-specific space and enter handlers will be automatically hooked in.  For this sample, I am not going to write syntax expansion for Logo &#8212; I leave that as an exercise for the reader.</p>
<p><strong>Step 9: Adding support for Context Tagging®</strong></p>
<p>There are six major hook functions necessary to implement support for Context Tagging for a language.  Again, I am not going to implement all of these for Logo, but leave that as an exercise for the reader.  There are numerous examples in the Slick-C® code of how to implement these functions for a variety of languages.  Look at csymbols.e for examples of how they are implemented for a conventional language such as C++.  Look at cobol.e for an example of how they can be implemented for less structured languages where you can have function calls without parens, for example.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int _[lang]_MaybeBuildTagFile(int &amp;amp;tfindex);</div></td></tr></tbody></table></div>
<p>This function is used to automatically build a tag file for language-specific libraries and built-in functions.  You can create a [lang].tagdoc file to document built-in functions.  Look at [slickedit]/builtins/basic.tagdoc or html.tagdoc for some examples of how this is done.  The attached Logo sample attempts to build a tag file for Microsoft Windows Logo.  Note that there is a small problem, because most of the files in their run-time library are extensionless, thus, not recognized immediately as Logo.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int _[lang]_get_expression_info(boolean PossibleOperator, VS_TAG_IDEXP_INFO &amp;amp;idexp_info);</div></td></tr></tbody></table></div>
<p>This function is used to get information about the code at the current buffer location, including the current identifier under the cursor, the expression before the current identifier, and other supplementary information useful to Context Tagging.  If the _[lang]_get_expression_info hook function is not implemented, the editor will use a default implementation which simply returns the current identifier under the cursor and no prefix expression.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int _[lang]_find_context_tags(_str (&amp;amp;errorArgs)[],_str prefixexp,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _str lastid,int lastidstart_offset,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int info_flags,typeless otherinfo,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boolean find_parents,int max_matches,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boolean exact_match,boolean case_sensitive,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int filter_flags=VS_TAGFILTER_ANYTHING,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int context_flags=VS_TAGCONTEXT_ALLOW_locals,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VS_TAG_RETURN_TYPE (&amp;amp;visited):[]=null, int depth=0);</div></td></tr></tbody></table></div>
<p>Find tags matching the identifier at the current cursor position using the information extracted by {@link _[lang]_get_expression_info()}.  This callback is used for symbol navigation, symbol completion, references, and symbol analysis.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int _[lang]_insert_context_tags(_str (&amp;amp;errorArgs)[],<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int editorctl_wid,_str prefixexp,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _str lastid,_str lastid_prefix,int lastidstart_offset,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _str expected_type,int info_flags,typeless otherinfo);</div></td></tr></tbody></table></div>
<p>Insert tags into the list members tree control matching the given identifier and prefix expression.</p>
<p>If the _[lang]_insert_context_tags() or _[lang]_find_context_tags() hook functions are not implemented, the editor will use a default implementation which simply tries to find a symbol matching the current identifier under the cursor, ignoring any prefix expression.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int _[lang]_fcthelp_get_start( _str (&amp;amp;errorArgs)[],<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;boolean OperatorTyped,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;boolean cursorInsideArgumentList,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int &amp;amp;FunctionNameOffset,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int &amp;amp;ArgumentStartOffset,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int &amp;amp;flags );<br />
<br />
int _[lang]_fcthelp_get( _str (&amp;amp;errorArgs)[],<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;VSAUTOCODE_ARG_INFO (&amp;amp;FunctionHelp_list)[],<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;boolean &amp;amp;FunctionHelp_list_changed,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int &amp;amp;FunctionHelp_cursor_x,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_str &amp;amp;FunctionHelp_HelpWord,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int FunctionNameStartOffset,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int flags );</div></td></tr></tbody></table></div>
<p>The _[lang]_fcthelp_get_start() callback is used to find the start of a function call.  This determines quickly whether  or not we are in the context of a function call.  The _[lang]_fcthelp_get() callback then does all the heavy lifting to find the matching functions and parse out their parameter lists and set up all the information in order for the function parameter info feature to display a prototype for the current function.</p>
<p>If the _[lang]_fcthelp_get_start() and _[lang]_fcthelp_get() hook functions are not implemented, the editor will use a default implementation which simply assumes that function parameters are comma-separated lists surrounded by parenthesis.</p>
<p><strong>Step 10: Creating a redistributable hot fix</strong></p>
<p>An easy way to redistribute a set of macros and support files is to package them together using SlickEdit&#8217;s hot fix mechanism.  To package a hot fix for the Logo support all you would have to do is use the create-hotfix command from the SlickEdit command line.  Note that this command requires you to have the Cygwin &#8220;zip&#8221; utility on your path.  You can also construct a hot fix manually by creating your own hotfix.xml manifest and dragging files into a zip file.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">create-hotfix [config]/logo.vlx [slickedit]/macros/logo.e</div></td></tr></tbody></table></div>
<p>The Logo support can be loaded by going to Help &gt; Product Updates &gt; Load Hot Fix&#8230; and pointing it to the addons_se13000_logo.zip file.</p>
<p><strong>Summary</strong></p>
<p>This article gives you an initial glance at how to add support for a new language to SlickEdit.  It does not detail every single aspect of adding language support.  There is still a great deal for you to learn by studying some of the language support code shipped with SlickEdit, such as basic.e, awk.e, ansic.e, pascal.e, modula.e, and fortran.e.</p>
<p><a href="http://www.slickedit.com/images/stories/blog/addon_se1300_logo.zip"> Zip file can be found here</a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F05%2Ftutorial-adding-language-support-to-slickedit%2F';
  addthis_title  = 'Tutorial%3A+Adding+Language+Support+to+SlickEdit';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/05/tutorial-adding-language-support-to-slickedit/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>What Would I Do Without Programming?</title>
		<link>http://blog.slickedit.com/2008/05/what-would-i-do-without-programming/</link>
		<comments>http://blog.slickedit.com/2008/05/what-would-i-do-without-programming/#comments</comments>
		<pubDate>Wed, 07 May 2008 14:01:50 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=231</guid>
		<description><![CDATA[One of my friends lost his job this week. He worked in the chem department of a pharmaceutical company, doing something that went completely over my head while he was explaining it to me. What I got from his description was that it was not the kind of work that&#8217;s particularly easy to find and [...]]]></description>
			<content:encoded><![CDATA[<p>One of my friends lost his job this week. He worked in the chem department of a pharmaceutical company, doing something that went completely over my head while he was explaining it to me. What I got from his description was that it was not the kind of work that&#8217;s particularly easy to find and he&#8217;s really worried about how he&#8217;s going to find another similar position, or what he&#8217;s going to do to stay fresh if he has to take something in the meantime outside of his specialty.</p>
<p>I worried for him while he was telling me about this, and at the same time my mind was half zoning out thinking about my own career. I&#8217;ve been in a similar situation&#8230; it&#8217;s not uncommon for companies to just run out of funding or to have massive sweeping layoffs. The last company that I was at out ran out of money and we all showed up at our office one morning to find movers disassembling our cubes. No prior warning, nothing. Let me tell you, there&#8217;s no cup of coffee that can wake you up quicker than the sight of that.</p>
<p><em>&#8220;I just don&#8217;t know any other company that&#8217;s doing this kind of work,&#8221; he continued.</em></p>
<p>Apparently chem development is not the kind of generic skill that can be easily ported from company to company. I forget sometimes just how lucky I am to have a skill set that is so adaptable. Programming work is so readily available it&#8217;s ridiculous. A quick search on monster.com or dice.com will show that there&#8217;s a constant need for decent programmers. I say decent because you don&#8217;t even have to be a top shelf developer to enjoy this kind of programmer&#8217;s market. Most companies are looking for a programmer that can just get a job done. Now, ideally, I try to look for a lot more than that in a job position, but if it came down to being a worker-bee programmer, the money is still good for those jobs and you get to stay on point with your skills. It&#8217;s not a bad deal, and there&#8217;s always a need for this kind of work.</p>
<p><em>&#8220;The only other pharmaceutical company that has the kind of equipment I work with is two states away, &#8221; he told me.</em></p>
<p>Again, my brain is thinking about this and wondering what things would be like if my work depended on some niche, specialty apparatus. As a programmer, I&#8217;m spoiled by VPNs, remote desktop, portable laptops, 4 gig flash drives and a whole arsenal of gear to help me work from wherever I need to. My friend would have to buy some multi-million dollar research equipment to do his work from home. However, I can connect to my desktop and work from home like I&#8217;m right at my desk. The kind of flexibility that gives me is just incredible. How many people are fortunate enough to be as productive from home as they are at work?</p>
<p><em>&#8220;Without being around the lab every day, my skills are going to fall apart&#8230; this just isn&#8217;t the kind of stuff I can keep up with outside of a workplace,&#8221; he told me. </em></p>
<p>Software developers don&#8217;t need professional work to keep their skills up to date. There are many online communities, sites dedicated to providing samples for all aspects of programming, open source projects, and endless opportunities to stay on the cutting edge of software development. Staying current in this way is something many developers do on top of their normal job anyway. It&#8217;s not very often that I realize that without those resources, it would be much harder to keep up with all of the change and fluctuation that the software world goes through.</p>
<p>Of course, after all of the things my friend had told me I couldn&#8217;t say any of these thoughts I was having. But in the back of my head, I had a real face-to-face moment with the fact that I may be one of the luckiest people in the world simply because I write software. Do I ever worry about losing a job? Sure, everyone does to some degree. Nothing is certain. But I do know that if I ever lost a programming job, I&#8217;d have another within a week. No worries.</p>
<p>What does make me lose sleep some nights is what would happen if software development simply went away. It sounds ridiculous, but it&#8217;s something that I think about from time to time. Industrial workers in the early 20th century probably never imagined being replaced by robots, but it&#8217;s happened on a large scale.  Without software development, I would be in a lot of trouble. I wouldn&#8217;t be able to work from home if I needed to. I might have to do something 8 hours a day that I didn&#8217;t enjoy doing. I might have to wear a suit.</p>
<p>Even worse, I might have to take a job that didn&#8217;t allow me any creative thought. That would be worse than the suit. To have to work at a job where I performed some task over and over, or had some responsibilities that didn&#8217;t allow my mind to wonder &#8220;What if?&#8221; would kill a small part of me. This may be the biggest perk of all in this career choice of software development&#8230; the freedom of creativity.</p>
<p>I&#8217;m going to spend the better part of today reminding myself of just how lucky I am that there is such a thing as computer programming and that I just happen to absolutely love doing it. When I think about what my life would be without programming, I realize that the stars have aligned in some miraculous way for me.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F05%2Fwhat-would-i-do-without-programming%2F';
  addthis_title  = 'What+Would+I+Do+Without+Programming%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/05/what-would-i-do-without-programming/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>BASIC and the Rubik&#8217;s Cube</title>
		<link>http://blog.slickedit.com/2008/04/basic-and-the-rubiks-cube/</link>
		<comments>http://blog.slickedit.com/2008/04/basic-and-the-rubiks-cube/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 13:09:17 +0000</pubDate>
		<dc:creator>David O</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=230</guid>
		<description><![CDATA[Remember when the Rubik&#8217;s Cube was still new and BASIC was cutting edge? Well, for that early generation of geeks, of which I was surely a member, it was unavoidable. You just had to write your own BASIC program to solve the Rubik&#8217;s Cube. I know there are other old programmers out there who have [...]]]></description>
			<content:encoded><![CDATA[<p>Remember when the Rubik&#8217;s Cube was still new and BASIC was cutting edge? Well, for that early generation of geeks, of which I was surely a member, it was unavoidable. You just had to write your own BASIC program to solve the Rubik&#8217;s Cube. I know there are other old programmers out there who have also done his because I&#8217;ve met at least two. I&#8217; love to hear about anyone&#8217;s attempts to solve the Cube on simple (pre-Windows) computers, no matter what the language or machine.</p>
<p>Here&#8217;s my story.</p>
<p>It all started a &#8220;few&#8221; years ago to when I was in high school. The Rubik&#8217;s Cube popularity had just peaked and our school was still just getting computers. I forget the exact specifications of the machine, but I think it was a <a href="http://oldcomputers.net/trs80iii.html">TRS-80 Model III</a> with about 16K of RAM and no color. I spent a lot of time on that machine because it was old even then and usually free. Most others wanting to use the newer Apples that had color. Wow.</p>
<p>So how do you represent a colored cube on a monochrome display with at best crude graphics? I used letters for the different colors (B = blue, R = red, G = green, O = orange, Y = yellow, W = white) and unwrapped it on the screen. (Fortunately none of the colors started with the same letter.) You would have something like this for a completed cube:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;pre&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp;O O O <br />
&nbsp; &nbsp; &nbsp; &nbsp;O O O <br />
&nbsp; &nbsp; &nbsp; &nbsp;O O O <br />
&nbsp;Y Y Y B B B G G G <br />
&nbsp;Y Y Y B B B G G G <br />
&nbsp;Y Y Y B B B G G G <br />
&nbsp; &nbsp; &nbsp; &nbsp;R R R <br />
&nbsp; &nbsp; &nbsp; &nbsp;R R R <br />
&nbsp; &nbsp; &nbsp; &nbsp;R R R <br />
&nbsp; &nbsp; &nbsp; &nbsp;W W W <br />
&nbsp; &nbsp; &nbsp; &nbsp;W W W <br />
&nbsp; &nbsp; &nbsp; &nbsp;W W W&lt;/pre&gt;</div></td></tr></tbody></table></div>
<p>After typing in your sequence of letters representing the colors (You only had one chance. One mistake, and you had to start over.), the program dumped instructions to the printer (&#8220;Red Right&#8221; &#8220;Green Left&#8221; &#8220;White Around&#8221; &#8220;Blue Left&#8221; etc.) while the arrangement of letters on the screen was updated at each step. Needless to say, it was virtually impossible to take a mixed-up cube, type it&#8217;s arrangement into the TRS-80, then follow the instructions from the printout and actually solve the puzzle, but I know a few classmates certainly did try. I really should have made it pause after each turn, so you could check for mistakes as you went.</p>
<p>Here are a few things I remember about the program.</p>
<ol>
<li>I knew the limits of the machine&#8217;s memory so made use of the space compression codes. The TRS-80&#8242;s BASIC interpreter used the character values from 0xc0 and up to represent sequences of blanks. One byte could be used to display up to 64 spaces. My <em>data structure</em> was one string holding just the letters and space compression codes. I updated the display by printing just this one string.</li>
<li>Each of the 18 different moves would change the positions of 20 letters on the display or 20 characters in my string data structure. These character positions were stored in strings of 20 characters. This was much more compact than reading DATA statements. But you couldn&#8217;t type these strings with the keyboard because some of their values needed to be higher than the ASCII value of &#8216;Z&#8217;. So I first wrote some code that found the memory location of the array of strings and then used POKE to write the proper values directly into the memory of the program&#8217;s instructions. This trick actually made the program manipulated itself.<br />
I don&#8217;t really remember why I did it this way. It did make the program shorter and the code simpler in some places, but I doubt that was the real reason. I think I did it just because I could. Plus is looked cool when you listed the program on the screen. It would beep, clear screen, and show graphical characters inside your program listing. This was a great way to show off to the older junior and seniors when they came in and kicked you off the computer so they could write their boring programs to convert Celsius to Fahrenheit for their computer class. I&#8217;m sure they all hated me.</li>
<li>Finally, it was my own algorithm. There were a slew books out then to teach you to solve the Cube, but none of that cheating for me. Of course, that also meant that the list of &#8220;Yellow Left&#8221; &#8220;Orange Around&#8221; &#8220;Green Right&#8221; &#8220;White Left&#8221; etc. probably went on much longer than needed. But that didn&#8217;t matter, because you were never going to solve an actual Cube with the program anyway. It was all just a young kid&#8217;s way to use up free period.</li>
</ol>
<p>Best program I ever wrote!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F04%2Fbasic-and-the-rubiks-cube%2F';
  addthis_title  = 'BASIC+and+the+Rubik%26%238217%3Bs+Cube';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/04/basic-and-the-rubiks-cube/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tom Brady on Software Management</title>
		<link>http://blog.slickedit.com/2008/04/tom-brady-on-software-management/</link>
		<comments>http://blog.slickedit.com/2008/04/tom-brady-on-software-management/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 13:48:00 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=229</guid>
		<description><![CDATA[Management&#8230; the term alone is enough to send shivers down most developers backs. It evokes visions of meetings, Power Point presentations and schedules. Maybe even a Dilbert comic or two. Between contract work and full time work, I&#8217;ve worked at a lot of places. There have only been a few that I can say I [...]]]></description>
			<content:encoded><![CDATA[<p>Management&#8230; the term alone is enough to send shivers down most developers backs. It evokes visions of meetings, Power Point presentations and schedules. Maybe even a <a href="http://www.aquezada.com/staff/julian/journal/wp-content/uploads/2006/02/dilbert2006915890209.gif">Dilbert comic</a> or two.</p>
<p>Between contract work and full time work, I&#8217;ve worked at a lot of places. There have only been a few that I can say I really loved. Interestingly, the characteristic that all of those places had in common wasn&#8217;t interesting work or free food or a ping-pong table. It was my managers.</p>
<p>There are good managers and bad managers, and most programmers can say that they&#8217;ve worked with a representative from both groups at least once. However, there&#8217;s also a class of top-shelf managers, and they&#8217;re the ones I&#8217;m talking about here. They have the ability to lead a team, and at the same time make you feel like you&#8217;re one of the most important people on it.</p>
<p><strong>Quarterback vs. software manager<br />
</strong></p>
<p>Whether you like him or not, most of us (at least in the States) know who <a href="http://en.wikipedia.org/wiki/Tom_Brady">Tom Brady</a> is. I wouldn&#8217;t normally look at him, or any sports star, and see a clear comparison to the world of software development. However, I recently read an article in <a href="http://sportsillustrated.cnn.com/2007/football/nfl/12/28/pats.tucker/index.html">Sports Illustrated</a> by <a href="http://www.redskins.com/team/profile.jsp?id=2443">Ross Tucker</a> about his time spent playing on the Patriots with Brady:</p>
<blockquote><p>During my time in New England I worked as a backup lineman and often had to snap to Brady while playing center. In spite of all of the other chaos that he had to sort through, he always found the time to look me squarely in the eye and say, &#8220;C&#8217;mon Ross, me and you, let&#8217;s get a great snap first.&#8221;</p>
<p>I never wanted to snap a ball so well in my life.</p>
<p>I was a veteran in my fifth and sixth years in the league while in New England and I had started over 20 games, but Brady&#8217;s ability to single me out and make me feel important for the success of the play was unlike anything I had experienced.</p></blockquote>
<p>That&#8217;s powerful stuff. I instantly recognized it as the common characteristic of the jobs I&#8217;ve loved working at&#8230; managers that practiced the same philosophy as Tom Brady. After reading this, I realized that the need to be recognized as an important part of the team is something universal, regardless of your job or your level of experience. It&#8217;s about taking people who work hard and finding ways to make them feel important to the team effort. That includes contractors, junior developers, everyone on the team.</p>
<p>So managers, listen up! Yes, programmers like free food. We like the latest and fastest computers. We like ping-pong and pool tables and a fun atmosphere to work in. But most of all, we like to hear that our ideas are important&#8230; that our work matters. So often, we are just looked at as the staff that makes the requirements happen. Sometimes it can seem like we are simply a means to an end, but we are so much more than that. Software developers are creative writers; the designers that make your applications work, the same applications that run your business.</p>
<p>If you give a development team a set of requirements, you hope to get an application that meets those requirements. However, when you let the developers participate in the creative process, and make them feel like their contribution is needed, you&#8217;ll probably find a development team that will think up and implement features you couldn&#8217;t even dream of. All it takes is trust, and an occasional reminder to development that they are an essential part of the process.</p>
<p>The free pizza doesn&#8217;t hurt either&#8230;</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F04%2Ftom-brady-on-software-management%2F';
  addthis_title  = 'Tom+Brady+on+Software+Management';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/04/tom-brady-on-software-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding Misery in Another Programmer&#8217;s Success</title>
		<link>http://blog.slickedit.com/2008/04/finding-misery-in-another-programmers-success/</link>
		<comments>http://blog.slickedit.com/2008/04/finding-misery-in-another-programmers-success/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 13:46:05 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=224</guid>
		<description><![CDATA[I was introduced to the word schadenfreude by an episode of the Simpsons, &#8220;When Flanders Failed&#8220;. It&#8217;s a german word that means &#8220;pleasure from misfortune&#8221;. In this episode, Homer finds happiness in watching Flanders&#8217; Leftorium shop go out of business. The Wikipedia reference to it says that the opposite meaning of schadenfreude would be &#8220;happiness [...]]]></description>
			<content:encoded><![CDATA[<p>I was introduced to the word <em>schadenfreude</em> by an episode of the Simpsons, &#8220;<a href="http://en.wikipedia.org/wiki/When_Flanders_Failed">When Flanders Failed</a>&#8220;. It&#8217;s a german word that means &#8220;pleasure from misfortune&#8221;. In this episode, Homer finds happiness in watching Flanders&#8217; Leftorium shop go out of business. The <a href="http://en.wikipedia.org/wiki/Schadenfreude">Wikipedia reference to it</a> says that the opposite meaning of schadenfreude would be &#8220;happiness in another&#8217;s good fortune,&#8221; but I think that the opposite should really mean &#8220;misery in another&#8217;s success&#8221;. This sentiment has a long, unfortunate place in software development.</p>
<p><img width="200" src="http://upload.wikimedia.org/wikipedia/en/thumb/0/0c/Simpsons_7F23.png/200px-Simpsons_7F23.png" height="158" /></p>
<p><strong>My first job as &#8220;the VB guy&#8221;</strong></p>
<p>I graduated with a masters in CS, and my research involved working with the Air Force on a neural network algorithm they were implementing. This was all done in C++ and by the time I graduated, I was proficient in the language. My first job was at a startup with 3 other people, where we needed to get something done very quickly and we used VB4 (the latest VB at the time) to write the entire thing. I had never worked in VB before, but I picked it up quickly and learned how to push it to the edge of what it could do, which was a lot.</p>
<p>I remember being blown away by how fast we could test ideas and write new parts of the system, compared to the work I had done in C++ before. VB didn&#8217;t have inheritance and of course it had its own quirky syntax, but the power of how fast you could get things done was amazing.</p>
<p>That project went extremely well and we got an enormous bid to continue our work. At that point, I was firmly rooted in my place as a developer of the initial product and would continue developing it. However, we needed to start writing our own device drivers for new peripherals that we needed to interface with. In came the C++ programmers, and shortly after, I became known not as the lead programmer of the main product, but rather as &#8220;the VB guy&#8221;. As the VB guy, I was always pretty far outside of the C++ clique, even though a year before I had considered myself a proficient C++ programmer.</p>
<p>It&#8217;s a scar I think I still carry to this day.</p>
<p><strong>Any idiot can program [<em>insert high level language</em>]!<br />
</strong></p>
<p>Anyone who has worked for a significant amount of time in VB, Ruby, Perl, or even C# and Java probably knows where I&#8217;m coming from. There is a large number of people who hate these languages purely because they allow newer, less experienced programmers to develop working code quickly. You don&#8217;t need to know what a pointer is to program any of these languages. You don&#8217;t need to know how memory is allocated for new objects, and for the most part you don&#8217;t have to be conscious of freeing it either. You don&#8217;t need to understand a lick of the Win32 API to make a working client application in VB. The list goes on and on and on&#8230;</p>
<p>There are also programmers who have battle wounds from debugging memory leaks from unfreed pointers. There are those that learned to program Windows applications from <a href="http://www.amazon.com/Programming-Windows-Fifth-Charles-Petzold/dp/157231995X/ref=pd_bbs_sr_2?ie=UTF8&amp;s=books&amp;qid=1206534956&amp;sr=8-2">Petzold&#8217;s book</a> where you wrote the WinMain function and the message loop by hand. There are programmers who learned COM by hand writing their own implementation of QueryInterface and doing their own reference counting. Many of these programmers watch in horror as new, inexperienced programmers get the same end result in a small fraction of the time because their higher level language wraps up what they&#8217;ve spent years mastering, and makes it &#8220;just work&#8221;.</p>
<p><strong>Check your ego</strong></p>
<p>I believe that&#8217;s where so much of today&#8217;s language bitterness comes from. All programmers strive for higher levels of abstraction and functionality, whether it&#8217;s through libraries or frameworks. However, there&#8217;s a level at which the programmers who understand what happens internally start to despise the programmers that make use of that abstraction without understanding those internals. It&#8217;s a smug, arrogant attitude that makes a developer believe that they are a better programmer, or that their language is better, because they work at a lower level. Unless you are writing your code in 1s and 0s, there is always a huge amount of &#8220;scaffolding&#8221; underneath you that you just rely on.</p>
<p>If you&#8217;re one of these people, get over yourself. There are both great and terrible programmers in every language. There are brilliant VB programmers and there are frighteningly bad C++ programmers out there. If you resent beginner programmers being able to write apps quickly in VB, or put together a web site quickly in Rails, then you need to seriously rethink what the point of programming is in the first place. Their success should be your happiness.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F04%2Ffinding-misery-in-another-programmers-success%2F';
  addthis_title  = 'Finding+Misery+in+Another+Programmer%26%238217%3Bs+Success';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/04/finding-misery-in-another-programmers-success/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Coding tips:  Generational Naming</title>
		<link>http://blog.slickedit.com/2008/04/coding-tips-generational-naming/</link>
		<comments>http://blog.slickedit.com/2008/04/coding-tips-generational-naming/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 12:42:34 +0000</pubDate>
		<dc:creator>Dennis B</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=228</guid>
		<description><![CDATA[All too often, you need to make a new version of a function that does something a little bit different than the original function. Perhaps it just takes a new argument or removes an unused one. Maybe it&#8217;s a wrapper around the original function that does some more cool stuff. Furthermore, for backwards compatibility, you [...]]]></description>
			<content:encoded><![CDATA[<p>All too often, you need to make a new version of a function that does something a little bit different than the original function. Perhaps it just takes a new argument or removes an unused one. Maybe it&#8217;s a wrapper around the original function that does some more cool stuff. Furthermore, for backwards compatibility, you have to leave the original version of the function around, semantics unchanged.</p>
<p>This is a pretty common programming scenario which can become quite unnerving when you discover that <em>the original function was named perfectly.</em> Of course, you can&#8217;t reuse that name because you are programming to a C ABI, or the signature is not different enough to allow you to overload the function.</p>
<p>So, you spend the next half hour of your day figuring out a name for this new function which makes sense. Here is one example, the original function:</p>
<pre><font color="#0000ff">   int findMatches(string regex, int flags);
</font></pre>
<p>And the new function changes the meaning of one of the flags. So you name it:</p>
<pre><font color="#0000ff">   int findMatchesWithNewFlags(string regex, int flags);
</font></pre>
<p>But wait, that&#8217;s a pretty stupid name, and rather verbose. So you try to capture what is really different about the new function.</p>
<pre><font color="#0000ff">   int findMatchesOldReentrantFlagIsReverseFlag(string regex, int flags);
</font></pre>
<p>Still pretty verbose, and if we change the function again in the future, this will just get silly. OK, how about this:</p>
<pre><font color="#0000ff">   int findMatchesWithReverseOption(string regex, int flags);
</font></pre>
<p>This is better, but still verbose. There has to be a better way.</p>
<p><strong>Generational Naming Conventions</strong></p>
<p>Well, on this day of April 1, 2008, let me share with you the dearest naming convention to my heart, generational naming. In this paradigm, we recognize that the original name was perfect, so all we want to capture in the name of the new function is that it is newer. You do this by adding a &#8220;2&#8243; to the end of the name.</p>
<pre><font color="#0000ff">   int findMatches2(string regex, int flags);
</font></pre>
<p>When you need to again change findMatches(), you create the next generation:</p>
<pre><font color="#0000ff">   int findMatches3(string regex, int flags);
</font></pre>
<p><strong>Extended Naming</strong></p>
<p>There are several less powerful variants of generational naming. For example extended naming, where you add &#8220;Ex&#8221; to the new function. This is in fact, a common practice at another large software company located in</p>
<pre><font color="#0000ff">   int findMatchesEx(string regex, int flags);
</font></pre>
<p>And then there is &#8220;new naming&#8221;:</p>
<pre><font color="#0000ff">   int newFindMatches(string regex, int flags);
</font></pre>
<p>Which can actually be extended twice over:</p>
<pre><font color="#0000ff">   int newerFindMatches(string regex, int flags);
   int newestFindMatches(string regex, int flags);  // buck stops here
</font></pre>
<p><strong>Conclusion</strong></p>
<p>The conclusion is simple. You do not need to be smart or clever to write code, you just need to know how to count.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F04%2Fcoding-tips-generational-naming%2F';
  addthis_title  = 'Coding+tips%3A++Generational+Naming';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/04/coding-tips-generational-naming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Next Programming Skill You Should Learn</title>
		<link>http://blog.slickedit.com/2008/03/the-next-programming-skill-you-should-learn/</link>
		<comments>http://blog.slickedit.com/2008/03/the-next-programming-skill-you-should-learn/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 15:29:12 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=223</guid>
		<description><![CDATA[Change and growth are faster than ever in software these days. There&#8217;s Silverlight, LINQ and WPF from Microsoft. There&#8217;s AJAX, REST and Rails 2.0 in the web development world. Java has JavaFX. There used to be a time when you had to pick one language and run with it because it was just too overwhelming [...]]]></description>
			<content:encoded><![CDATA[<p>Change and growth are faster than ever in software these days. There&#8217;s Silverlight, LINQ and WPF from Microsoft. There&#8217;s AJAX, REST and Rails 2.0 in the web development world. Java has JavaFX. There used to be a time when you had to pick one language and run with it because it was just too overwhelming to master more than one. Now it&#8217;s impossible to keep up with new developments within even a single language. This has many developers scrambling to figure out what to learn next. No one wants to invest countless hours in a losing technology&#8230; you want to learn something that will be useful in the long run. I have just the skill for you, and it doesn&#8217;t matter what language you work with.</p>
<p>Learn to write well. [<a href="http://www.scotthackett.com/slick_edit/cricket.wav">*</a>]</p>
<p>&#8220;But that&#8217;s not a programming skill!&#8221; you&#8217;re probably saying. Or maybe you&#8217;re disappointed because you thought I was going to be talking about the very latest cutting-edge API you can&#8217;t live without. Good writing skill is probably one of the most useful talents you can develop as a software engineer, and ignoring it is one of the biggest mistakes most programmers make.</p>
<p><strong>Working in a cave<br />
</strong></p>
<p>I used to work with a programmer who we jokingly referred to as a &#8220;walking MSDN&#8221;. He knew all the Win32 APIs, he could tell you the int values of const definitions and could enumerate the parameter lists to functions overloaded 30 times over. As a programmer, when given an assignment, he would <a href="http://blog.slickedit.com/?p=207">go into his cave</a>, hammer out a solution and would re-emerge from his cave with something that worked. I mean that in the most serious way&#8230; he would hammer his code into submission until it worked. There was no such thing as elegant code to him; it worked or it didn&#8217;t.</p>
<p>His manager both loved and feared him because he would do everything required on time, but he had no idea what happened in that cave. There was no visibility at all into what he was doing, and his manager had to blindly rely on the fact that he had a history of getting stuff done on time.</p>
<p>Programmers loved and feared him because he was incredibly knowledgeable and could answer any question about how this or that API worked. But whenever someone had to get inside his code, it was a pure mystery. There was no documentation, no models, no code comments&#8230; nothing but the raw code itself. For mister MSDN, this was no problem, because it was all in his head. For everyone else, it was like being lost in a big city with no map.</p>
<p>Was he a good programmer? Most people that worked with him would say yes&#8230; he was technically proficient and met his deadlines. But most of those same people would also say that they had a very difficult time working with him. That element of fear that he generated was a direct result of not being able, or willing, to communicate. He couldn&#8217;t communicate his plans or designs to other programmers. He couldn&#8217;t communicate his status with his managers. He couldn&#8217;t communicate his interfaces with other teams. Eventually when he left, his code left a wake of terror felt by those that had to pick up where he left off.</p>
<p><strong>The lifespan of a tech skill</strong></p>
<p>Technologies come and go. Seven or so years ago, I felt like I was completely on top of my game when it came to programming technology, at least in the Microsoft world. I had a very deep understanding of COM and ATL, thanks to <a href="http://www.amazon.com/ATL-Internals-Addison-Wesley-Object-Technology/dp/0201695898/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1205862823&amp;sr=8-1">Chris Sells, Brent Rector</a> and <a href="http://www.amazon.com/Professional-Atl-Programming-Richard-Grimes/dp/B0000B0T0K/ref=sr_1_3?ie=UTF8&amp;s=books&amp;qid=1205929348&amp;sr=1-3">Richard Grimes</a>, and I coupled that with VB6 on the front end. This was a really potent combination and I thought I&#8217;d be working with that for years and years. But, as with most technical skills, it didn&#8217;t last long&#8230; .Net came along a year later, ATL became outdated and VB6 just disappeared into the sunset. Now that I&#8217;ve mastered C#, I find that I haven&#8217;t even touched the new stuff in .Net 3.5. The point is, no matter what technology you learn, with very few exceptions, it will disappear or be overshadowed by newer technologies (and probably sooner than later).</p>
<p>Writing skills will last you a lifetime, though. You will always benefit from it, regardless of what language or technology your use, or whether you&#8217;re even a programmer or not. Good writing skills are universal and will never be replaced.</p>
<p><strong>The golden rule of documenting software design</strong></p>
<p>Try to document whatever you are working on. It doesn&#8217;t have to be the worlds most perfect UML and you don&#8217;t need an expensive tool to do it. In fact, Wordpad and Paint are sufficient, and don&#8217;t tell me you don&#8217;t have those. <a href="http://blog.slickedit.com/?p=43">Write in a way that best expresses your intent and your thought process in coming to the design decisions you did</a>. I have a golden rule of documenting software design:</p>
<blockquote><p><em><strong>Describe your design to others as you would have others describe their design to you.</strong></em></p></blockquote>
<p>When you spend the time to do this, you&#8217;ll find that many benefits will follow. You&#8217;ll get feedback from others that may have tried to solve a similar problem and have insight you may not have thought of. You&#8217;ll leave a clear trail to follow for those that work on the code after you. Most importantly, you&#8217;ll shed light on your work, which everyone who depends on your work will appreciate. Even if no one else reads what you write, you&#8217;ll still have worked through problems in your head that can only lead to better design in the long run. <em>There is no downside to documenting your designs. </em></p>
<p>If that wasn&#8217;t enough, consider the fact that someday you may be looking for another programming job. You&#8217;ll sit down with other developers and managers in an interview and try to describe how great your technical abilities are. You are now one of the vast sea of programmers trying to get that job. With your resume alone, a company has only your answers during the interview to base their decision on. With your documentation in hand, though, you can show them in full detail the type of work you&#8217;ve done and give them deeper insight into your thought process than they could ever get from interview questions alone. Your documentation serves as a body of work that travels with you, long after you&#8217;ve stopped working on this or that code, and speaks for your experience.</p>
<p>Of course, these skills won&#8217;t write code for you. But think about how much time you&#8217;ve devoted to learning programming based skills. Think about how many books you&#8217;ve purchased and read about programming. It&#8217;s a huge investment in time and money to keep up with. The next time you have some free cycles to sit down and pick up something new, consider skipping the software development section of the bookstore and pick up a book about technical writing. Here are some good books on this subject:</p>
<ul>
<li><a href="http://www.amazon.com/Writing-White-Papers-Capture-Readers/dp/0977716937/ref=tag_dpp_lp_edpp_ttl_in">Writing White Papers: How to Capture Readers and Keep Them Engaged</a></li>
<li><a href="http://www.amazon.com/Developing-Quality-Technical-Information-Information/dp/0131477498/ref=tag_dpp_lp_edpp_ttl_in">Developing Quality Technical Information: A Handbook for Writers and Editors</a></li>
<li><a href="http://www.amazon.com/Documenting-Software-Architectures-Beyond-Engineering/dp/0201703726/ref=sr_1_4?ie=UTF8&amp;s=books&amp;qid=1205864346&amp;sr=1-4">Documenting Software Architectures: Views and Beyond</a></li>
</ul>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F03%2Fthe-next-programming-skill-you-should-learn%2F';
  addthis_title  = 'The+Next+Programming+Skill+You+Should+Learn';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/03/the-next-programming-skill-you-should-learn/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
<enclosure url="http://www.scotthackett.com/slick_edit/cricket.wav" length="46124" type="audio/wav" />
		</item>
		<item>
		<title>An Open Letter to My Software</title>
		<link>http://blog.slickedit.com/2008/03/an-open-letter-to-my-software/</link>
		<comments>http://blog.slickedit.com/2008/03/an-open-letter-to-my-software/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 13:37:03 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=220</guid>
		<description><![CDATA[You and I have been through a lot together. It doesn&#8217;t seem like that long ago when I was sitting and programming, nothing really important, and I said to myself, &#8220;Wouldn&#8217;t it be really cool if&#8230;?&#8221; And here we are now, only a short time from your gold build. I feel like I&#8217;ve gotten to [...]]]></description>
			<content:encoded><![CDATA[<p>You and I have been through a lot together. It doesn&#8217;t seem like that long ago when I was sitting and programming, nothing really important, and I said to myself, &#8220;Wouldn&#8217;t it be really cool if&#8230;?&#8221; And here we are now, only a short time from your gold build.</p>
<p>I feel like I&#8217;ve gotten to know you, that you&#8217;re not just a program or a set of files. You have a personality that I spend most of my day with, sometimes more than the people I work with and even my own family. We have our ups and downs. We&#8217;ve had days where we hated each other, and you were so stubborn that I wished I had never written you in the first place. But we also had times that made me feel like one of the proudest developers in the world. We learned a lot together and sometimes your bad behavior taught me something new about the way I write software. At other times you&#8217;ve amazed me with the things you&#8217;re capable of doing, producing results that were useful in ways I&#8217;d never originally intended, as if you were secretly developing yourself while I wasn&#8217;t looking.</p>
<p>There are going to be users out there and most of them are great people who will be excited to buy you and work with you. But there will also be some that won&#8217;t be so nice, and they may say or blog really bad things about you. You may be installed into environments where you have no clue. People aren&#8217;t going to be so gentle with you in the real world. They won&#8217;t be forgiving when you make mistakes and won&#8217;t give you the soft restart that you&#8217;re used to when you get debugged. I&#8217;ve tried my best to give you everything you need to avoid those situations and handle them gracefully, but sometimes unexpected things happen. Just remember all the good things you can do and let the bad stuff go.</p>
<p>We&#8217;ll be seeing each other from time to time, during bug fixes and maintenance, but it won&#8217;t be like this last development cycle. I hope I&#8217;ll be able to keep improving you and making you the best you can be, but in reality I&#8217;ll have new features to work on and a schedule that only allows us so much time together. I know my new features&#8230; they&#8217;ve started just like you did, some of them as ideas that came to me while I was writing you. But no matter what features I may work on in the future, the time we&#8217;ve spent in development together will always be unique and I&#8217;ll always remember it, just as I remember the features and programs that came before you.</p>
<p>This will be a milestone build and release and I can&#8217;t wait for your introduction to the world. Remember that I believe in you more than you know. Now get out there and show everybody what you can do!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F03%2Fan-open-letter-to-my-software%2F';
  addthis_title  = 'An+Open+Letter+to+My+Software';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/03/an-open-letter-to-my-software/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Plug-in Extensibility Through Reflection in .Net and Java</title>
		<link>http://blog.slickedit.com/2008/02/plug-in-extensibility-through-reflection-in-net-and-java/</link>
		<comments>http://blog.slickedit.com/2008/02/plug-in-extensibility-through-reflection-in-net-and-java/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 17:08:45 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=217</guid>
		<description><![CDATA[Extensibility is very important to me. I like to work with architectures that allow you to write classes that implement an interface, then have those classes be &#8220;discovered&#8221; and instantiated into working extensions of the existing system. Maybe that&#8217;s why I love working on plug-ins for Visual Studio&#8230; it&#8217;s fun to get into the guts [...]]]></description>
			<content:encoded><![CDATA[<p>Extensibility is very important to me. I like to work with architectures that allow you to write classes that implement an interface, then have those classes be &#8220;discovered&#8221; and instantiated into working extensions of the existing system. Maybe that&#8217;s why I love working on plug-ins for Visual Studio&#8230; it&#8217;s fun to get into the guts of an application and test the limits of what you can do within it. In addition, I love &#8220;object discovery&#8221;, which to me is what plugging in your code is all about. I want to be able to write a plug-in, put the compiled assembly in a specific directory and have it be found automatically.</p>
<p>When it comes to extensibility, SlickEdit benefits from the fact that it is largely written in macro code, which can easily be loaded dynamically. Unfortunately, in our Tools product, extensibility is a challenge because all of our product is compiled code. Two of the features of .Net that I rely on to &#8220;discover&#8221; objects that plug into our architecture are <em>reflection</em> and <em>dynamic loading</em>. Reflection, a term borrowed from Java, refers to the ability to dynamically load an assembly (a .Net or Java compiled binary) and query that assembly&#8217;s metadata about the types it contains. In other words, if I&#8217;m looking for a class called <em>Foo</em>, I can load any .Net assembly and traverse its types looking for the <em>Foo</em> class.</p>
<p><img src="http://www.scotthackett.com/pics/ContainsFoo.jpg" /> [i]</p>
<p>Looking for a specific class is pointless for our purposes, though, because we want to <strong>dynamically discover</strong> unknown objects that fit the description of a plug-in type. To do this, we&#8217;ll define an interface called <em>IDoSomething</em>. <em>IDoSomething</em> defines a &#8220;get&#8221; property called <strong>Name </strong>and an method called <strong>DoSomething()</strong>.</p>
<p><img src="http://www.scotthackett.com/pics/IDoSomething.jpg" /></p>
<p>Any class can implement <em>IDoSomething</em>. One of the beauties of interfaces is that they do not have to obey the law of single inheritance, which states that a class may only derive from at most one other class. Classes in .Net and Java may implement as many interfaces as they choose. That makes interfaces very good candidates for defining the contract between a plug-in class and the framework that creates an object of it. Instead of using reflection to find a specific class, we can use reflection to find classes that implement a specific interface. Therefore, if we scan [n] assemblies and find two classes that implement <em>IDoSomething</em>, we have found two types that are candidate plug-ins.</p>
<p><img src="http://www.scotthackett.com/pics/IDoSomethingImplementations.jpg" /></p>
<p><img src="http://www.scotthackett.com/pics/ContainsIDoSomething.jpg" /></p>
<p>Our main application does not need to have ever seen these types before because we aren&#8217;t binding to these objects through their <strong>class</strong> interface, we&#8217;re binding to them through their <em>IDoSomething</em> interface. Our main application will never know the real identity of these two discovered objects, it only knows them by their <em>IDoSomething</em> interface.</p>
<p>This workflow of dynamic object discovery allows us to set up a pattern for plug-in types. We can create a factory class, called PluginFactory, that scans a set of assemblies for objects implementing a specific interface (<em>IDoSomething</em> in this case).</p>
<p><img src="http://www.scotthackett.com/pics/PluginFactory.jpg" /></p>
<p>The main application will create the plug-in factory and will determine which assemblies should be scanned for plug-ins (this is usually all assemblies in some pre-configured directory). The scanning for plug-ins will then be initiated. During the scanning process, when it it finds a class that implements <em>IDoSomething</em>, the plug-in factory object will do the following:</p>
<ol>
<li>Create an object of it</li>
<li>Get the object&#8217;s <em>logical</em> name via the <strong>Name</strong> property</li>
<li>Get the object&#8217;s type</li>
<li>Hash that type using the <strong>Name</strong> property value</li>
</ol>
<p><img src="http://www.scotthackett.com/pics/ScanInteraction.jpg" /><br />
Once the scan is done, our application can query the factory object for the list of logical names reported by the objects discovered during reflection. The UI can be populated with this list, either as a combo box or a dynamic menu, to show all available plug-ins.</p>
<p><img src="http://www.scotthackett.com/pics/PopulateUI.jpg" /></p>
<p>When the user selects a plug-in item from this list, the application uses the name to ask the factory for an instance of the object it represents. The factory provides a function called <strong>CreatePlugin(string)</strong> that takes the logical name of a plug-in type and finds that type in the hash table created during the initial reflection scan. Once the type is found, the factory uses <em>Activator.CreateInstance()</em> method in .Net, or the <em>Class.newInstance()</em> method in Java, to create an instance of that object. The main application has no idea what type of object it has&#8230; it only knows that that object implements <em>IDoSomething</em>. The main application can now call <strong>DoSomething()</strong> on that object and the object will do its specific task.</p>
<p><img src="http://www.scotthackett.com/pics/PluginCreation.jpg" /></p>
<p>This implementation is very simplistic. However, the concept, like all patterns, is universal. We can even make the factory class generic by implementing it as a generic class in .Net, or a template in Java. We can now create a factory to scan assemblies for any interface. The one dependency is that the interface supports a &#8220;get&#8221; <strong>Name</strong> property, since we rely on that property in the reflection scan.</p>
<p><img src="http://www.scotthackett.com/pics/GenericPluginFactory.jpg" /></p>
<p>The plug-in factory approach can also lead to trouble, because it opens a doorway to the system which can be exploited by plug-in objects that behave maliciously. For instance, imagine an object whose <strong>DoSomething()</strong> implementation was to format the <strong>C:\ </strong>drive. It&#8217;s an extreme example, but a serious case to consider.</p>
<p>Reflection and dynamic discovery can be a powerful way to make an application or architecture more flexible. Flexibility and extensibility are key components to any software architecture. In my next blog post, I&#8217;ll expand on this technique to describe how to implement UI configuration of dynamically discovered objects.</p>
<hr />[i] <a href="http://en.wikipedia.org/wiki/Shmoo">Shmoo</a> appeared in Al Capp&#8217;s newspaper comic strip Li&#8217;l Abner and is a registered trademark of Capp Enterprises, Inc..</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F02%2Fplug-in-extensibility-through-reflection-in-net-and-java%2F';
  addthis_title  = 'Plug-in+Extensibility+Through+Reflection+in+.Net+and+Java';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/02/plug-in-extensibility-through-reflection-in-net-and-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Help With MSDN Help</title>
		<link>http://blog.slickedit.com/2008/02/help-with-msdn-help/</link>
		<comments>http://blog.slickedit.com/2008/02/help-with-msdn-help/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 17:21:04 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=216</guid>
		<description><![CDATA[F1&#8230; it&#8217;s possibly the most feared key on my keyboard when writing code in Visual Studio. At best, it&#8217;s going to bring up MSDN help, aka dexplore.exe. That means that I&#8217;m in for a very, very long wait. Startup time is 3 minutes on average, and I&#8217;m an Athlon 64 dual core @ 2 GHz [...]]]></description>
			<content:encoded><![CDATA[<p>F1&#8230; it&#8217;s possibly the most feared key on my keyboard when writing code in Visual Studio. At best, it&#8217;s going to bring up MSDN help, aka <strong>dexplore.exe</strong>. That means that I&#8217;m in for a very, very long wait. Startup time is 3 minutes on average, and I&#8217;m an Athlon 64 dual core @ 2 GHz with 1 GB RAM. The worst case scenario is that something has updated MSDN help and it has to reconfigure itself. The last time this happened, I waited aver 15 minutes. This dialog is like the <a href="http://en.wikipedia.org/wiki/Medusa">Medusa</a> of Windows&#8230; just the sight of it turns your computer to stone.</p>
<p><img src="http://www.slickedit.com/images/stories/blog/helpupdate.jpg" /></p>
<p>I could understand if dexplore were processing <a href="http://setiathome.berkeley.edu/">SETI</a> data on startup, crunching <a href="http://www.worldcommunitygrid.org/projects_showcase/viewHpfResearch.do">genome data</a>, or possibly computing sophisticated weather patterns. But let&#8217;s be honest, it&#8217;s a glorified web browser. All of the help it provides can be found <a href="http://msdn2.microsoft.com/">online</a>, and chances are, it&#8217;s more up to date online than it is dexplore.</p>
<p>Apparently, I&#8217;m not the only one that completely hates the help system. AprilR reports in her blog that Microsoft is <a href="http://blogs.msdn.com/aprilr/archive/2008/01/28/help-is-getting-help-the-long-overdue-makeover-for-visual-studio-and-msdn-help.aspx">overhauling MSDN help</a> based on user feedback. That&#8217;s great, but why has it taken so long? The only conclusion I can come to is that Microsoft must simply not use it. If anyone on the Visual Studio development team actually used it, it would have been overhauled a long time ago. It&#8217;s a shame too, because the actual MSDN content is, in general, very good.</p>
<p>Maybe someday we can go back to chm. It just worked and did the same job that MSDN does, just a million times faster. Well, everything except online content, but&#8230; that&#8217;s why I have Firefox installed on my computer (yes, <em><strong>Firefox</strong></em>). I set up my own help launcher macro to spawn a web browser, take the selected text and do a Google search on MSDN and the selected text.</p>
<p>Here&#8217;s the macro:</p>
<p><img src="http://www.slickedit.com/images/stories/blog/macro.jpg" /></p>
<p>Now, if you go into Tools &gt; Options and select Environment / Keyboard, you can bind <strong>Macros.MyMacros.HelpModule.LaunchWebBrowser</strong> to the F1 key (or whatever you like). Now, when you press F1, it will go right to Google and search for &#8220;MSDN [selection]&#8221; where [selection] is any selected text in your active document. It&#8217;s faster than launching dexplore and gets better results, at least for my purposes. The one thing it can&#8217;t do is determine the type context of your selection, but that can be fixed by by adjusting the search query.</p>
<p>Help is one of the most basic needs of every programmer. It&#8217;s an &#8220;I use it every day&#8221; kind of tool. <a href="http://go.microsoft.com/fwlink/?LinkId=102169">Give Microsoft your feedback</a>, because if there&#8217;s one thing that needs help in Visual Studio, it&#8217;s the help.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F02%2Fhelp-with-msdn-help%2F';
  addthis_title  = 'Help+With+MSDN+Help';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/02/help-with-msdn-help/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Why I Hate HTML and How SlickEdit Saved the Day</title>
		<link>http://blog.slickedit.com/2008/01/why-i-hate-html-and-how-slickedit-saved-the-day/</link>
		<comments>http://blog.slickedit.com/2008/01/why-i-hate-html-and-how-slickedit-saved-the-day/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 17:11:56 +0000</pubDate>
		<dc:creator>David O</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=213</guid>
		<description><![CDATA[I hate HTML. I know that is a little unfair, after all, so much of my life revolves around it. Like everyone in the tech industry, there is a browser open on my computer almost all the time and without it, I&#8217;d lose my major source for news, entertainment, and communication. But I still hate [...]]]></description>
			<content:encoded><![CDATA[<p>I hate HTML. I know that is a little unfair, after all, so much of my life revolves around it. Like everyone in the tech industry, there is a browser open on my computer almost all the time and without it, I&#8217;d lose my major source for news, entertainment, and communication. But I still hate dealing with it. Perhaps if HTML had been more like xhtml from the start (You know what I mean. The tight syntax, all tags closed etc.), or if XHTMLs other problems (validation, compatibility with existing HTML infrastructure, and browser support etc.) were solved, I wouldn&#8217;t be writing this.</p>
<p>The worst thing, though, is having to hand edit HTML that has been generated by other software, be it an Office document or HTML created by web page authoring software. This was the situation I found myself in recently when I was asked to do some simple web page maintenance for a local volunteer organization.</p>
<p>The site was hosted by Yahoo! Japan and was originally authored by Japanese web site software from a major unnamed corporation, which I will just refer to as HAL. I was not given the original project files from which I could make changes and regenerate the html, so I was going to have edit the HTML directly. The Yahoo! Japan portal provides web-based maintenance tools for the sites they host. Through a browser you can see a list of the directories and files in your site, backup and rename files, and edit and save HTML files in an editor control. You could also upload new files. These are crude tools, but for the changes I had, it should have worked. I didn&#8217;t want to manually download and upload each page.</p>
<p>I pulled up the first page in the editor control, and started editing. The file was many times longer than needed, filled with obtuse metadata and other unintelligible nonsense. The page switched between English and Japanese frequently, often many times in one sentence, and each change in language required that section to be enclosed in yet another &lt;span&gt; tag with the proper lang attribute. In many cases, a single word was nested in 2 to 3 identical &lt;span&gt; tags. Most lines were about 80 characters wide, but there were also 500+ character lines just to make things interesting. (I hate HTML.) Anyway, without too much trouble, I was able to find the content and make the changes. It wasn&#8217;t hard, just tedious.</p>
<p>I was now ready to view the result. I hit save to close the editor control and return to the file list. I switched to another browser tab that had the page loaded and hit F5 to refresh the display. Every bit of Japanese text was total garbage. Argh!!. I inadvertently changed something that ruined the display of the entire page. I knew I&#8217;d have to try again and be more careful. So I open the page in the editor control again and much to my chagrin, now all the Japanese text in the original file was garbage as well. The whole page was ruined. It hadn&#8217;t just a bug in my edits causing the display to go bad. (Another lesson in why you should back up your content before you start editing. Fortunately I had. Whew!)</p>
<p>I was stuck. A little experimentation quickly revealed that just loading the file in the Yahoo! Japan editor control and immediately saving it still ruined the Japanese. Not very impressive considering this was a site specifically for hosting and maintaining Japanese websites! (To be fair, this did not happen to every page on the site. Most I could edit just fine.) The problem was that the Yahoo! Japan on-line editor control did not resave the file with the correct encoding. It could read the file, display the file, and edit the file, but not save the file correctly. It was actually rather pitiful. Would it have worked had I been running on a native Japanese version of Windows XP and IE? Who knows? I would hope so, but that wouldn&#8217;t help me. I had the same problem in IE and Firefox. Could I have changed my browser settings to fix the problem? I don&#8217;t know, but I&#8217;ve never had a problem with any other Japanese page.</p>
<p>I was about to resign myself to having to recreate the whole page from scratch and upload it. Then I remembered SlickEdit handles different encodings. So I pulled up the backup copy in the Yahoo! Japan editor control and opened a new blank HTML page in SlickEdit and selected Japanese (Shift-Jis) encoding. After a simple copy and paste into SlickEdit, I had the original contents in a real editor (syntax highlighting, completions, HTML beautifier, parenthesis matching etc..) that could preserve the encoding. In a lot less time, thanks to the features in SlickEdit, I had the changes in again, saved properly to Japanese (Shift-Jis), and uploaded back to Yahoo! Japan.</p>
<p>Thank you SlickEdit.</p>
<p>(But I still hate software generated HTML.)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F01%2Fwhy-i-hate-html-and-how-slickedit-saved-the-day%2F';
  addthis_title  = 'Why+I+Hate+HTML+and+How+SlickEdit+Saved+the+Day';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/01/why-i-hate-html-and-how-slickedit-saved-the-day/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>QA Deathmatch</title>
		<link>http://blog.slickedit.com/2008/01/qa-deathmatch/</link>
		<comments>http://blog.slickedit.com/2008/01/qa-deathmatch/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 13:50:42 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=209</guid>
		<description><![CDATA[I&#8217;ve worked previously at several companies that didn&#8217;t have a QA department available. When the code freeze happened, all of the developers would go into QA mode. We&#8217;d then spend the next few weeks testing the features, and typically each developer would test their own. It was possibly the most feared and hated time of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve worked previously at several companies that didn&#8217;t have a QA department available. When the code freeze happened, all of the developers would go into QA mode. We&#8217;d then spend the next few weeks testing the features, and typically each developer would test their own. It was possibly the most feared and hated time of the year.</p>
<p>If you&#8217;re familiar with <a href="http://www.idsoftware.com/">Quake</a>, or pretty much any other <a href="http://en.wikipedia.org/wiki/First-person_shooter">FPS</a>, then you know about the <a href="http://en.wikipedia.org/wiki/Deathmatch_%28gaming%29">deathmatch</a>. It&#8217;s my single favorite type of game and, in it&#8217;s own way, is really therapeutic when the stress of development, or testing, gets you down. A lot of the other developers I worked with at one point also loved to deathmatch and we used to play during lunch. When testing time came around, we found a way to make it fun&#8230; <strong>QA Deathmatch</strong>.</p>
<p>Here are the rules for QA Deathmatch:</p>
<ol>
<li><strong>Scoring works on a point system:</strong> the points correspond to your company&#8217;s severity levels for bugs. If you find a bug, you score that bug&#8217;s severity level in damage. The person who owns that bug sustains that many points of damage. If your severity level goes in reverse order, then you score ([max severity] &#8211; [bug severity] + 1) per bug. For instance, assume your company has a severity level of 1 for critical bugs, and 5 for cosmetic bugs. If you find a bug with a severity of 2, then you score (5 &#8211; 2 + 1) or 4 points of damage and the bug&#8217;s owner sustains 4 points of damage.</li>
<li><strong>Damage can be recovered:</strong> by fixing a bug that caused the damage. When a bug is fixed, you reduce your damage sustained by the point total for that bug. However, the person who found the bug <em>does not</em> reduce their damage total.</li>
<li><strong>All features are fair game:</strong> there are points to be won everywhere in the code base, don&#8217;t limit yourself. The more you try all of the features, the more chance you have of scoring big.</li>
<li><strong>First to find a bug gets the points:</strong> If you find a bug that&#8217;s already been logged, you score nothing.</li>
</ol>
<p>All players have three running stats:</p>
<ul>
<li><strong>Damage delivered:</strong> The sum of the bug scores <em>found by you</em>.</li>
<li><strong>Damage sustained:</strong> The sum of the scores of the bugs <em>found by other players</em> against your features.</li>
<li><strong>Damage recovered:</strong> The sum of the damage <em>reduced by you</em> by fixing bugs.</li>
</ul>
<p>At the end of each day, the point totals are taken and five medals of honor are awarded:</p>
<ul>
<li><strong>Sniper medal:</strong> The person who delivered the most damage</li>
<li><strong>Stealth </strong><strong>medal</strong><strong>:</strong> The person who sustained the least damage</li>
<li><strong>Tactics </strong><strong>medal</strong><strong>:</strong> The person who had the best delivered:sustained ratio</li>
<li><strong>Medic </strong><strong>medal</strong><strong>:</strong> The person who recovered the most damage</li>
<li><strong>Commander medal:</strong> The person with the greatest overall score as calculated by [delivered - sustained + recovered].</li>
</ul>
<p>The point of all of this is that it makes testing fun. It gives you motivation to find bugs, fix bugs and make your features as solid as you can. It&#8217;s amazing what winning one or two medals at the end of the day can do to make you feel great about going into testing for another day. And if you think winning a medal is motivating, wait until you lose a medal to someone else.</p>
<p>Another great thing that QA deathmatch encourages is getting everyone to test all aspects of the system. Too often, developers only test their features and don&#8217;t go outside that box. However, there are bugs to be found everywhere, and when you are in scoring mode, you&#8217;ll take the time to check out all the new features to see what you can break to score big. It&#8217;s also a great facade for getting competitive about finding bugs. Nobody likes the guy that finds a lot of bugs in their features, and even fewer like to be that guy. It&#8217;s easy to feel bad about finding a lot of bugs. You&#8217;re essentially adding work to other people&#8217;s plates. But in QA deathmatch, you are playing a role and it&#8217;s a great way to detach personal feeling from the process.</p>
<p>There are other variations of the game too:</p>
<ol>
<li><strong>Team play: </strong>Development is split into two or more teams, divided by feature sets. Point totals are not by individual, but by team.</li>
<li><strong>Capture the flag:</strong> Just like team play, but instead of end-of-day totals, points are calculated when bugs are found or fixed. Instead of medals, flags are used that can be stolen by any team at any time. It feels great to find or fix a bug, then be able to steal a flag from another team.</li>
<li><strong>Mercenaries:</strong> Testers that aren&#8217;t involved in fixing bugs are mercenaries. They may not participate on a team or get any of the normal medals. Instead, a special <em>Mercenary award</em> is given to the one who scores the most damage in a day.</li>
</ol>
<p>Again, the whole point is to make testing fun. All you need is a whiteboard, a calculator and some gadgets to be used as medals. Of course, you can always add to the game by printing a bunch of <a href="http://www1.istockphoto.com/file_thumbview_approve/4213435/2/istockphoto_4213435_cartoon_skull_and_crossbones.jpg">these</a> then taping one to a developer&#8217;s cube with the bug number and severity penciled in whenever a bug is found. It can only be removed when the bug is fixed. The possibilities for expansion are endless.</p>
<p>QA is a painful process and some days, when 8+ hours of QA work lay ahead of you, it&#8217;s just hard to get out of bed in the morning. Don&#8217;t let boring work be boring. Not only will you have more fun during the day, but I can guarantee that when you turn QA into a competitive deathmatch, the quality of the final product going out the door will be better than if you are finding and fixing bugs for the sake of quality alone. Happy sniping!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F01%2Fqa-deathmatch%2F';
  addthis_title  = 'QA+Deathmatch';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/01/qa-deathmatch/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>My Programming New Year&#8217;s Resolution</title>
		<link>http://blog.slickedit.com/2008/01/my-programming-new-years-resolution/</link>
		<comments>http://blog.slickedit.com/2008/01/my-programming-new-years-resolution/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 13:40:53 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=205</guid>
		<description><![CDATA[Each year, I make one programming related resolution. It&#8217;s that time of year again to look back and evaluate what I&#8217;ve done well, what I haven&#8217;t, and what I might change to make next year even better than this one. In the past, I&#8217;ve chosen to learn this or that and improve my skills in [...]]]></description>
			<content:encoded><![CDATA[<p>Each year, I make one programming related resolution. It&#8217;s that time of year again to look back and evaluate what I&#8217;ve done well, what I haven&#8217;t, and what I might change to make next year even better than this one. In the past, I&#8217;ve chosen to learn this or that and improve my skills in some way. This year, I&#8217;m doing something a little different.</p>
<p>My resolution for 2008 is to get more involved with kids and computers. I&#8217;ve been programming <a href="http://blog.slickedit.com/wp-content/uploads/2007/05/1231130-r1-e001-4.jpg">since I was 11</a>. I took a course in 5th grade on how to use BASIC. I have no idea how that course was offered or what sparked me to take it, but I went one night a week for a few months and learned to write some simple stuff. I was lucky to have had that course and I wish I could thank that teacher for teaching what was probably considered a novelty subject on her free time. I was also lucky for the fact that my parents were willing to invest what was then an enormous amount of money into my <a href="http://www.blakespot.com/images/ti99.jpg">first</a> <a href="http://www.vintagecomputermanuals.com/ibm_pc_5150.jpg">few</a> computers. I&#8217;m sure that at the time they wondered why they were investing so heavily in &#8220;toys&#8221;, which back then, didn&#8217;t manage their money, do their taxes, or calculate my Dad&#8217;s golf handicap. Yet, that investment was the start of a love of programming that&#8217;s gone on now for over 25 years.</p>
<p>I&#8217;ve read a lot of stories lately about how computer science students are on the decline, despite hiring and salary increases in programming. <a href="http://reddevnews.com/features/article.aspx?editorialsid=2373">Redmond Developer</a> reports, &#8220;[...] survey data showed that since 2000, interest in CS as a potential major had dropped almost 70 percent.&#8221; Many other sources report the same trend <a href="http://www.reviewjournal.com/lvrj_home/2006/May-23-Tue-2006/news/7551608.html">[1]</a>, <a href="http://articles.techrepublic.com.com/5100-22-5306904.html">[2]</a>, <a href="http://chronicle.com/wiredcampus/article/2557/cambridge-fights-for-computer-sciences-reputation">[3]</a>. As a software developer, that trend bothers me.</p>
<p>My kids are in K and 6th grade, so I see what they&#8217;re learning on computers these days. Many kids have access to computers and know how to use them to access the internet, to write and print a report with a word processor, and so on and so forth. These are great life skills which, you could argue, are as important these days as reading and writing. However, there&#8217;s very little transition to computer science there, and that&#8217;s where most of the computer teaching seems to end.</p>
<p>It&#8217;s a shame too, because computers are doing such cool things these days. The games, the web sites, the music applications&#8230; there&#8217;s so much there that a grade school kid can connect with and see as being essential to their day to day activities. With all of that coolness, you&#8217;d think that kids would be knocking down the doors to learn how to make that kind of stuff.</p>
<p>The problem is that you can&#8217;t learn to make cool stuff like that the first time you sit down to program. Not the tenth and probably not the hundredth time either. In order for kids to get from the point of being users to being developers, there has to be some motivation to keep them interested. Rob Walling wrote a great article about how to <a href="http://www.softwarebyrob.com/2007/06/27/computer-science-enrollment-going-down-taking-software-jobs/">make programming seem cool again</a> to young kids. He&#8217;s got the right concept for the hook and I tried to memorize the &#8220;Show the Steak&#8221; section like it was a script.</p>
<p>But a hook is not sustainable. What kids really need to keep their interest are small, recurring successes. For me, Compute! magazine provided those little successes in the form of one page programs I could type verbatim to get a working game. After a few straight copies, I started tweaking their games, then I added new abilities to those games and then I was writing games from scratch. Once my momentum had reached that point, I really <em><strong>wanted</strong></em> to learn more.</p>
<p>So what are those little successes these days? There&#8217;s no more Compute! magazine or anything like it. Even writing a simple program these days can seem impossible because of IDEs, compilers and all sorts of things that precede writing a single line of code. There are some great projects out there like <a href="http://phrogram.com/content/whatisphrogram.aspx">Phrogram</a>, <a href="http://scratch.mit.edu/">Scratch</a>, <a href="http://kidbasic.sourceforge.net/">Basic for kids</a> and <a href="http://en.wikipedia.org/wiki/Logo_(programming_language)">LOGO</a>. Amazingly, despite the unlimited access to this stuff, most of it seems to go relatively unnoticed.</p>
<p>So now that I&#8217;ve made my resolution, how do I actually make it happen? Well, the other day I was talking to my son&#8217;s Kindergarten teacher before class. She was telling me about a new web site she had set up for the class&#8230; a blog where she could post information about what they were up to in class. She&#8217;d taken a class about it and was learning HTML. We talked some more and she mentioned her interest in the <a href="http://www.opensource.org/node/229">Give One, Get One</a> program. I&#8217;d never heard of it. It turns out that it&#8217;s part of the <a href="http://laptop.org/">One Laptop Per Child (OLPC)</a> program, an initiative to get affordable laptops to underprivileged children of third world countries. I had definitely heard of that. Originally, this laptop was not planned to be sold commercially, but you can get one by donating one through the Give One, Get One program. This teacher was interested in getting one to use in the class, but didn&#8217;t know much about it.</p>
<p>So there I was with my kid&#8217;s teacher willing to learn how to use this <a href="http://laptop.org/en/img/specs_dimensions.jpg">new device</a> to teach. We put together a small plan, and I bought one a few days ago. She&#8217;s buying one also, so there will be two in my son&#8217;s class. I&#8217;m going to help her learn what it can do and show her things the kids can do with it beyond web surfing and game playing. In particular, I&#8217;m interested in the LOGO program it comes with and how that can be introduced to Kindergarteners in the form of repeating patterns (a heavily stressed concept in the lower grades). My highest expectation is that they think it&#8217;s fun to tell a pen-dragging turtle where to go.</p>
<p>I don&#8217;t exactly know where this is all going, but it feels good to be doing <em>something</em>. I&#8217;m excited about getting involved in helping kids learn computers, a subject I&#8217;ve spent lots of time thinking about and very little time doing anything about.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2008%2F01%2Fmy-programming-new-years-resolution%2F';
  addthis_title  = 'My+Programming+New+Year%26%238217%3Bs+Resolution';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2008/01/my-programming-new-years-resolution/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Software Estimates and the Parable of the Cave</title>
		<link>http://blog.slickedit.com/2007/12/software-estimates-and-the-parable-of-the-cave/</link>
		<comments>http://blog.slickedit.com/2007/12/software-estimates-and-the-parable-of-the-cave/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 20:29:13 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Dev Management]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=207</guid>
		<description><![CDATA[As discussed in a previous blog, The Perfect Estimate, providing software estimates is one of the most challenging aspects in the software industry. There are many reasons for this, not the least of which is the challenge of estimating the unknown. Unlike many other construction activities, like erecting a skyscraper or building a ship, software [...]]]></description>
			<content:encoded><![CDATA[<p>As discussed in a previous blog, <a href="http://blog.slickedit.com/?p=94">The Perfect Estimate</a>, providing software estimates is one of the most challenging aspects in the software industry. There are many reasons for this, not the least of which is the challenge of estimating the unknown. Unlike many other construction activities, like erecting a skyscraper or building a ship, software projects often involve new combinations of technologies (at least for those on the project) assembled in unique ways.</p>
<p>The more a task resembles a previously completed task, the easier it is to estimate. Ideally, metrics kept about the previous task will include time spent on various activities and the total time overall. When estimating the new task, you could analyze which activities are likely to change based on completing the previous one and derive an estimate for the new task.</p>
<p>In order to best illustrate the challenges of software estimates, I will use the time-proven technique of the parable.</p>
<p><strong>The Parable of the Cave</strong></p>
<p>Two people stand before a cave. One is the sagely manager of a cave exploring company who’s wisdom is only exceeded by his wit, charm, and humility. Let’s call him, oh, “Scott”. The other is a cave explorer of indeterminate gender who bears no resemblance to any programmers past or present that this author may have worked with and whose size may be big or little. Let’s call him/her “Endian”.</p>
<p>“Endian,” said Scott in a sagely voice that was both commanding and compassionate, “I need you to explore this cave. But before you do, I need to know how long you think it will take, so that I may build a schedule and tell the sales team when the cave will be ready.”</p>
<p>“Great Scott,” replied Endian using the title bestowed upon Scott by his admiring employees, “how can I give you an answer when surely you know I have never been in this cave before? The cave may be vast, with deep chasms. It may contain a labyrinth of underwater passages. It may contain fearsome creatures that must first be vanquished. How can I say how long it will take to explore?”<br />
Scott pondered Endian’s words and after a thorough analysis that might have taken days for others but was completed in but a moment for him, he replied, “Surely this is not the first cave you explored. Are there no other caves in this district? Use your knowledge of those caves to form an estimate.”</p>
<p>Endian heard these words and still his doubt prevailed. “Your words are truly wise,’’ said Endian, “but even within a district the caves may vary, one from another. Surely, an estimate based on the size of another cave cannot be deemed accurate.”</p>
<p>“You have spoken truly, good Endian,” replied Scott in a fatherly, supporting tone that lacked any trace of being patronizing as certain cynical readers may think. “Here, take from me this torch and this assortment of cheeses that you may explore the cave briefly. Return ere the morrow and report what you have learned.”</p>
<p>The parable continues like this for pages, as parables are known to do. Let’s see, Endian enters the cave…something about a wretched beast of surpassing foulness…he continues on…hmm, that’s what the assortment of cheeses were for. Ah! Here we go.</p>
<p>Endian returns to Scott, his t-shirt ripped and his jeans covered in mud. Being always concerned with the well-being of his employees, Scott offers Endian a cool drink, then asks, “Endian, what news of the cave? Have you an estimate that I can use for my schedule? What shall I tell the sales team?”</p>
<p>Endian considers all that he has seen and builds a decomposition containing the many tasks necessary to explore the cave based on his earlier reconnoitering. He factors in variables for risk and unknowns, and then he responds, “Two weeks.”</p>
<p><strong>Applying this Wisdom</strong></p>
<p>To truly appreciate the punch line, you do need to check out <a href="http://blog.slickedit.com/?p=94">The Perfect Estimate</a>.</p>
<p>The point I’m trying to illustrate is that estimating software development is like estimating the time needed to explore a cave you’ve never been in. You don’t really know until you get in there. Still, there are techniques that can help.</p>
<p>First, draw on your experience. Even though technologies may be very different, few automation problems are empirically new. They bear resemblance to other things we’ve done in the past.</p>
<p>Expect the unexpected! Make sure you factor time in for the unknowns. If your schedule only contains the things you can think of, then it’s certainly going to fall short when the unexpected arises. There will always be things you don’t know to put into the schedule.</p>
<p>Provide estimates that are ranges rather than just a single duration. If a task can take 2 to 4 weeks, provide it in that manner. If your project planning software cannot accomodate date ranges, enter the task as 2 weeks and then put in a secondary task for another 2 weeks to account for this. I like to name these tasks, &#8220;risk factors&#8221;. So, if I have a task called, &#8220;Integration Testing&#8221;, I would add another called, &#8220;Integration Testing, Risk Factor&#8221;. This way, I can specifically see how much time has been set aside for this variability, and I can see what happens to the schedule if I increase or decrease that amount of time.</p>
<p>Make your estimates as fine-grained as possible. An estimate for a task that only needs a few hours is far more likely to be accurate than an estimate for one that will need a couple weeks. By making your estimates as detailed as possible you not only improve accuracy but the work necessary to create a detailed estimate will often turn up tasks you might otherwise overlook.</p>
<p>Even if your manager only wants an overall estimate, you should do a detailed decomposition to make sure you build the best estimate possible. This decomposition will also serve as a guide during your work, both as a checklist to make sure you haven&#8217;t forgotten something and as a status check to see if you are on time. This can help you timebox activities, applying the available time to a task. Projects can run over due to time spent waffling on design decisions. Timeboxing tells you when it&#8217;s time to make a decision and move on.</p>
<p>Build your decompositions with tasks that are either complete or incomplete. When tracking progress, don’t fall into the trap of recording activities as some percentage complete. A task is either finished or not finished. Showing partial completion leads to a false sense of security.</p>
<p>Use incremental and iterative processes. As in the parable, sometimes it’s useful to make a quick, preliminary exploration in order to build a more comprehensive estimate. Continue to refine your estimates and the overall plan. The closer you get to the end, the more accurate your schedule should be.</p>
<p>Work on the riskiest part of the system first. Too often projects run over when someone discovers a large problem in the final stages of the work. Assess the risk of each portion of the work and tackle first those parts that are most likely to exceed their estimates or induce changes in the rest of the system.</p>
<p>Lastly, it is absolutely critical that an environment of trust exists between the development team and the rest of the company. Your job should be to deliver the best estimate you can with appropriate risk factors identified. Too often estimates are inflated to make sure that we can hit them. Equally often, due dates are set artificially early to allow for overages. Both of these strategies prevent the company from building an effective plan for this project and developing appropriate contingencies. Worse, these constraints sometimes lead to poor choices and compromises during development that add further risk.</p>
<p> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F12%2Fsoftware-estimates-and-the-parable-of-the-cave%2F';
  addthis_title  = 'Software+Estimates+and+the+Parable+of+the+Cave';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/12/software-estimates-and-the-parable-of-the-cave/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Where Are All the Qualified Programmers?</title>
		<link>http://blog.slickedit.com/2007/12/where-are-all-the-qualified-programmers/</link>
		<comments>http://blog.slickedit.com/2007/12/where-are-all-the-qualified-programmers/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 14:41:30 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=180</guid>
		<description><![CDATA[Periodically I read articles claiming that there is a programmer shortage in the US. Bill Gates made that claim earlier this year. A quick search on Google turned up similar articles going back to 1998. Do we have a problem with too few programmers in this country? I contend that we do not. Certainly shortages [...]]]></description>
			<content:encoded><![CDATA[<p>Periodically I read articles claiming that there is a programmer shortage in the US. <a href="http://programmersguild.blogspot.com/2007/03/bill-gates-to-ask-congress-for-my-h-1b.html">Bill Gates made that claim</a> earlier this year. A quick search on Google turned up similar articles going back to 1998. Do we have a problem with too few programmers in this country? I contend that we do not.</p>
<p>Certainly shortages arise in specific specialties as some technologies become more popular. Likewise, some geographic areas may see more competition for programmers than others. As lovely as it is, not all of us want to live in California. These articles are talking about large-scale, industry wide shortages and not the kind that can be explained by local factors. So what’s going on?</p>
<p>I believe that there are a number of problems at fault.</p>
<p><strong>Programmer Shortage as Means of Lowering Programmer Pay</strong></p>
<p>When Mr. Gates decries the lack of available programmers, he offers the solution that we should increase the number of H-1b visas. Indeed, if there truly is a shortage then this seems like a reasonable solution. However, this is more likely a ploy to address the true problem that these companies aren’t willing to admit: there aren’t enough programmers available at the salary they are willing to pay.</p>
<p>I worked at a company that would post positions that had ridiculous job requirements that almost no one could meet. They would then use the unfilled positions as justification to bring in programmers who were on H-1b visas that were, frankly, no more qualified than the American programmers that were rejected. The ones I knew were paid far less than their American counterparts.</p>
<p>This is a peripheral issue and not what I deem to be the problem at most companies.</p>
<p><strong>What is a Qualified Programmer?</strong></p>
<p>The trouble is that many companies don’t know how to identify a qualified programmer. I say that because their job postings frequently contain combinations of specific technical abilities stated in years of experience. In a previous blog, <a href="http://blog.slickedit.com/?p=125">The Mythical Year of Experience</a>, I discussed why that approach is a failure.</p>
<p>Even without relying too much on years of experience, most companies put too much emphasis on experience with a specific combination of technologies. This includes things like Oracle, Struts, .NET, XML, etc. I consider these to be extrinsic abilities. Knowledge of these things must be specifically learned and aren’t generally applicable to other areas. In contrast, intrinsic abilities are more portable and can be applied in many areas. These include problem solving, communication, and the ability to learn quickly.</p>
<p>I’m not saying that you should hire people who are totally unfamiliar with the technologies you are using, just that this need is too often overstated and the value of the intrinsic abilities is rarely weighed.</p>
<p>Let’s take XML as an example. Several years ago, I worked on a project that processed mortgage applications. We decided to use XML to store the documents while they were being processed. Those of us who designed the document structure and laid the fundamental access patterns needed a thorough knowledge of XML. Once that was finished, I was able to show my team members how to access fields very quickly.</p>
<p>If we had an opening on this team, many companies would make the mistake of requiring a couple years of experience in XML since it is so important to the project. A good programmer, who learns quickly, would be able to get up to speed on our use of XML in no more than a day.</p>
<p>To illustrate the importance of these intrinsic abilities, let’s look at another project I worked on. This was a C++ project where we had a requirement to run on several platforms. We ran into portability issues with the C++ code and decided we would be better off if we rewrote the system in Java. Though none of us had experience with Java, we quickly learned the language and proceeded with only a few minor hiccups. Our intrinsic abilities as great programmers allowed us to quickly adapt to this change.</p>
<p>The one constant in technology is that it is going to change. Hiring people with a greater focus on their intrinsic abilities will create a stronger work force that is better able to adapt to change. This will help your company avoid the short-term programmer shortages created by these shifting technologies.</p>
<p><strong>How Do You Recognize a Qualified Programmer?</strong></p>
<p>You can also tell how much trouble companies have with this by looking at their interview processes and the questions they ask. They are as likely to hire a truly effective programmer using their approach as if they had candidates randomly draw “Hire” or “Don’t Hire” cards from a deck. After some of the interviews I’ve been through, that approach would have been more satisfying and more respectful of my time.</p>
<p>Most companies ask the same old questions about your previous experience. You spend your time describing what the project did, not what you did. Any member of your team is likely to be able to answer these questions just as effectively, regardless of how little they actually contributed.</p>
<p>Some companies ask ridiculous questions with no specific answer, like “How many manhole covers are there?” They then look for candidates who try to reason out an answer. Or they might give you some kind of problem to solve about weighing balls or crossing a bridge. Tell me, what analog does this have to your daily programming tasks? Sure, problem solving is important but something a little more closely related to the programming domain might be nice. These problems too often rely on a flash of insight, which may be difficult to come by when standing in front of strangers with a potential job on the line.</p>
<p>Some companies ask questions that are more pertinent to programming, but get off in the weeds on very detailed algorithmic knowledge, like “How do your reverse an array without a temporary variable?” Or “How do you detect a loop in a graph?” These are good tests of your memory if you’ve been exposed to them before, but you will probably not puzzle out a great solution during an interview. Certainly, you could look up the answer more quickly, which is what you would do on the job.</p>
<p>There are jobs for which these kinds of questions may be suitable. But for most, they will just help you disqualify good candidates. Keep in mind that the answers to these kinds of questions seem more obvious to the interviewers because they already know the answer and have watched several candidates wrestle with them. Because of this, interviewers tend to be unduly critical of those who do not give the optimal answer.</p>
<p><strong>No Unqualified Programmers?</strong></p>
<p>So I’m saying that there are no unqualified programmers? NO! As a manager who has interviewed my fair share of candidates I know first-hand that many of the applicants are unqualified. The sheer volume of candidates whose knowledge and abilities fall short of your expectations can easily lead you to believe that there are no qualified programmers.</p>
<p>Like any population, the bell curve is at work with programmers. The highly talented, top contributors that you seek are outliers in that population. You will need to screen many, many candidates to find the ones you need. Just be sure you&#8217;re screening for the right abilities.</p>
<p><strong>So What Do I Do?</strong></p>
<p>When hiring, consider what you truly need in your candidates. Don’t fall into the trap of just listing all the technologies you use. Determine which can be learned on the job and which truly require experience.</p>
<p>Examine your interview process. How does each step specifically help you identify the kind of programmers you need? Are you properly balancing intrinsic and extrinsic abilities?</p>
<p>Get your most talented engineers involved with screening candidates. “It takes one to know one.” Great engineers may not be able to describe how to recognize another great engineer, but they know one when they interact with one. The time they spend interviewing candidates will pale in comparison to the time they spend fixing problems created by less capable programmers.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F12%2Fwhere-are-all-the-qualified-programmers%2F';
  addthis_title  = 'Where+Are+All+the+Qualified+Programmers%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/12/where-are-all-the-qualified-programmers/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Classical in a Digital Age</title>
		<link>http://blog.slickedit.com/2007/12/classical-in-a-digital-age/</link>
		<comments>http://blog.slickedit.com/2007/12/classical-in-a-digital-age/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 20:45:10 +0000</pubDate>
		<dc:creator>David O</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=174</guid>
		<description><![CDATA[Music distribution has gone digital, and as with any move or paradigm in the music industry, the model is designed for pop music, not real music. Argh!! I couldn&#8217;t even make it through the first sentence without my true colors showing. That&#8217;s right, I listen to classical music and I&#8217;m not apologetic about it. I [...]]]></description>
			<content:encoded><![CDATA[<p>Music distribution has gone digital, and as with any move or paradigm in the music industry, the model is designed for pop music, not real music. Argh!! I couldn&#8217;t even make it through the first sentence without my true colors showing. That&#8217;s right, I listen to classical music and I&#8217;m not apologetic about it.</p>
<p>I have spent many a late night over the past few years obsessing about my digital music collection. Whether it&#8217;s ripped from an old CD or purchased download, I have to have it labeled correctly. But this is a losing battle. Virtually all players are designed for standard pop albums with the artist, album, and song model. That just doesn&#8217;t cut it for real music. (OK. I&#8217;ll be honest. It bugs the heck out me when Beethoven&#8217;s Opus 132 gets referred to as a <em>song</em>.)</p>
<p>Anyway, I got hooked on digital music files a few years ago because the computer had a bad cd-rom drive in it. I couldn&#8217;t play a CD on it, but it would read the data and could rip a CD. So I started slowly moving my CD collection over one disk at a time. Well, I didn&#8217;t start out with iTunes, I tried a variety of players but mostly used the ziff player. The big decision is what format to use. I chose .ogg. There was no real reason other that I used CDex to rip the same track in a couple of formats at 160 kbps and .ogg sounded the best. The files were smaller as well. The difference wasn&#8217;t much, but I felt the .ogg files sounded warmer, especially the string sound. There are no end of websites and blogs promoting one standard over the others, but I&#8217;m not going to go there. I just made the decision early on that ogg was the best for me. My collection is not that large, a few hundred CDs, and it took a few years to convert the collection. I wasn&#8217;t actively trying to rip everything, but whenever I played a CD if it was on the computer with the bad drive, I would rip it. I eventually had most of my disks ripped and for the most part tagged.</p>
<p>I&#8217;ll spare you my discussion on what I think is the best way to tag to your classical music files. Instead, check out the following pages (especially the second) to see how the debate rages on. And these guys just cover what to do with iTunes. I&#8217;m sure there are many others.</p>
<p><a href="http://playlistmag.com/features/2005/03/tagclass/index.php">Tagging Classical Music</a><br />
<a href="http://oakroadsystems.com/genl/itunes.htm">Taming iTunes for Classical Music</a><br />
<a href="http://www.tunequest.org/on-classical-music-tagging-for-itunes-and-ipod/20060530/">On Classical Music Tagging (ID3 tags) for iTunes and iPod</a></p>
<p>Each of these is quite individual and so naturally, I neither totally agree or disagree with any of them. I applaud their careful work, but each method suffers from the same agonizing flaw. All they do is try to make a broken system appear less broken. I don&#8217;t want to start down that road. (However, for another time, I have some advise for using iTunes with classical music. Anyone else out there used the <a href="http://developer.apple.com/sdk/itunescomsdk.html">iTunes COM for Windows SDK</a>?)</p>
<p>Instead, I ask why are we so stuck on the primitive data model of a single track stored as a single row in a table? Relational database anyone? Authority records? We could even do something pretty good with a little XML.</p>
<p>I just randomly pulled a CD off my shelf. It is a Telarc disc of orchestral music by <a href="http://en.wikipedia.org/wiki/Samuel_Barber">Barber</a> performed by the <a href="http://www.atlantasymphony.org/">ASO</a> and Yoel Levi. When I stick this into iTunes, rather than have the Gracenote’s database give me a few choices for the CD and then fill in the rows with poorly formatted strings, it should just give me a link to an authority record (or some XML) for the CD. This would contain accurate information for composer, compositions, and performers etc. Then within the player, I could choose how to display this information for the CD. Does the Name column contain both the full piece name and the movement name or just the movement name? I could define this through some kind of options dialog in iTunes or just give it my own xsl translation.</p>
<p>I know, you&#8217;re wondering how are all these authority records created anyway? The same way they are now, by having users submit them. If I were to put in a CD that was not yet in the Gracenotes database, I would fill in the crucial data much like I do now in iTunes. For composer, I&#8217;d highlight the tracks on the CD by Barber and then iTunes and its database would give me a list of known composers to choose from. Pick another track, and it could provide a list of known compositions by Barber etc. Starting with a core database of a few hundred composer records, a few thousand composition records, and a similar number of ensemble and performer records, one could quickly create a new complete CD record for the database based on existing records. Of course, new records for composers and compositions could be submitted and vetted by the database. Most of the CDs would not need to submit any new data beyond what compositions and performers appear in the release.</p>
<p>If you think this data still would be too hard to create or put on-line, then check out <a href="http://www.arkivmusic.com/classical/main.jsp">ArkivMusic</a>. Granted, ArkivMusic is a retailer and their database serves a different purpose, but they&#8217;ve done a whole lot of things correctly. At this site, I don&#8217;t never have to differentiate between Samuel Barber and Barber, Samuel, or between Atlanta Symphony Orchestra and Atl Sym Orch. Why can&#8217;t putting music in my digital music player work half this easily?</p>
<p>To be fair, I&#8217;m certainly not the only one out there grappling with these questions. Kirk McElhearn has started a project called <a href="http://www.mcelhearn.com/article.php?story=20060130113518368">The Well-Tempered Database</a>, though it still seems to be getting off the ground. Of course, if you have the means (~$5,000) you could always get the <a href="http://www.fortunaclassical.com">Fortuna Maestro Classical Music Player</a> and have someone else do your cataloging for you. Let me know about any other projects there may be.</p>
<p>I&#8217;ll also take this opportunity to put in a plug for <a href="http://www.emusic.com/">eMusic.</a> Here is the other side of the coin. They have incorporated classical music into their business model just as they did for noise downloads (pop music), one price per track. Their standard fee for 30 downloads is $9.99/month, or ~33 cents per track. Good price for your average 3 minutes noise track, but what a bargain if you go for a big piece of real music like <a href="http://en.wikipedia.org/wiki/Symphony_No._9_%28Beethoven%29">Beethoven&#8217;s Ninth.</a> The four tracks cost you $1.33 and you get 65 minutes of music at a higher quality than the standard iTunes download. That&#8217;s a steal! The drawback is that it is a subscription service. Ten dollars a month with a use it or lose it policy.</p>
<p>So I admit that I am a classical music snob, but it&#8217;s mostly in good humor. I don&#8217;t care what you listen to as long as I can listen to what I want to. As proof I offer this recent photo of me playing jazz/rock violin with the band <a href="http://vids.myspace.com/index.cfm?fuseaction=vids.Channel&amp;ChannelID=253695047">Fujiyama Roll</a>. (Sorry for the low image quality.) I really am a hip guy who can get down to some funky music. Far out, man!</p>
<p><img width="607" src="http://blog.slickedit.com/wp-content/uploads/2007/12/rockstar3.jpg" alt="Rock star DOB" height="330" />Rock star David O</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F12%2Fclassical-in-a-digital-age%2F';
  addthis_title  = 'Classical+in+a+Digital+Age';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/12/classical-in-a-digital-age/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Code Scavenging: A New Software Development Methodology</title>
		<link>http://blog.slickedit.com/2007/11/code-scavenging-a-new-software-development-methodology/</link>
		<comments>http://blog.slickedit.com/2007/11/code-scavenging-a-new-software-development-methodology/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 14:16:59 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=183</guid>
		<description><![CDATA[Everyone loves to talk about software reuse. Everything is object oriented this, design patterns that, frameworks here, components there. It&#8217;s all good stuff, but at the end of the day, it doesn&#8217;t really help much with struggles of day to day programming. I&#8217;m talking about the &#8220;bite-sized tasks&#8220;, the kind of programming you face day-in [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone loves to talk about software reuse. Everything is object oriented this, design patterns that, frameworks here, components there. It&#8217;s all good stuff, but at the end of the day, it doesn&#8217;t really help much with struggles of day to day programming. I&#8217;m talking about the &#8220;<a href="http://subversion.tigris.org/project_tasks.html#bite-sized">bite-sized tasks</a>&#8220;, the kind of programming you face day-in and day-out:</p>
<ul>
<li>Letting the user manage a collection of objects with a dialog</li>
<li>Creating an MRU menu</li>
<li>Running a task on a background thread</li>
<li>Paging a large set of data in a grid</li>
<li>Writing drag-and-drop code</li>
</ul>
<p>There are many bite-sized tasks that programmers face every day. It&#8217;s the unglamorous and tedious side of programming. Most developers spend the far majority of their time tackling these tasks that are often too specific to be effectively handled by a general purpose framework. Yet, there is a commonality to most of them that all programmers will recognize and respond to with something like, &#8220;Oh yeah, I&#8217;ve done something like that before.&#8221; Reusable frameworks that support the core of a software project are crucial to its long term stability and scalability, but most programmers don&#8217;t spend their day working on them. The list of bite-sized tasks is just too big and specific to be encapsulated in a such a framework.</p>
<p><strong>Helper classes</strong></p>
<p>Some frameworks have tried to address these tasks by creating single use objects designed to provide a general starting point. For instance, .Net provides the <a href="http://msdn2.microsoft.com/en-us/library/8xs8549b.aspx">BackgroundWorker</a> class to help run tasks on a background thread. It&#8217;s a very good class and I use it whenever I need to run tasks asynchronously, but it&#8217;s a standalone class. It has no relationship to any of the other objects in the .Net framework. There are many classes like this that I would not categorize as &#8220;framework&#8221; classes&#8230; they&#8217;re just helpers.</p>
<p>Generalized helper classes certainly serve a need in software development, but even those can only carry the ball so far. For one thing, you still have to bridge the gap between the generalized functionality a helper class provides and the specific functionality you are trying to accomplish. Sometimes this can be just as challenging as not using the helper class at all. Other times, the helper does 90% of what you need and the remaining 10% makes using the helper class impossible. If you can&#8217;t get inside the helper class and tweak it to do that extra 10%, then the helper class becomes useless for that task.</p>
<p><strong>Where reuse falls short</strong></p>
<p>This doesn&#8217;t mean that those bite-sized tasks haven&#8217;t been tackled before, though. On the contrary, they&#8217;re tackled over and over and over again by different developers in different companies that never know of each others&#8217; existence. This is a big hole in the state of reuse in today&#8217;s software development.</p>
<p>However, outside of the commercial frameworks and components are endless code samples cataloged on the internet. Sites like <a href="http://sourceforge.net/">Source Forge</a>, <a href="http://www.codeproject.com">Code Project</a>, <a href="http://www.koders.com">Koders</a>, <a href="http://www.google.com/codesearch">Google Code Search</a>, <a href="http://www.codeplex.com">CodePlex</a>, <a href="http://labs.oreilly.com/code/">O&#8217;Reilly Code Search</a>, etc, provide endless amounts of code that do those little tasks. Disassemblers are also available to get the source code from compiled .Net or Java assemblies. Need to read a comma delimited file? Somewhere, someone has done that before and it&#8217;s probably on the internet. Find a project that does that, look at the code and use it&#8230; it&#8217;s that simple.</p>
<p>Ok, maybe not. In order to do that you have to do &#8220;code scavenging&#8221;. Doing this involves the following process:</p>
<ol>
<li>Finding public code that does what you need to do.</li>
<li>Scanning the code and pulling out just what is needed to accomplish the task.</li>
<li>Tweaking the found code to make it work with your own code.</li>
</ol>
<p>Many people will stop reading here and argue that this is software reuse at it&#8217;s worst&#8230; cut, paste and retrofit to solve the problem. My answer to that is&#8230; yes, it is, and that&#8217;s ok. If you think about the hierarchy of a software project, the farther we get from the core, the more task-specific the code becomes. At some point in that hierarchy, you reach a point of diminishing returns on object oriented reusability. Striving for reuse simply for reuse&#8217;s sake at this level will hurt the code, rather than improve it. These task-specific extremities in the software hierarchy most likely represent the bulk of the day to day coding work. That&#8217;s not being pessimistic about reuse, it&#8217;s being realistic.</p>
<p><strong>A new methodology</strong></p>
<p>I picture the &#8220;code scavenging&#8221; style of programming as a new methodology of reusable software development. Practicing this type of reuse is very different than practicing component or framework reuse. It requires resourcefulness to find sample code, technical knowledge to quickly understand the found code, and insight to know how to retool that found code into your own code. Applied properly, though, it can turbo-boost productivity and quickly solve problems that might otherwise take days to work out.</p>
<p>Unfortunately, there doesn&#8217;t seem to be very many tools or documented techniques for this type of programming. Some authors have mentioned it (<a href="http://www.cs.uoregon.edu/research/paraducks/papers/hackstadt97.d/ch4.html">[1]</a>, <a href="http://portal.acm.org/citation.cfm?id=257499">[2]</a>, <a href="http://64.233.169.104/search?q=cache:Us3VrHVXYDIJ:peter.cowhide.org/portfolio/Term5%2520-%2520Socio/socio_article.pdf+code+scavenging&amp;hl=en&amp;ct=clnk&amp;cd=11&amp;gl=us">[3]</a>) but overall, little work has been done on how to do it effectively. There are several barriers to code scavenging as a methodology as well. Web sites hosting code samples are disconnected and sometimes poorly cataloged. Samples are not guaranteed to be good or even work properly. They can also be copyrighted by the original author under any number of legal bindings.</p>
<p>Despite the difficulties, I believe there is a need to develop a methodology around code scavenging. This methodology would address best practices in the following areas:</p>
<ol>
<li>Finding sample code: Finding samples that fits your needs is not always as easy as a quick Google search. What are the techniques for finding quality sample code?</li>
<li>Determining the root code sections that perform the required task: The root code is the minimum set of code that performs the task you are trying to accomplish. This may be in one or several different locations in the sample. What are the best ways to identify these areas?</li>
<li>Finding the &#8220;incision points&#8221;: Incision points are the areas of code in the sample where you can &#8220;cut&#8221; that still enables the root code sections to work. This includes initialization functions, non-local variables, etc. How are these best identified?</li>
<li>Merging the extracted code into your own work: This is the area where a set of documented techniques would shine. What is the best way to add the found functionality without having to rework a lot of your existing code? Even better, how do you keep the sample decoupled from your code in case it fails to work as you expected. Are these techniques the same for UI vs. back end work?</li>
</ol>
<p>I certainly don&#8217;t have the answers to all of these questions, but I have a lot of ideas and I&#8217;m really interested in exploring this further. Code scavenging is a technique that I use often&#8230; it&#8217;s practically replaced paper books as my method of learning new concepts. Sometimes I just use it as a means to understand a concept before working on a problem. I even used <a href="http://www.codeproject.com/cs/threads/BackgroundWorker_Threads.asp">a sample project</a> to learn how to use the BackgroundWorker helper class mentioned earlier. As I said in another blog post, &#8220;Just like a picture is worth a thousand words, a sample project is worth a thousand reference books&#8221;.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F11%2Fcode-scavenging-a-new-software-development-methodology%2F';
  addthis_title  = 'Code+Scavenging%3A+A+New+Software+Development+Methodology';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/11/code-scavenging-a-new-software-development-methodology/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>C++ Tips:  Pointers and Memory Management</title>
		<link>http://blog.slickedit.com/2007/11/c-tips-pointers-and-memory-management/</link>
		<comments>http://blog.slickedit.com/2007/11/c-tips-pointers-and-memory-management/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 14:52:34 +0000</pubDate>
		<dc:creator>Dennis B</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=175</guid>
		<description><![CDATA[If C++ programmers had a bill of rights, one of those rights would be stated &#8220;The Right to own and bear pointers.&#8221; As much as modern languages tout garbage collection and dispell themselves of the concept of a pointer, the fact remains that you will achieve better performance if you manage your own memory, and [...]]]></description>
			<content:encoded><![CDATA[<p>If C++ programmers had a bill of rights, one of those rights would be stated &#8220;<em>The Right to own and bear pointers</em>.&#8221; As much as modern languages tout garbage collection and dispell themselves of the concept of a pointer, the fact remains that you will achieve better performance if you manage your own memory, and pointers are a critical part of that.</p>
<p>This collection of tips come from the top of my head &#8212; think of it as the sort of advice I would pass on to my daughter if she ever found herself writing a memory intensive C++ application. For the record, she is six years old, so please, no complaining if this advice seems obvious or academic to you.</p>
<p>Oh, and disclaimer #2. This article is for C++ programmers only.</p>
<p><strong>1.</strong> <strong>Pointers need well defined owners </strong></p>
<p>Whenever you do an allocation it is important to identify an owner for that pointer &#8212; someone, something that is responsible to delete it when it is done with it. The owner also defines the pointer&#8217;s life span. Sometimes the ownership of an allocation can be by committee, for example, when you are using reference counting. Managing the lifetimes of allocations is the most important rule of memory management. If you consistently make ownership and lifetime absolutely clear and obvious in your code, you will avoid lots of headaches and bugs. This is the core of our second admendment rights, <em>the right to <strong>own</strong> and <strong>bear</strong> pointers</em>. The grantation of rights comes with a responsibility to bear. Treat pointers with the respect you would treat a firearm &#8212; and you may not find yourself shot in your own foot.</p>
<p><strong>2. Use const</strong></p>
<p>If you pass an object to a function by pointer and do not intend to modify the object, mark the object (not the pointer) as const.</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> doSomething<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> T<span style="color: #000040;">*</span> p<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666;">// do not modify *p</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Some programmer&#8217;s eschew const because they believe that they know better than to modify an object at an inappropriate time. That&#8217;s good for them, but if you have any real world experience, you know that you will not be the one maintaining your code for the rest of it&#8217;s life. Putting these guardrails in place will prevent a rooky from putting in a bad side-effect then asking to you to figure out why everything is broken.The disadvantage of using const is that it frequently will double the number of getters you need. A very typical C++ idiom is the const and non-const getter:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">class</span> someClass <span style="color: #008000;">&#123;</span><br />
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span><br />
&nbsp; &nbsp; <span style="color: #666666;">// ...</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">const</span> T<span style="color: #000040;">*</span> getSome<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">const</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; T<span style="color: #000040;">*</span> getSome<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #0000ff;">private</span><span style="color: #008080;">:</span><br />
&nbsp; &nbsp; T<span style="color: #000040;">*</span> m_t<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></div></td></tr></tbody></table></div>
<p>This class clearly owns a pointer to an object of type T, and it will only surrender that pointer on equal terms. You have to have a non-const reference to <em>someClass</em> to get a non-const pointer to <em>T</em>.A final warning about const. Avoid casting away const-ness. Sometimes, it will be unavoidable. Nevertheless, your mindset should not be <em>&#8220;oh, I just need to cast, ok, done.&#8221;</em> You should always say to yourself <em>&#8220;self, what have I done wrong? Maybe I am not using this code the way the author intended.&#8221;</em> If someone took to the trouble to make a variable const, they probably had a reason.</p>
<p><strong>3. Use the new, safer C++ style casts</strong></p>
<p>C++ is quite willing to let you cast any pointer type to any pointer type using conventional C casts. Using the new C++ style casts will help you insure that your casts are safe and sensible.</p>
<p><strong>4. Avoid pointer arithmetic</strong></p>
<p>There are two ways to walk over an array represented by a pointer. Some coder&#8217;s prefer this:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> iterateArray<span style="color: #008000;">&#40;</span>T<span style="color: #000040;">*</span> p, <span style="color: #0000ff;">int</span> n<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>n<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span>,p<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// do something with *p</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666;">// ...</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>This is fast, and effecient, but not easy to trace, especially when multiple pointers are involved. And, by the end of the for loop, you have lost the original value for <em>p</em>. Yes, you can recalculate it, or save and restore it, but that just adds to the complexity. I prefer this approach instead:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> iteratorArray<span style="color: #008000;">&#40;</span>T p<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span>, <span style="color: #0000ff;">int</span> n<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;">&lt;</span>n<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// do something with p[i]</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666;">// ...</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>This avoids the pointer arithmetic and is easier to read. Let the compiler identify the loop invariant and do the optimization for you. Some poor compiler engineer spent a lot of time working out that optimization. Think of that poor guy, or the next person who&#8217;s going to have to read your code. It&#8217;s also important to remember that the performance gains you get from using C++ and doing your own memory management will eclipse any peephole optimizations you can achieve using pointer arithmetic. Paraphrased: your code is already fast &#8212; now make it easy to read.</p>
<p><strong>5. Use new and delete</strong></p>
<p>Using new and delete ensures that constructors are executed, which ensures that your member variables are initialized. For C code, use <em>malloc</em> and <em>free</em>. There are situations where you will want to write your own allocation routines when you have to squeeze out an extra ounce of performance, but do so with discretion. Why is this important? Because if you do your own memory management, you are bound to make mistakes. There are tools that will help you, such as Rational&#8217;s Purify or Numega&#8217;s BoundsChecker, but often using your own memory management masks the precise origin and granularity of allocations from these tools.</p>
<p><strong>6. Beware of new[] and delete[]</strong></p>
<p>Many memory leaks and other crashes originate from inconsistent usage of the array allocation (scalar allocation) primitives. The most common mistake is using new[] to allocate and delete (non-scalar) to deallocate. The effect is that you construct an array of objects, then only destruct the first one. Depending on the nature of scalar new and delete, this may also segment memory, cause a crash, or throw a hard exception. The opposite error, using new to allocate and delete[] to deallocate will sometimes go undetected. But, again, it depends on the implement of scalar new and delete. I advise you to find or write an array or vector template class that you are comfortable with, and use that instead any time you are tempted to use new[] and delete[]. This is an area where C++ should have been more strongly typed. Currently the type returned by new T[n] is simply a pointer, T*; it should be an array T[]. Currently C++ makes little distinction between these two types. Distinguishing the types would have allowed the compiler to detect an improper use of delete. It would have also forced programmers to use the array type when they are treating memory as an array and a pointer when it is a pointer to a single item. Taking things one step further, operator[] would not even be allowed for pointer types.</p>
<p><strong>7. Bound arrays</strong></p>
<p>If you do not make use of an array or vector template class, you need to bound your arrays. I prefer to keep track of the number of items allocated. Avoid null terminated arrays &#8212; history should have taught us that lesson by now.</p>
<p><strong>8. Initialize pointers to NULL</strong></p>
<p>If you are not immediately initializing a pointer to a valid value, always initialize it to NULL. There is just no excuse other than laziness to write this:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">T<span style="color: #000040;">*</span> p<span style="color: #008080;">;</span></div></td></tr></tbody></table></div>
<p>instead of:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">T<span style="color: #000040;">*</span> p <span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008080;">;</span></div></td></tr></tbody></table></div>
<p>With optimizing compilers, it is very, very seldom that this will introduce even an extra cycle to the performance of your code, and will protect you from leaving a pointer un-initialized and later doing this:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>p<span style="color: #008000;">&#41;</span> <span style="color: #0000dd;">delete</span> p<span style="color: #008080;">;</span></div></td></tr></tbody></table></div>
<p>You should also assign pointers back to NULL after deleting them, like this:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000dd;">delete</span> p<span style="color: #008080;">;</span><br />
p <span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008080;">;</span></div></td></tr></tbody></table></div>
<p>Again, this traces back to pointer lifetimes. Pointer variables should be NULL whenever they are not pointing to valid memory. To take this to an extreme, I even like to do this in destructors. Think of it as analogous to wiping your fingerprints at the scene of a bank robbery. Leave the place as clean as it was before you showed up. Once memory is deleted, leave no trace that it ever existed.</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">someClass<span style="color: #008080;">::</span>~someClass<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000dd;">delete</span> m_t<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; m_t <span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>9. Always test pointers before using them</strong></p>
<p>Do:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> someFunction<span style="color: #008000;">&#40;</span>T <span style="color: #000040;">*</span>p<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> <span style="color: #000040;">!</span>p <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">// throw an exception or return an error</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; p<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>doSomething<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Avoid:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> someFunction<span style="color: #008000;">&#40;</span>T <span style="color: #000040;">*</span>p<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; p<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>doSomething<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>This is another peephole optimization that some lazy programmers defend. I admit, there is some merit to the optimization, it avoid a branch test, and we all know that branches clog CPU pipelines. However, unless the function&#8217;s contract (documentation) specifies that it can not handle a NULL pointer, you need to be prepared to handle the case in an appropriate manner. A good rule of thumb is to only use pointers when the object is optional to the function.</p>
<p><strong>10. Use pass by reference for non-NULL objects</strong></p>
<p>Do:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> someFunction<span style="color: #008000;">&#40;</span>T <span style="color: #000040;">&amp;</span>p<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; p.<span style="color: #007788;">doSomething</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Avoid:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> someFunction<span style="color: #008000;">&#40;</span>T <span style="color: #000040;">*</span>p<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; p<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>doSomething<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Using a reference type makes it clear that <em>someFunction</em> expects a non-NULL object by contract. This also avoids the pointer check mentioned in the previous section.</p>
<p><strong>11. Avoid acquiring pointers to non-heap memory</strong></p>
<p>Avoid:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">void</span> someFunction<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> a<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> <span style="color: #000040;">*</span>p <span style="color: #000080;">=</span> <span style="color: #000040;">&amp;</span>a<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #666666;">// do a bunch of stuff</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Otherwise, you may forget that p is pointing to an object whose life is over when the function returns, which will lead to all kinds of dangerous things.</p>
<p><strong>Summary</strong></p>
<p>There is a great deal of over-inflated talk about the dangers of using pointers and the difficulty of doing your own memory management. <em>Experienced</em> Java programmers will even tell you that if you don&#8217;t know how to manage memory correctly and establish documented lifetimes for objects, you will have all kinds of memory problems including leaks and painful garbage collection delays. That advice is coming from people who have garbage collection. I submit that learning how to manage memory well is a skill that is actually <em>easier</em> to learn by programming in C++ and using pointers in a sensible manner. These skills are not arcane remnants of a programming language that is past it&#8217;s prime. They will make you a better programmer in whatever language you need to use in the future.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F11%2Fc-tips-pointers-and-memory-management%2F';
  addthis_title  = 'C%2B%2B+Tips%3A++Pointers+and+Memory+Management';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/11/c-tips-pointers-and-memory-management/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>C# with SlickEdit : No Visual Studio Required</title>
		<link>http://blog.slickedit.com/2007/11/c-with-slickedit-no-visual-studio-required/</link>
		<comments>http://blog.slickedit.com/2007/11/c-with-slickedit-no-visual-studio-required/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 17:13:12 +0000</pubDate>
		<dc:creator>Matthew E</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=163</guid>
		<description><![CDATA[&#8220;No Visual Studio® Required&#8221; SlickEdit C# Project Tutorial In this tutorial, we&#8217;ll build a simple C# console application with SlickEdit. This tutorial assumes you have the .NET Framework 2.0 and the C# compiler (Csc.exe) installed under %WINDIR%\Microsoft.NET\Framework\v2.0.50727. The Windows SDK (v6.0 or later) or the full .NET Framework SDK is required for the mdbg.exe managed [...]]]></description>
			<content:encoded><![CDATA[<h2>&#8220;No Visual Studio<sup>®</sup> Required&#8221;</h2>
<h3>SlickEdit C# Project Tutorial</h3>
<p>In this tutorial, we&#8217;ll build a simple C# console application with SlickEdit. This tutorial assumes you have the .NET Framework 2.0 and the C# compiler (Csc.exe) installed under <font face="Courier New">%WINDIR%\Microsoft.NET\Framework\v2.0.50727</font>. The Windows SDK (v6.0 or later) or the full .NET Framework SDK is required for the mdbg.exe managed code debugger.</p>
<h4>Conventions</h4>
<p>Dark blue italics represent menu commands: <strong><em><font size="2" color="#330066">File &gt; New</font></em></strong><br />
Bold items represent names of dialog buttons, labels, and controls: <strong><font size="2">Location:</font></strong><br />
<font face="Courier New">Monospaced fonts</font> are used for environment variables, file paths and names, and text that you type into dialog controls:<br />
Several screenshot <img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="Screenshot" height="16" /> links are provided that show how the dialogs are used.</p>
<h4>Creating the starter project</h4>
<ul>
<li>In SlickEdit, go to <strong><em><font size="2" color="#330066">Project &gt; New</font></em></strong>. Create a <strong>(generic)</strong> project. <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/newproj.png" title="newproj.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="newproj.png" height="16" /></a> You probably want to use the <strong><font size="2">Create </font></strong><strong><font size="2">project directory from project name option. Change the <strong><font size="2">Location:</font></strong> to a </font></strong>directory where you want the project to go. Click <strong><font size="2">OK</font></strong> to create the starter project. Dismiss the project properties dialog if it appears afterwards.</li>
<li>Go to <strong><em><font size="2" color="#330066">File &gt; New Item from template&#8230;</font></em></strong> <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/newitem.png" title="newitem.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="newitem.png" height="16" /></a> Under <strong>Installed Templates \ CSharp</strong>, highlight the <strong>C# Main Entry Point</strong> template. Change the Name in the lower portion of the dialog, and check the &#8220;Add to current project&#8221; checkbox. Click Add, and the new file will be created. It should appear under the <em>Source Files</em> project folder. Edit the Main() method. Add the following code inside the Main()
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080;">#if DEBUG</span><br />
Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World - Debug&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008080;">#else</span><br />
Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World - Release&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008080;">#endif</span></div></td></tr></tbody></table></div>
</li>
<li>Go to <strong><em><font size="2" color="#330066">Project &gt; Workspace Properties </font></em></strong>to display the workspace properties dialog. A SlickEdit Workspace (.vpw) is the equivalent of a Solution (.sln) in Visual Studio. Click the <strong><font size="2">Environment</font></strong> button to display the Workspace Environment Options dialog.</li>
<li>Click <strong><font size="2">Set Environment Variable </font></strong>. Create a new variable named <font face="Courier New">DOTNETDIR </font>, and point it to your .NET framework that you want to use for the C# compiler, like <font face="Courier New">C:\Windows\Microsoft.NET\Framework\v2.0.50727</font>. <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/wkspcenv.png" title="wkspcenv.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="wkspcenv.png" height="16" /></a> To use an existing environment variable in the definition of the workspace environment use the <font face="Courier New">%(VARIABLE) </font>syntax, and not the <font face="Courier New">%VARIABLE% </font>syntax. For example: <font face="Courier New">%(WINDIR)\Microsoft.NET\Framework\v2.0.50727<br />
</font>Be sure to select environment variable names that do not already exist.</li>
<li>Create another variable named <font face="Courier New">WINSDKDIR</font> , and point it to the Windows SDK or .NET Framework SDK, like <font face="Courier New">C:\Program Files\Microsoft SDKs\Windows\v6.0</font> . You want this to be a directory where the <font face="Courier New">mdbg.exe</font> managed code debugger can be found.</li>
<li>Click <strong><font size="2">OK</font></strong>. You will be prompted that you need to close and reopen the workspace for the variables to be set.</li>
</ul>
<h4>Setting up the build command</h4>
<ul>
<li>Once you&#8217;ve closed and reopened the workspace, go to <strong><em><font size="2" color="#330066">Project &gt; Properties </font></em></strong>to show the dialog. In the <strong><font size="2">Settings for: </font></strong>combo, select Release, which should be the only other choice right now.</li>
<li>Go to the <strong><font size="2">Tools </font></strong>tab and remove the Compile and Rebuild tools. (Use the red X button) This should leave Build, Debug, and Execute.</li>
<li>Highlight the <strong><font size="2">Build</font></strong> tool. <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/relbld1.png" title="relbld1.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="relbld1.png" height="16" /></a> Change the <strong><font size="2">Command line:</font></strong> entry field to the following:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">%(DOTNETDIR)\csc.exe /warn:3 /target:exe /define:TRACE /debug- /out:%bdSeHello.exe %{*.cs}</div></td></tr></tbody></table></div>
<p>The <font face="Courier New">%bd</font> in the above command line is a variable that represents the build output directory, in this case <font face="Courier New">Release\</font>.<br />
The <font face="Courier New">%{*.cs}</font> construct means all project files that end with the .cs extension</li>
<li>Replace <em>SeHello.exe</em> with whatever you want the exe to be named. You shouldn&#8217;t need to change the <strong><font size="2">Run from dir:</font></strong> entry field as it should already be <font face="Courier New">%rw</font></li>
<li>Make sure the <strong><font size="2">Capture Output</font></strong> and <strong><font size="2">Output to build </font></strong><strong><font size="2">window</font></strong> options are selected.</li>
<li>Highlight the <strong><font size="2">Execute </font></strong>tool. <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/relbld2.png" title="relbld2.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="relbld2.png" height="16" /></a> Change the command line to <font face="Courier New">&#8220;SeHello.exe&#8221;</font>, or whatever your exe output name is from the Build tool command line. Change the <strong><font size="2">Run from dir:</font></strong> option to <font face="Courier New">%bd</font></li>
<li>Make sure the <strong><font size="2">Capture Output </font></strong>and <strong><font size="2">Output to build </font></strong><strong><font size="2">window</font></strong> options are selected.</li>
<li>Click <strong><font size="2">OK</font></strong> to close the dialog and save the changes. You should now be able to execute a build from <strong><em><font size="2" color="#330066">Build &gt; Build</font></em></strong> , and see the output of the C# compiler. If the build succeeds, <strong><em><font size="2" color="#330066">Project &gt; Execute </font></em></strong>should run the console program and display the <font face="Courier New">&#8220;Hello World-Release&#8221; </font>results.</li>
</ul>
<h4>Setting up the debug build</h4>
<ul>
<li>Open the project properties dialog again, and click <strong><font size="2">Configurations </font></strong>. Click <strong><font size="2">New </font></strong>to create the Debug configuration, and copy the settings for the Release configuration.</li>
<li>Click <strong><font size="2">OK</font></strong> to create the Debug config, and dismiss the dialogs.</li>
<li>Back on the project properties dialog, highlight the <strong><font size="2">Tools </font></strong>tab, and select Debug from the <strong><font size="2">Settings for: </font></strong>combo box.</li>
<li>Highlight the <strong><font size="2">Build </font></strong>tool name <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/dbgbld1.png" title="dbgbld1.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="dbgbld1.png" height="16" /></a>, and change the <strong><font size="2">Command line: </font></strong>entry field to:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">%(DOTNETDIR)\csc.exe /warn:3 /target:exe /define:DEBUG;TRACE /debug+ /out:%bdSeHello.exe %{*.cs}</div></td></tr></tbody></table></div>
<p>All we did was add the <font face="Courier New">DEBUG</font> define and change <font face="Courier New">/debug-</font> to <font face="Courier New">/debug+</font>. Again, use your exe name in place of <em>SeHello.exe</em> if you want.</li>
<li>Highlight the <strong><font size="2">Execute</font></strong> tool name, and make sure it is the same as you set up for the Release configuration.</li>
<li>Click <strong><font size="2">OK</font></strong> to save and close the project properties.</li>
<li>Go to <strong><em><font size="2" color="#330066">Build &gt; Set Active Configuration &#8230;</font></em></strong> and select Debug.</li>
<li>Execute the <strong><em><font size="2" color="#330066">Build &gt; Build</font></em></strong> command. If the build suceeds, run the <strong><em><font size="2" color="#330066">Build &gt; Execute</font></em></strong> command. You should see the <font face="Courier New">&#8220;Hello World &#8211; Debug&#8221;</font> output in the build window.</li>
</ul>
<h4>Setting up the console debugger</h4>
<ul>
<li>Back on the project properties dialog, highlight the <strong><font size="2">Tools</font></strong> tab, and select Debug from the <strong><font size="2">Settings for:</font></strong> combo box.</li>
<li>Highlight the <strong><font size="2">Debug</font></strong> tool name, <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/dbgbld2.png" title="dbgbld2.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="dbgbld2.png" height="16" /></a> and change the <strong><font size="2">Command line:</font></strong> entry field to:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">%(WINSDKDIR)\Bin\mdbg.exe SeHello.exe</div></td></tr></tbody></table></div>
<p>Again, change <em>SeHello.exe</em> to your exe name as needed. <strong><font size="2">Run from dir:</font></strong> should be set to <font face="Courier New">%bd</font></li>
<li>Make sure the <strong><font size="2">Capture Output</font></strong> and <strong><font size="2">Output to build </font></strong><strong><font size="2">window</font></strong> options are selected.</li>
<li>Click <strong><font size="2">OK</font></strong> to save and close the project properties.</li>
<li>Run the <strong><em><font size="2" color="#330066">Build &gt; Debug </font></em></strong>command. The build window should have focus with a blinking cursor just after the first <font face="Courier New">mdbg&gt; </font>prompt.</li>
<li>Enter the following commands in order, pressing <font face="Courier New">&lt;enter&gt;</font> after each one.
<ul>
<li><font face="Courier New">print args</font> to show the value of the args variable.</li>
<li><font face="Courier New">next</font> to do a step over</li>
<li><font face="Courier New">go</font> to continue execution</li>
<li><font face="Courier New">quit</font> to quit the debugger (IMPORTANT!)</li>
</ul>
</li>
<li>The entire debug session output should look like the following.</li>
</ul>
<p><font face="Courier New">C:\Dev\Lab\TestProjects\SeHello\Debug<br />
&gt; C:\WinSDK\Bin\mdbg.exe SeHello.exe<br />
MDbg (Managed debugger) v2.0.50727.312 (rtmLHS.050727-3100) started.<br />
Copyright (C) Microsoft Corporation. All rights reserved.<br />
For information about commands type &#8220;help&#8221;;<br />
to exit program type &#8220;quit&#8221;.<br />
run SeHello.exe<br />
STOP: Breakpoint Hit<br />
16: static void Main(string[] args) {<br />
[p#:0, t#:0] mdbg&gt; <strong><font color="#00008b">print args</font></strong><br />
args=array [0]<br />
[p#:0, t#:0] mdbg&gt; <strong><font color="#00008b">next</font></strong><br />
19: Console.WriteLine(&#8220;Hello World &#8211; Debug&#8221;);<br />
[p#:0, t#:0] mdbg&gt; <strong><font color="#00008b">go</font></strong><br />
Hello World &#8211; Debug<br />
STOP: Process Exited<br />
mdbg&gt; <strong><font color="#00008b">quit</font></strong><br />
C:\Dev\Lab\TestProjects\SeHello\Debug<br />
&gt;</font></p>
<h4>Handling complex build commands</h4>
<p>A small console application like this one doesn&#8217;t have any extensive dependencies, and most of the default options for the C# compiler are fine. However, more complex projects will require many more options to be passed on the command line. For these cases, it can be useful to create an options file for all of the command line switches.</p>
<ul>
<li>Go to <strong><em><font size="2" color="#330066">File &gt; New</font></em></strong> to create a new text file and add it to the project. <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/dbgopts.png" title="dbgopts.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="dbgopts.png" height="16" /></a> For this example, we&#8217;ll create the command line options for the debug build in a file called <font face="Courier New">Debug.opts</font></li>
<li>Edit the new options file and put in the following contents, which should match your first few options on the Debug build command line:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/warn:3 /target:exe /define:DEBUG;TRACE /debug+</div></td></tr></tbody></table></div>
</li>
<li>Open the Project Properties dialog to the <strong><font size="2">Tools</font></strong> tab, select the Debug configuration, and highlight the Build tool. <a rel="lightbox[pics163]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/dbgopts2.png" title="dbgopts2.png"><img width="16" src="http://blog.slickedit.com/wp-content/uploads/2007/10/cam16.png" alt="dbgopts2.png" height="16" /></a> Change the build command to:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">%(DOTNETDIR)\csc.exe @Debug.opts /out:%bdSeHello.exe %{*.cs}</div></td></tr></tbody></table></div>
</li>
<li>You can now run the <strong><em><font size="2" color="#330066">Build &gt; Build</font></em></strong> command to make sure the options file was correctly read.</li>
</ul>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F11%2Fc-with-slickedit-no-visual-studio-required%2F';
  addthis_title  = 'C%23+with+SlickEdit+%3A+No+Visual+Studio+Required';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/11/c-with-slickedit-no-visual-studio-required/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>East Bound and Down&#8230; (some joke about &#8220;codin&#8221;)</title>
		<link>http://blog.slickedit.com/2007/10/east-bound-and-down-some-joke-about-codin/</link>
		<comments>http://blog.slickedit.com/2007/10/east-bound-and-down-some-joke-about-codin/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 13:17:28 +0000</pubDate>
		<dc:creator>Dan H</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SlickEdit Products]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=114</guid>
		<description><![CDATA[In this industry, we have to be very careful which features we select to add to our products each release.  Even with the growing amount of time and scrutiny dedicated to choosing these features, we occasionally miss the mark.  As an illustration of this point, I am going to talk about Coors, and Smokey and [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffsetup1.JPG" title="diffsetup1"></a><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput1.JPG" title="diffoutput1"></a><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffsetup1.JPG" title="diffsetup1"></a><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput1.JPG" title="diffoutput1"></a><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput21.JPG" title="diffoutput2"></a>In this industry, we have to be very careful which features we select to add to our products each release.  Even with the growing amount of time and scrutiny dedicated to choosing these features, we occasionally miss the mark.  As an illustration of this point, I am going to talk about Coors, and Smokey and the Bandit.  Try to stick with me until the end where I will try to tie all this together.  At the very least, you will understand why I am not a teacher.</p>
<p><a href="http://en.wikipedia.org/wiki/Coors_Brewing_Company">The Coors Brewing Company of of Golden, Colorado, USA</a>, had a fairly profound impact on the thirty-somethings in the world like myself.  You see, we have been led to believe for thirty years or so that it was once illegal to transport Coors beer East of Texas.  As far as I can tell, this was never true (although it was <a href="http://en.wikipedia.org/wiki/Coors_Brewing_Company#History">not nationally available until sometime in the 1990s</a>).  Nonetheless it was the plot of the hit 1977 movie Smokey and the Bandit.  And when I say &#8220;hit 1977 movie&#8221;, it was the second highest grossing movie of that year.  Star Wars was number one.  It is not Scorcese or [fill in name of artsy director you like here], but it was a big deal.</p>
<p>I don&#8217;t want to get off on a big tangent here, but a small one is necessary, stick with me.  For anybody who did not get basic cable over the last thirty years, the basic plot is as follows:</p>
<ul>
<li>It is illegal to ship Coors beer East of Texas</li>
<li>Burt Reynolds and Jerry Reed are paid a large some of money to get 400 cases Coors beer from Texarkana, Texas to Atlanta, Georgia in twenty-eight hours</li>
<li>Burt Reynolds distracts cops from the speeding eighteen wheeler carrying the 400 cases of beer by performing really cool stunts in a 1977 Trans Am
<ul>
<li>In order to keep a low profile, the eighteen wheeler is painted with a mural of a masked bandit robbing a stagecoach.</li>
</ul>
</li>
<li>Jerry Reed sings his hit song, &#8220;East Bound and Down&#8221;</li>
<li>Hillarity insues</li>
</ul>
<p>Sounds ridiculous right?  Well, it does lack the realism of &#8220;Die Hard&#8221;, but it is actually not a bad movie provided that:</p>
<ol>
<li>You are a guy<a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput21.JPG" title="diffoutput2"></a></li>
<li>When you watch a movie you want to be entertained and don&#8217;t question things too much.</li>
</ol>
<p>But the point here is that history was changed:</p>
<ul>
<li>The mystique of Coors beer was further boosted to those who could not get it East of Texas.  Here I need to emphasize that people thought it was really illegal to take Coors beer East of Texas.</li>
<li>The Trans-Am became as cool as the (<a href="http://en.wikipedia.org/wiki/Evel_Knievel#Retirement.28s.29">then recently jailed</a>) <a href="http://en.wikipedia.org/wiki/Evel_Knievel">Evel Knievel</a> with suburban pre-teens across America.</li>
<li>Jerry Reed had a hit single.</li>
</ul>
<p>As much as I love old Trans-Ams, and that song, what I want to focus on is the first item in that list: People believed that it was illegal to take Coors beer East of Texas.  This is one of the standout facts people in the United States know about Coors beer.  What they do not know is this: in 1959 Coors was the first beverage in America to be packaged in a <a href="http://en.wikipedia.org/wiki/Aluminum_can">two-piece aluminum can</a>.  These cans are a part of common life today.  There are two on my desk right this minute (diet soda, not beer).  They are so common place people my age really cannot picture a world without them.  A world where I am told you had to use a can opener (one of the pointy triangluar ones, not the rotating ones with a blade) simply to drink a beverage.  I imagine the people at The Coors Brewing Company of of Golden, Colorado are proud of having introduce this convenient, and recyclable, can.  But far more people remember that it was illegal to ship Coors beer East of Texas (and when I say &#8220;far more people&#8221;, I  mean &#8220;me&#8221;).</p>
<p>What could this <em>possibly </em>have to do with software development?  It can be difficult to figure out what people will latch onto.  In my tenure at SlickEdit, I have seen a lot of sleep lost over features that did not make quite the splash we hoped they would.  Thankfully none of these turned out to be as big a blunder as the <a href="http://en.wikipedia.org/wiki/Edsel">Edsel</a>.  I will share the one that personally hit me the hardest though:</p>
<ol>
<li>Launch SlickEdit&#8217;s DIFFzilla® setup dialog (Tools&gt;File Difference)</li>
<li>Fill in &#8220;Path 1&#8243; and &#8220;Path 2&#8243; with any two files that SlickEdit tags</li>
<li>Click the &#8220;Symbols&#8221; radio button at the top left</li>
<p style="text-align: center"><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffsetup1.JPG" title="diffsetup1"><img width="200" src="http://blog.slickedit.com/wp-content/uploads/2007/10/diffsetup1.thumbnail.JPG" alt="diffsetup1" height="115" class="imageframe imgalignleft" /></a></p>
<p><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffsetup1.JPG" title="diffsetup1"></a></p>
<li>Clicking OK will yield output that actually show changes on a <em>symbol</em> level, including modified functions and added/deleted functions.</li>
<p><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput1.JPG" title="diffoutput1"></a><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput1.JPG" title="diffoutput1"></a></p>
<p style="text-align: center"><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput1.JPG" title="diffoutput1"><img width="200" src="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput1.thumbnail.JPG" alt="diffoutput1" height="125" class="imageframe imgalignleft" /></a></p>
<p><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput1.JPG" title="diffoutput1"></a></p>
<li>Selecting an item from this list and clicking &#8220;Diff&#8221; will actually compare just those two functions in the DIFFzilla output dialog.</li>
<p><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput21.JPG" title="diffoutput2"></a><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput21.JPG" title="diffoutput2"></a></p>
<p style="text-align: center"><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput21.JPG" title="diffoutput2"><img width="200" src="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput21.thumbnail.JPG" alt="diffoutput2" height="125" class="imageframe imgalignleft" /></a></p>
<p><a rel="lightbox[pics114]" href="http://blog.slickedit.com/wp-content/uploads/2007/10/diffoutput21.JPG" title="diffoutput2"></a></ol>
<p>This can be convenient for a number of reasons.  Sometimes a function moved, and the file itself has changed so much diffing two whole files just confuses matters.  This feature will shine in those cases.</p>
<p>I thought this would be a hit.  Everybody here thought it was a neat idea, and I worked feverishly to sneak this into the 8.0 release.  It was not a hit.  In fact, I am not certain that a user has ever actually used this feature.  It is generally good for a &#8220;wow&#8221; or two at a trade show though.</p>
<p>The moral of the story?  Be careful when you choose to add features.  The <a href="http://en.wikipedia.org/wiki/Aluminum_can">two-piece aluminum can</a> may not look nearly as flashy as a 1977 Trans-Am, but people will still be using it 50 years later.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F10%2Feast-bound-and-down-some-joke-about-codin%2F';
  addthis_title  = 'East+Bound+and+Down%26%238230%3B+%28some+joke+about+%26%238220%3Bcodin%26%238221%3B%29';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/10/east-bound-and-down-some-joke-about-codin/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Error Reports: To Send or Not to Send?</title>
		<link>http://blog.slickedit.com/2007/10/error-reports-to-send-or-not-to-send/</link>
		<comments>http://blog.slickedit.com/2007/10/error-reports-to-send-or-not-to-send/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 13:43:26 +0000</pubDate>
		<dc:creator>Sandra</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=116</guid>
		<description><![CDATA[Most everyone is familiar with the Microsoft error reporting dialog. It tells you that something terrible has happened with application.exe, and that Windows was forced to terminate it. You&#8217;re given a humble apology, as well as a plea to help yourself and users just like you by reporting the problem so it can be fixed. [...]]]></description>
			<content:encoded><![CDATA[<p>Most everyone is familiar with the Microsoft error reporting dialog. It tells you that something terrible has happened with application.exe, and that Windows was forced to terminate it. You&#8217;re given a humble apology, as well as a plea to help yourself and users just like you by reporting the problem so it can be fixed.</p>
<p>I vary on my reaction to the dialog. It&#8217;s rarely unexpected, as usually the application in question was not responding anyway. But do I send the report? If I know that Microsoft is just going to send me a link that says &#8220;Not our problem! Maybe you should talk to the losers who made the software!&#8221; then no. If the problem is a mystery to me, then I might send it just for kicks.</p>
<p>If it&#8217;s a Microsoft program that crashed, then I send the crap out of it. I was having an issue with Word a few weeks back, where it crashed anytime I opened a specific file. I was so frustrated that I would purposefully cause the crash, just so I could send another bug report. I no longer cared whether I could edit the file, as long as Microsoft knew that I couldn&#8217;t do it. Do I have your attention now, Mr. Gates? Is the problem fixed yet? Logically I know that sending the same report from the same computer ten times in one hour probably does not mean instant results. But like bringing down a shoe on one cockroach when you know he&#8217;s got a million friends somewhere, it just makes you <em>feel</em> better.</p>
<p>But sometimes, I get another experience with the dialog box, one altogether unique to programmers. The application in question was mine. It crashed because of something that I did. So now I have Microsoft apologizing for my behavior and asking if I would like to turn myself in. Uh, no, thanks, that&#8217;s quite all right. I&#8217;m just glad there&#8217;s no way for Windows to detect that I was running my own program, or I&#8217;d get a different message entirely.</p>
<p><img width="503" src="http://blog.slickedit.com/wp-content/uploads/2007/08/myerror.png" alt="myerror.png" height="269" /></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F10%2Ferror-reports-to-send-or-not-to-send%2F';
  addthis_title  = 'Error+Reports%3A+To+Send+or+Not+to+Send%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/10/error-reports-to-send-or-not-to-send/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Mythical Year of Experience</title>
		<link>http://blog.slickedit.com/2007/10/the-mythical-year-of-experience/</link>
		<comments>http://blog.slickedit.com/2007/10/the-mythical-year-of-experience/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 13:08:01 +0000</pubDate>
		<dc:creator>Scott Westfall</dc:creator>
				<category><![CDATA[Dev Management]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=125</guid>
		<description><![CDATA[In one of the greatest books ever written about software development, “The Mythical Man Month”, Fred Brooks refutes the premise that effort can be quantified in “man months”, the amount of work done by one person in one month. The central flaw is illustrated as follows: if a woman can have a baby in 9 [...]]]></description>
			<content:encoded><![CDATA[<p>In one of the greatest books ever written about software development, “<a href="http://en.wikipedia.org/wiki/The_Mythical_Man-Month">The Mythical Man Month</a>”, Fred Brooks refutes the premise that effort can be quantified in “man months”, the amount of work done by one person in one month. The central flaw is illustrated as follows: if a woman can have a baby in 9 months, then 9 women should be able to have a baby in 1 month. The core problem is that not all tasks can be reduced into parallel subtasks. Even when they can, breaking work into smaller units often adds overhead.</p>
<p>In a similar vein, I’d like to expose the myth of the so-called “year of experience”. In hiring, this is the basic unit used to measure ability. Look on almost any job posting and you will see years of experience required in something. Some postings use this metric sparingly, requiring a number of years of experience overall or in a single key technology, like 3 years of C++. Some postings carry this to such an extreme that you wonder if anyone could have that magical combination of experience. Thankfully, you don’t see this as much as you used to. Some ask for ridiculous amounts of experience in some areas. A few years back I even saw a posting for a Java position requiring more years of experience than Java had been around!</p>
<p>What companies need is someone with a certain level of expertise. But how do you quantify expertise, particularly in technical fields with broad areas of knowledge? That’s where the mythical year of experience comes in. It may not be accurate, but it is quantifiable and easily verified from a candidate’s work history.</p>
<p>The reliance on Human Resource departments may also explain the popularity of using years of experience, particularly in technical domains. In general, HR representatives aren’t engineers. They don’t truly understand what we do for a living and are unable to tell a good engineer from a bad one. But it’s their job to screen candidates and provide suitable ones to hiring managers. So some criterion must be used to filter out unsuitable candidates.</p>
<p><strong>Experience != Expertise</strong></p>
<p>There is an assumption that a certain amount of experience will produce the desired expertise. However, experience does not produce expertise! Experience is important in developing expertise, but expertise requires that the person has the will and ability to extend their knowledge and refine their abilities. Without this, experience just reinforces your current methods.</p>
<p>On one project, I worked with a person who was responsible for doing the builds, who had been working on this project for 5 years. In that period, the approach used hadn’t changed significantly since the first year. I’m sure he claims 5 years of experience for that work, but it really should be considered 1 year of experience with 4 years of repetition. I’m not saying that the build process needed any changes or improvements. My point is that repeating the same activity over and over should not count as experience. It certainly does nothing to further your expertise.</p>
<p>By focusing on years of experience rather than needed expertise, you may even rule out better candidates. Say that a position has a stated requirement of 3 years of experience in C++. The best programmers learn new languages and technologies quickly. Indeed, a great programmer will have a better understanding of a new language after six months than the average programmer would have after three years!</p>
<p>Most technologies don’t take several years to master. When learning a new technology, the early part of the learning curve is the most intense. By the end of the first year, most people are in the incremental learning cycle where they are picking up knowledge very slowly. From my observations, there is little difference between the knowledge a person has after 1 year of using a technology and after using it for 3 years&#8211;unless something motivates them to learn more. Even great programmers are in the incremental learning phase by the end of the first year, but they have attained a higher level of understanding in that period than many others will gain in a lifetime.</p>
<p>In my career, I’ve interviewed many C++ programmer candidates. Most have done little to extend their knowledge past their initial training, often a training class that lasted a week or two. Most have never read any books on the language, other than the book they used to initially learn the language. It’s rare for me to interview programmers who have read even a single book on Object-Oriented Programming. For a person like that, 3 years of experience will not lead to much expertise—unless their project provides an exceptional opportunity to learn from more knowledgeable developers.</p>
<p>The rate at which someone learns a new technology is one of the most important factors in recognizing top programmers. Even if you could write the perfect job description and pin down the exact combination of knowledge and abilities for the current project, that mixture will be out of date when the next project comes along. It’s not uncommon for technologies to change even during the scope of a single project. When it does, what good was that carefully crafted combination of skills?</p>
<p><strong>Yes, Experience Does Matter</strong></p>
<p>This doesn’t mean that experience is unimportant. Experience allows us to learn from mistakes. It provides opportunities for problem solving. Just as important as the knowledge of how to do something is your trouble-shooting ability when things go wrong. This knowledge is often best gained through experience.</p>
<p>Even so, you can’t measure this experience solely in terms of time. It has more to do with the number of lines of code you’ve written and the number of unique technical challenges you have faced than the number of years you’ve done something. Given two programmers with 5 years of experience, the one who has written hundreds of thousands of lines of code will generally be more experienced than the one who has written tens of thousands. Likewise, a programmer who has worked on several projects in that timeframe will likely be more experienced than one who has worked on the same project.</p>
<p>When writing job descriptions, I use years of experience only for the overall number of years as a programmer. This is an effort to factor in the lessons learned from experience. Even then, I’m always watching out for the highly talented person who has come by their knowledge and experience faster than their peers.</p>
<p><strong>What Does This Mean for Me?</strong></p>
<p>In your career, don’t assume that years of experience is enough. Push the learning curve as hard as you can. When you are learning a new technology, seek out the books or other materials in that area that can give you knowledge that would take years to learn on your own (if ever). Use the work you do each day to drive your learning. For example, if you’re writing a new C++ class and you’re unsure whether to overload the copy constructor, use that as a reason to really learn the best approach. Don’t settle for mediocre knowledge.</p>
<p>Having pushed the learning curve, don’t be intimidated if the years of experience don’t match your background when you apply for a position. Stress to the recruiter that you have the knowledge that someone with the specified years of experience would have. Be sure you can back that up in interviews, though. Savvy hiring managers will quickly spot a pretender.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F10%2Fthe-mythical-year-of-experience%2F';
  addthis_title  = 'The+Mythical+Year+of+Experience';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/10/the-mythical-year-of-experience/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Using Binary Search to Debug Compiler Crashes</title>
		<link>http://blog.slickedit.com/2007/10/using-binary-search-to-debug-compiler-crashes/</link>
		<comments>http://blog.slickedit.com/2007/10/using-binary-search-to-debug-compiler-crashes/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 12:51:58 +0000</pubDate>
		<dc:creator>Dennis B</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=124</guid>
		<description><![CDATA[If you have used g++ and gcc over the years, you know that sometimes you get the worst compiler error of all: 1g++: Internal error: Segmentation Fault (program cc1plus) While this message is very friendly and informative, it doesn&#8217;t help you get your code compiled. So, what do you do when your code masterpiece, for [...]]]></description>
			<content:encoded><![CDATA[<p>If you have used g++ and gcc over the years, you know that sometimes you get the worst compiler error of all:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">g++: Internal error: Segmentation Fault (program cc1plus)</div></td></tr></tbody></table></div>
<p>While this message is very friendly and informative, it doesn&#8217;t help you get your code compiled.</p>
<p>So, what do you do when your code masterpiece, for whatever reason, crashes the compiler. This typically happens, not when you are writing code, but when you update to a newer version of the compiler and amid your efforts to port your code base to the new compiler, the compiler dies.</p>
<p>Your first reaction will probably be to ask your boss if you can go home for the day &#8212; see if your luck will be better tomorrow. This is a good strategy, even though it seldom produces a solution to the problem (even if it does mysteriously solve the problem, it&#8217;s a little unnerving) &#8212; either way, you might get a half day off. Everyone needs a break once in a while.</p>
<p>Your second reaction will be to pass the problem on to someone more senior or someone more junior who might have more experience or time to deal with this kind of problem. Another good strategy &#8212; in the meantime, you can go get some coffee.</p>
<p>Your third reaction will be to find the person who wrote that code and ask him what he was thinking. &#8220;Do you have to solve everything with template meta-programming? Here, fool, let me show you how to write a for loop.&#8221; Another good strategy, it feels good to yell at people, it releases stress. And, if they are actually using template meta-programming where they could just use a for loop, they deserve it.</p>
<p>Your fourth and final reaction will be to dig into the code and solve the problem. You know which file it is crashing on, but since the compiler crashed, it doesn&#8217;t report a line number, so all you know is that you have a 20,000 lines of code with something the compiler doesn&#8217;t like buried in it. Here is a technique I learned from my brother who was writing code before most of you were wearing digital watches.</p>
<p>Put your computer science skills to use and do some divide and conquer. First #if 0 out the last 10,000 lines (breaking at a logical boundary, of course), see if it compiles without crashing. If it compiles, the problem is in the last half of the file so move your #if 0 somewhere around line 15000. If the compiler crashes, the problem is in the first half, move your #if 0 somewhere around line 5000. Repeat this binary search until you narrow down to a single statement or small section of code that causes the compiler to crash.</p>
<p>Then all you have to do is figure out the best way to restructure that code so the compiler can handle it. This could involve some guesswork and you should talk to the guy who you yelled at back in reaction three to get his opinion. By the way, you should probably remember this moment of humility the next time you hit stage three with a bug like this.</p>
<p>Now that you have solved this problem, you might want to narrow it down further and report the compiler crash to the compiler vendor or the gcc-bugs mailing list. Oh, yeah, and tell your boss what a tough problem you just solved &#8212; he might just give you another half day off.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F10%2Fusing-binary-search-to-debug-compiler-crashes%2F';
  addthis_title  = 'Using+Binary+Search+to+Debug+Compiler+Crashes';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/10/using-binary-search-to-debug-compiler-crashes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comfort, Habits and Ruts in Software Development</title>
		<link>http://blog.slickedit.com/2007/10/comfort-habits-and-ruts-in-software-development/</link>
		<comments>http://blog.slickedit.com/2007/10/comfort-habits-and-ruts-in-software-development/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 12:39:25 +0000</pubDate>
		<dc:creator>Scott Hackett</dc:creator>
				<category><![CDATA[Code Editors]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=98</guid>
		<description><![CDATA[Some years ago, I worked on software used by a separate department within the company. It was a great program, but it ran behind an ugly console interface. Myself and the other programmers proposed a windowed interface which made a world of difference to the program&#8217;s workflow. &#8220;It&#8217;s not going to happen,&#8221; said our manager. [...]]]></description>
			<content:encoded><![CDATA[<p>Some years ago, I worked on software used by a separate department within the company. It was a great program, but it ran behind an ugly console interface. Myself and the other programmers proposed a windowed interface which made a world of difference to the program&#8217;s workflow. &#8220;It&#8217;s not going to happen,&#8221; said our manager. In less than thirty seconds, our great ideas fell to pieces. &#8220;They&#8217;ve used that console interface for 15 years now, <strong>it&#8217;s just the way it&#8217;s done here.</strong>&#8221;</p>
<p>I&#8217;d heard that before; resistance to change for fear of change. It&#8217;s like being told, &#8220;because I said so,&#8221; by your parents for lack of a good reason. I always saw that guy as being an obstacle in our software development, more interested in not rocking the boat than improving the process.</p>
<p><strong>6 years later&#8230;</strong></p>
<p>When I started at SlickEdit, I was introduced to a lot of firsts. I&#8217;m a Microsoft programmer [ducks behind cube wall]. I&#8217;ve been programming with Microsoft&#8217;s APIs, toolkits, libraries, IDEs, etc for a long time. When it comes to Microsoft technology, I&#8217;ve done a lot, and it&#8217;s a world that I feel completely at home in.</p>
<p>My first assignment here was to test SlickEdit on AIX, having never used SlickEdit before and with virtually no UNIX background. I tried my best to learn my way around, but I never shook that feeling of being <strong>hopelessly </strong>lost. To make things worse, everyone else was using it at the Jedi Knight level. All of my creature comforts were gone during this testing cycle. As an experienced programmer, it&#8217;s humbling and flat out embarrassing to have to ask questions like, &#8220;How do I install this program?&#8221;, &#8220;Where is my personal directory?&#8221; and &#8220;How do I build with GCC?&#8221;</p>
<p>When I got to work on Tools, and got back to Visual Studio and Windows, I felt like I was back home. I knew where everything was; I knew which step was the creaky step, I knew how to use all the buttons on the TV remote control, I was completely familiar with my surroundings. This isn&#8217;t at all to say that Visual Studio is better than SlickEdit, because in a lot of ways, it&#8217;s not. The same could be said about Windows vs. UNIX or Linux.</p>
<p>After so many years, I&#8217;ve become a creature of habit, and I recognize that. Not because the task of learning a new OS or code editor is too difficult, but because I really hate the feeling of being lost. Even worse is thinking about the wasted hours learning to do the same thing I could do in my comfort space in five minutes. Most horrible of all is just feeling stupid about not knowing how to do the simplest things.</p>
<p>After all this time, I feel like I&#8217;ve gained a little perspective from my old manager&#8217;s side of the fence. &#8220;Don&#8217;t take away their console interface&#8230; they don&#8217;t want to learn, they just want to get their job done,&#8221; was what he was really trying to say. Starting from square one and leaving your areas of proficiency behind is scary. I&#8217;m always happy to learn new things, but it&#8217;s always nice to come back home. Now I see his point of view.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F10%2Fcomfort-habits-and-ruts-in-software-development%2F';
  addthis_title  = 'Comfort%2C+Habits+and+Ruts+in+Software+Development';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/10/comfort-habits-and-ruts-in-software-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comparing Python to Perl and Ruby</title>
		<link>http://blog.slickedit.com/2007/09/comparing-python-to-perl-and-ruby/</link>
		<comments>http://blog.slickedit.com/2007/09/comparing-python-to-perl-and-ruby/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 16:23:21 +0000</pubDate>
		<dc:creator>Clark Maurer</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.slickedit.com/?p=162</guid>
		<description><![CDATA[Comparing Python to Perl and Ruby Anyone who knows me well, knows that I am really into programming languages. Like editors, a programming language is a tool which is supposed to make your programming task easier. Unlike the typical programmer, I have experience designing and implementing languages. Slick-C, the macro language in SlickEdit, is the [...]]]></description>
			<content:encoded><![CDATA[<h1>Comparing Python to Perl and Ruby</h1>
<p>Anyone who knows me well, knows that I am really into programming languages. Like editors, a programming language is a tool which is supposed to make your programming task easier.</p>
<p>Unlike the typical programmer, I have experience designing and implementing languages. Slick-C, the macro language in SlickEdit, is the third fairly major programming language I&#8217;ve been involved with. My experience and passion for programming languages gives me quite a bit more insight into performance and elegance.</p>
<p>I started learning Python because SlickEdit needed better support for the language. Unlike Ruby, I never heard a lot of hoopla about Python. The programming world has many, many scripting languages, most of them poorly designed. I figured that Python was probably just another poorly designed language with little or no technical merits.</p>
<p>I&#8217;ve been puzzled by the popularity of Perl since it has so many flaws. By the way, just because I dislike some elements of Perl doesn&#8217;t mean I will direct SlickEdit not to provide great support for it. SlickEdit language enhancements are based on popularity, and currently Perl is more popular than Python. However, that doesn&#8217;t mean I won&#8217;t rank on it a bit. Heck, I rank on C/C++ and it&#8217;s the language I use most (beware of sharp knife). To date, we have spent WAY more time on Perl and Ruby support than Python. This will always be the case, because it is WAY easier to implement Python support.</p>
<p>I have done my best to make these comparisons unbiased. The only code that I have written for these languages is sample code to better understand these languages. I do have good experience in parsing these languages either for color coding or tagging symbols for SlickEdit. My opinions are based on what I think make a state-of-the-art language. My next article &#8220;A Deeper Look at Python&#8221;, will talk more about Python and what things make a language state-of-the-art.</p>
<p>This comparison of Python, Perl, and Ruby is from a grammar perspective and does not cover the run-times of these languages. There are often cases where you end up choosing a language due to its run-time features. I&#8217;m not going to cover run-time features here. A detailed chart of reasons to choose one or the other which includes run-times would be very useful though.</p>
<h2>Python Versus Perl</h2>
<p>Python beats Perl by a mile. In a nut shell, Python and Perl have similar language features but Python is way easier to learn and use than Perl. Here are some specific examples:</p>
<p>Perl</p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">sub</span> func <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;"># You've got to be kidding parameter passing.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;"># Perl 6 intends to fix this.</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$x</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$arrayRef</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span> &nbsp;<span style="color: #666666; font-style: italic;"># Crud, this modifies the callers $i.</span><br />
&nbsp; &nbsp; <span style="color: #339933;">++</span><span style="color: #0000ff;">$x</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$arrayRef</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span> &nbsp;<span style="color: #666666; font-style: italic;">#YUCK! Modify the callers array.</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># By default, all variables are global in Perl. This</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># is potentially more dangerous.</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$newvar</span><span style="color: #339933;">=</span> <span style="color: #ff0000;">'abc'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># this is a global variable</span><br />
&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #0000ff;">$x</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">return</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #0000ff;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;"># Choose the right variable prefix for a list</span><br />
<span style="color: #0000ff;">@array</span><span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">#Passing an array by reference is ugly</span><br />
<span style="color: #0000ff;">$x</span><span style="color: #339933;">=</span>func<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #0000ff;">\@array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$newvar</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;i=&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$i</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># i is 2</span><br />
<span style="color: #666666; font-style: italic;"># You're kidding, I need to change the prefix</span><br />
<span style="color: #0000ff;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> &nbsp;<span style="color: #666666; font-style: italic;"># prints 4 0</span></div></td></tr></tbody></table></div>
<p>Python</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> func<span style="color: black;">&#40;</span>x<span style="color: #66cc66;">,</span><span style="color: #dc143c;">array</span><span style="color: #66cc66;">,</span>z<span style="color: #66cc66;">=</span><span style="color: #483d8b;">'Cool! Default value'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; i<span style="color: #66cc66;">=</span><span style="color: #ff4500;">2</span> &nbsp; <span style="color: #808080; font-style: italic;"># This declares a new local variable</span><br />
&nbsp; &nbsp; x+<span style="color: #66cc66;">=</span><span style="color: #ff4500;">1</span> &nbsp;<span style="color: #808080; font-style: italic;"># Hmm...No ++ operator in Python.</span><br />
&nbsp; &nbsp; <span style="color: #dc143c;">array</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">=</span><span style="color: #ff4500;">4</span><span style="color: #66cc66;">;</span> &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">#Modify the callers list</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> x<span style="color: #66cc66;">,</span>z<br />
&nbsp; &nbsp; newvar<span style="color: #66cc66;">=</span><span style="color: #483d8b;">'abc'</span><span style="color: #66cc66;">;</span> &nbsp;<span style="color: #808080; font-style: italic;"># This declares a new local variable</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> <br />
i<span style="color: #66cc66;">=</span><span style="color: #ff4500;">1</span><br />
<span style="color: #dc143c;">array</span><span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> &nbsp;<span style="color: #808080; font-style: italic;"># Python calls this a list</span><br />
<span style="color: #808080; font-style: italic;"># Passing a list by reference works like</span><br />
<span style="color: #808080; font-style: italic;"># the C# List&lt;T&gt; generic.</span><br />
x<span style="color: #66cc66;">=</span>func<span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">array</span><span style="color: black;">&#41;</span><br />
<span style="color: #808080; font-style: italic;">#print newvar; &nbsp;This won't compile</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;i=&quot;</span><span style="color: #66cc66;">,</span>i &nbsp;<span style="color: #808080; font-style: italic;"># i is 1</span><br />
<span style="color: #dc143c;">array</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">=</span><span style="color: #ff4500;">0</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">array</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">array</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">;</span> &nbsp;<span style="color: #808080; font-style: italic;"># prints 4 0</span></div></td></tr></tbody></table></div>
<p>Python is a big improvement over Perl. I would provide more reasons why Python is much better but I&#8217;d like to keep this article short. I will say that Perl has a very large and arguably cryptic grammar. Perl is hard for others to quickly read and understand. I find Perl hard to write as well. Because Perl has a lot of syntax which is so different from other programming languages, you quickly forget it and must read the language documentation again.</p>
<h2>Python Versus Ruby</h2>
<p>Comparing Python and Ruby is not as simple as showing some small snippets of code as I did above. For me, Python is clearly a better language than Ruby but I can understand why some people might like Ruby better. Ruby took the &#8220;kitchen sink&#8221; approach. It has language syntax for pretty much all the features of Perl, Python, and then some. Ruby embraces many of Perl&#8217;s complex features, which may make Ruby seem more familiar to the Perl fanatic than Python. There are loads of &#8220;shorthands&#8221; and optional syntax. To the naive person, lots of features give the false impression that the language is better or somehow more powerful.</p>
<p>While more can mean better, it definitely doesn&#8217;t in Ruby&#8217;s case. Due to the very large grammar, Ruby is way more difficult to learn than Python. The comment on the Ruby web site about Ruby being easy to learn is definitely not true. Reading Ruby code written by someone else is a problem too since others will use constructs you are not familiar with or don&#8217;t like. The ambiguities in the language make it much harder for editing tools to provide smart editing features. I&#8217;m not willing to give up smart editing features for shorthands which save a few characters. If you are using a dumb editor, then you might see this differently.</p>
<p>In order to keep this article short, I will not show all the constructs in Ruby which make it a large ambiguous grammar. So this may look like I&#8217;m nit picking.</p>
<h2>Poor Ruby Syntax Choices</h2>
<p>Here are some poor Ruby syntax choices:</p>
<p>Ruby</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;"># Due to these poor choices...</span><br />
<span style="color:#9966CC; font-weight:bold;">if</span> i<span style="color:#006600; font-weight:bold;">&lt;</span><span style="color:#006666;">5</span> <span style="color:#9966CC; font-weight:bold;">then</span> <br />
&nbsp; &nbsp;<span style="color:#CC0066; font-weight:bold;">puts</span> i <br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">while</span> i<span style="color:#006600; font-weight:bold;">&lt;</span><span style="color:#006666;">10</span> <span style="color:#9966CC; font-weight:bold;">then</span> <br />
&nbsp; &nbsp;i<span style="color:#006600; font-weight:bold;">+</span>=<span style="color:#006666;">1</span> <br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#008000; font-style:italic;"># This syntax for the shorthand forms is hard</span><br />
<span style="color:#008000; font-style:italic;"># to read for most of us.</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> i <span style="color:#9966CC; font-weight:bold;">if</span> i<span style="color:#006600; font-weight:bold;">&lt;</span><span style="color:#006666;">5</span><br />
i<span style="color:#006600; font-weight:bold;">+</span>=<span style="color:#006666;">1</span> <span style="color:#9966CC; font-weight:bold;">while</span> i<span style="color:#006600; font-weight:bold;">&lt;</span><span style="color:#006666;">10</span><br />
<span style="color:#008000; font-style:italic;"># The syntax below bloats the language.</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> i <span style="color:#9966CC; font-weight:bold;">unless</span> i<span style="color:#006600; font-weight:bold;">&gt;</span>=<span style="color:#006666;">5</span> &nbsp;<span style="color:#008000; font-style:italic;"># Same as &quot;puts i if i&lt;5&quot;</span></div></td></tr></tbody></table></div>
<p>Python</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># These long hands are easily compressed</span><br />
<span style="color: #ff7700;font-weight:bold;">if</span> i<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">5</span>: <br />
&nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">print</span> i<br />
<span style="color: #ff7700;font-weight:bold;">while</span> i<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">10</span>:<br />
&nbsp; &nbsp;i+<span style="color: #66cc66;">=</span><span style="color: #ff4500;">1</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">if</span> i<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">5</span>: <span style="color: #ff7700;font-weight:bold;">print</span> i<br />
<span style="color: #ff7700;font-weight:bold;">while</span> i<span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">10</span>: i+<span style="color: #66cc66;">=</span><span style="color: #ff4500;">1</span></div></td></tr></tbody></table></div>
<p>Ruby should have chosen a syntax which allows for a more conventional single line statement like one of the following:</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;"># C-like syntax</span><br />
<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> expr <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp;put s; &nbsp;<br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> expr <span style="color:#006600; font-weight:bold;">&#41;</span> put s; <br />
<br />
<span style="color:#008000; font-style:italic;"># Pascal-like syntax</span><br />
<span style="color:#9966CC; font-weight:bold;">if</span> expr <span style="color:#9966CC; font-weight:bold;">then</span> <span style="color:#9966CC; font-weight:bold;">begin</span> &nbsp; &nbsp;<span style="color:#008000; font-style:italic;"># could use 'do' instead of 'begin'</span><br />
&nbsp; &nbsp;put s; &nbsp;<br />
<span style="color:#9966CC; font-weight:bold;">end</span>;<br />
<span style="color:#9966CC; font-weight:bold;">if</span> expr <span style="color:#9966CC; font-weight:bold;">then</span> put s; <br />
<br />
<span style="color:#008000; font-style:italic;"># Python syntax is best</span><br />
<span style="color:#9966CC; font-weight:bold;">if</span> expr: <br />
&nbsp; &nbsp;put s<br />
<span style="color:#9966CC; font-weight:bold;">if</span> expr: put s</div></td></tr></tbody></table></div>
<h2>Function Pointers or Function Objects</h2>
<p>Ruby really messed up with function pointers (or function objects):</p>
<p>Ruby</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;"># What planet did this come from?</span><br />
<span style="color:#9966CC; font-weight:bold;">def</span> func<span style="color:#006600; font-weight:bold;">&#40;</span>list<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">for</span> i <span style="color:#9966CC; font-weight:bold;">in</span> list<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">yield</span> i<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
func<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'cat'</span>,<span style="color:#996600;">'dog'</span>,<span style="color:#996600;">'horse'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>animal<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> animal<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>Python</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># This is from earth</span><br />
<span style="color: #ff7700;font-weight:bold;">def</span> doSomething<span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> i<br />
&nbsp; &nbsp;<br />
<span style="color: #ff7700;font-weight:bold;">def</span> func<span style="color: black;">&#40;</span><span style="color: #008000;">list</span><span style="color: #66cc66;">,</span>function<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">list</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp;function<span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span><br />
<br />
<span style="color: #808080; font-style: italic;"># Python does not yet have multi-line anonymous </span><br />
<span style="color: #808080; font-style: italic;"># functions. The lambda functions in Python are weak.</span><br />
func<span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'cat'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'dog'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'horse'</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span>doSomething<span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<p>Ruby</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;"># This is better</span><br />
<span style="color:#9966CC; font-weight:bold;">def</span> func2<span style="color:#006600; font-weight:bold;">&#40;</span>list,function<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">for</span> i <span style="color:#9966CC; font-weight:bold;">in</span> list<br />
&nbsp; &nbsp; &nbsp; &nbsp;function.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
func2<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'cat'</span>,<span style="color:#996600;">'dog'</span>,<span style="color:#996600;">'horse'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># proc(animal) is a better choice</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># delegate(animal) is like C#</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">proc</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>animal<span style="color:#006600; font-weight:bold;">|</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> animal<br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#41;</span></div></td></tr></tbody></table></div>
<p>The first Ruby example uses syntax which none of us should ever have to learn. To make matters worse, the keyword &#8220;yield&#8221; is used which means something totally different in C# and Python. I haven&#8217;t yet found a way to pass a predefined function as an argument to a Ruby function. Ruby does support passing method pointers using the &#8220;method&#8221; feature (ex &#8220;variable.method(:methodName)&#8221;), but again Python provides a much simpler syntax. To pass a method pointer in Python you just specify &#8220;variable.methodName&#8221; like you would in C#.</p>
<p>Ruby&#8217;s grammar is riddled with multiple ways of doing things. Adding to the confusion, it often unnecessarily chooses syntax different from popular languages we are familiar with.  As a result, Ruby is much more difficult to learn, read, and write.</p>
<p>Not everything is better in Python. For example, Ruby&#8217;s class/member syntax is better than Python. For me, this doesn&#8217;t help Ruby nearly enough to make it a better language.</p>
<h2>Summary</h2>
<p>Both Ruby and Perl have large ambiguous grammars (Perl&#8217;s grammar is worse). They often disambiguate syntax based on context. For example, the slash symbol (/) can mean divide or perform a search depending on the context. In the search case, the slash is used to delimit the string. This is an unnecessary complexity since this is just another way to call a function with string parameters.</p>
<p>There will never be a case where having a very large and ambiguous grammar makes a language better. This is one of the flaws in C++. I&#8217;m an excellent C++ programmer and I&#8217;ve had to stare at some C++ statements for way too long. Note that Java and C# have very small unambiguous grammars with only a few shorthands. Modern languages have so many features that they must keep the grammar small in order to reduce the learning curve. I guarantee that the best state-of-the-art languages of the future will do the same. For this reason alone, Python is clearly better than Ruby or Perl. Keep in mind that I have not compared the run-times of these languages and there are often cases where you end up choosing a language due to its run-time features.</p>
<p>There are other ways that scripting languages can speed the programming process without creating a large grammar with excessive shorthands. For example, unqualifying names with import/using statements and choosing short name space names for standard run-times (Python does both of these). Also, if the grammar is small and unambiguous, editing tools like SlickEdit can provide more assistance.</p>
<p>My next article &#8220;A Deeper Look at Python&#8221;, will talk more about Python and what things make a language state-of-the-art.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.slickedit.com%2F2007%2F09%2Fcomparing-python-to-perl-and-ruby%2F';
  addthis_title  = 'Comparing+Python+to+Perl+and+Ruby';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.slickedit.com/2007/09/comparing-python-to-perl-and-ruby/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
	</channel>
</rss>

