<?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>techrageo.us &#187; Best Practices</title>
	<atom:link href="http://techrageo.us/taxonomy/categories/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://techrageo.us</link>
	<description>insight on technology</description>
	<lastBuildDate>Sat, 22 Oct 2011 12:18:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Security and Google Code Search</title>
		<link>http://techrageo.us/2006/10/09/security-and-google-code-search/</link>
		<comments>http://techrageo.us/2006/10/09/security-and-google-code-search/#comments</comments>
		<pubDate>Mon, 09 Oct 2006 09:05:50 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Searching]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://techrageo.us/2006/10/09/security-and-google-code-search/</guid>
		<description><![CDATA[If you use WordPress be careful. An example Google Code Search search going around is &#8220;username file:wp-config.php&#8221; which happily displays username and passwords in WordPress config files&#8230; if they&#8217;re in compressed archives or a publicly accessible directory. Same goes for other configuration or settings files. For instance, connection strings in web.config files (connection string file:web.config), [...]]]></description>
			<content:encoded><![CDATA[<p>If you use WordPress be careful. An example Google Code Search search going around is &#8220;<a href="http://google.com/codesearch?as_q=username&amp;as_filename=wp-config.php">username file:wp-config.php</a>&#8221; which happily displays username and passwords in WordPress config files&#8230; if they&#8217;re in compressed archives or a publicly accessible directory.</p>
<p>Same goes for other configuration or settings files. For instance, connection strings in web.config files (<a href="http://google.com/codesearch?q=connectionstring+file%3Aweb.config">connection string file:web.config</a>), Movable Type passwords (<a href="http://google.com/codesearch?q=file%3Amt-db-pass.cgi">file:mt-db-pass.cgi</a>), keygen name serial, backdoor passwords (<a href="http://google.com/codesearch?q=backdoor.*password">backdoor.*password</a>), MySQL root passwords (<a href="http://google.com/codesearch?q=file%3Aconfig.inc.php+%22MySQL+password%22+root">file:config.inc.php &#8220;MySQL password&#8221; root</a>, etc.</p>
<p>Of course, one could search for code vulerable to cross-site scripting, SQL Injection (<a href="http://google.com/codesearch?q=lang%3Aphp+mysql_query%5C%28.*%5C%24_%28GET%7CPOST%7CCOOKIE%7CREQUEST%29.*%5C%29">lang:php mysql_query\(.*\$_(GET|POST|COOKIE|REQUEST).*\)</a>), remote code execution <a href="http://google.com/codesearch?q=lang:php (include|require)\s*(\(|\s).*\$_(GET|POST)">(lang:php (include|require)\s*(\(|\s).*\$_(GET|POST))</a>, header injection, and on and on.</p>
<p>Spammers can cull email addresses from code with a simple code search as well (<a href="http://google.com/codesearch?q=%5Ba-z%5D*%40%5Ba-z%5D*.com">[a-z]*@[a-z]*.com</a>)</p>
<p>So what have we learned?</p>
<ul>
<li>Do not put passwords in public code, including zipped code archives.</li>
<li>Be more diligent to protect against SQL Injection and similar exploits. I.e. do not trust user input of any sort.</li>
<li>Do not put email addresses in public code.</li>
<li>In general, keep your eyes and ears open for security exploits and protect against them.</li>
</ul>
<p>We can&#8217;t be perfect, but we ought to try.</p>
<p>Seen <a href="http://deathbycomet.com/2006/10/05/some-of-your-db-passwords-are-belong-to-us/">here</a>, <a href="http://illyana.com/2006/10/05/googles-code-search/">here</a>, and <a href="http://ilia.ws/archives/133-Google-Code-Search-Hackers-best-friend.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2006/10/09/security-and-google-code-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Egoless Programming</title>
		<link>http://techrageo.us/2006/05/12/egoless-programming/</link>
		<comments>http://techrageo.us/2006/05/12/egoless-programming/#comments</comments>
		<pubDate>Fri, 12 May 2006 20:40:35 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://techrageo.us/?p=57</guid>
		<description><![CDATA[Programmers, get out of your cube and play nice, share your knowledge, be open to learning from others&#8230; just a bit of great advice based on the concept of peer code reviews in Jerry Weinberg&#8217;s book The Psychology of Computer Programming. It is often tough for developers to detach themselves from their code. Code reviews [...]]]></description>
			<content:encoded><![CDATA[<p>Programmers, get out of your cube and play nice, share your knowledge, be open to learning from others&#8230; just a bit of great advice based on the concept of peer code reviews in Jerry Weinberg&#8217;s book <a href="http://www.amazon.com/exec/obidos/ASIN/0932633420/mumeishi-20">The Psychology of Computer Programming</a>.</p>
<p>It is often tough for developers to detach themselves from their code. Code reviews are feared because they essentially invite criticism, but if such criticism is given in a cooperative manner, it is good for all involved. Participants in a code review should go into it hoping to learn and maybe teach at the same time.</p>
<p>However, it is important to keep in mind that you can only get a handle on your ego and learn to respect others&#8217; egos. Pride in one&#8217;s craft is a great motivating factor for quality in any trade and should be fostered. Sharing be used to improve each individual&#8217;s work, not to strip them of their technical &#8220;ownership&#8221; of a component.</p>
<p>Builder.com has condensed some rules for accepting Weinberg&#8217;s concepts of egoless programming in <a href="http://builder.com.com/5100-6404-1045782.html">The Ten Commandments of Egoless Programming</a>. (Via <a href="http://www.codinghorror.com/blog/archives/000584.html">Coding Horror</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2006/05/12/egoless-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Great Products</title>
		<link>http://techrageo.us/2006/05/09/building-great-products/</link>
		<comments>http://techrageo.us/2006/05/09/building-great-products/#comments</comments>
		<pubDate>Tue, 09 May 2006 04:05:40 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://techrageo.us/?p=53</guid>
		<description><![CDATA[Product development cycles are riddled with problems. Sales people promise a great new, impossible Whatsit to customers then come tell you the Whatsit has to be built. Managers give engineers a delivery date and then ask engineers to size the effort. The engineers scramble, back burner the Hoozit project they were told last month was [...]]]></description>
			<content:encoded><![CDATA[<p>Product development cycles are riddled with problems. Sales people promise a great new, impossible Whatsit to customers then come tell you the Whatsit has to be built. Managers give engineers a delivery date and then ask engineers to size the effort. The engineers scramble, back burner the Hoozit project they were told last month was top priority, size the Whatsit and start strapping things together. Best efforts are made to tie it together, test it, fix it, and release it. Then they try to get their heads back around the Hoozit, excepting for fixing the Whatsit when it breaks.</p>
<p><strong>One Great Programmer?</strong><br />
Tom Evslin <a href="http://blog.tomevslin.com/2006/05/why_a_great_pro.html">proposes</a> that one great programmer is worth those fifty good programmers working on Hoozit and Whatsit.</p>
<p>Cutting to the chase, he&#8217;s grabbed the pivot point of competing problems; a great programmer can be <em>far more valuable</em> than fifty good programmers, particularly if you need a slick, efficient system built quickly and in a sustainable manner; and a great programmer can be <em>far less valuable</em> than fifty good programmers if you need a large mess of code written quickly. Sometimes a business needs a large mess of code completed quickly and the only thing that will fit that bill is a decent architect and a bunch of decent coders. And money, but that&#8217;s beside the point.</p>
<p>Evslin does make some good points, though. His notion of fixing a budget but removing individual salary caps is interesting, but I think upper-management school is taught that engineers are interchangable, so this would not make any sense to them. More important, he stresses that throwing additional people at a problem adds additional complexities, additional interface inconsistencies, additional meetings &#8212; all sorts of kruft that goes away if you have just one &#8220;superstar&#8221; programmer.</p>
<p><strong>Superstar Problems</strong><br />
But problems abound with that one superstar programmer. Businesses do not operate in the ideal vacuum of programmer space. They are ill-advised to bow at the feet of a single engineer with a well-earned ego. What if he leaves? What if he takes his ideas to build a competing business? How can you stop him? Threaten him? Will that work or will it buy yourself more trouble?</p>
<p><strong>Coping with Really Good Employees</strong><br />
A better solution is to hire a couple really good architects, several really good programmers and test engineers, and if you need them, a bunch of good programmers. Then make sure you hire or train and promote great managers. Poor schedules are most often due to unreasonable demands from management or pressure from sales folk. Poor designs are due to little or no coordinated system architecture and design. Poor programming is due to laziness or even bad morale.</p>
<p>What&#8217;s missing from the process is discipline. Plan carefully. Permit realistic sizings and set schedules after you know how long it will take to build the thing. Keep some pressure to deliver, but allow for relaxed design and code reviews that involve all available engineers. Good engineers cut corners when quality isn&#8217;t encouraged, or they&#8217;re run ragged and aren&#8217;t valued.</p>
<p>Programmers can dream of being that one superstar with the superstar salary, and they might find a place in a small shop. For most companies building great Hoozits and Whatsits is a matter of hiring good people for the right jobs, allowing them to put the cart behind the horse, then respecting and valuing them and their work.</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2006/05/09/building-great-products/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting and Retooling Code</title>
		<link>http://techrageo.us/2006/05/07/deleting-and-retooling-code/</link>
		<comments>http://techrageo.us/2006/05/07/deleting-and-retooling-code/#comments</comments>
		<pubDate>Mon, 08 May 2006 03:25:25 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://techrageo.us/?p=51</guid>
		<description><![CDATA[It&#8217;s kind of old, but somewhere I stumbled on Ned Batchelder&#8217;s article on deleting code. At first glance it looked to be a trivial subject, but it actually turned out to be an interesting read. I have been guilty of leaving dead code lying around, but on the other hand I have clipped stuff that [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s kind of old, but somewhere I stumbled on Ned Batchelder&#8217;s <a href="http://www.nedbatchelder.com/text/deleting%2dcode.html">article on deleting code</a>. At first glance it looked to be a trivial subject, but it actually turned out to be an interesting read. I have been guilty of leaving dead code lying around, but on the other hand I have clipped stuff that I later wish I had back. Source code control helps, but then it depends on how often you check in your code.</p>
<p><strong>A Retooling Project</strong><br />
Nevertheless, it is an interesting article and got me thinking about a side project that has me rewriting and updating (in C# and some SQL) much of an old system, a mix of ASP, VB DLLs, C++ DLLs, and SQL. (The VB and SQL are getting the overhaul.) I am finding maybe 35% of members, columns, functions, methods, and stored procedures are not used. At all. Some have me scratching my head, wondering how a GetRequest differs from a RetrieveRequest &#8212; turns out they differ only in the spelling of the function and in who calls them, but otherwise they&#8217;re twins, as are their corresponding stored procs. Neither is strictly dead code, but we certainly don&#8217;t need two of them.</p>
<p>The rub is that it is primarly my code. It was a project that was driven to market too fast by the sales force. They held development hostage, claiming they could not sell other products unless they could offer this &#8220;bonus&#8221; product as well. Well, the product made it to market on-time and fully-functional &#8212; or, it appears, extra-functional. But it is awfully complex and I was much greener in this environment at the time, leading to some unforseen issues. Since its introduction the product has worked well except for some ill-handled conditions that I patched over manually, behind-the-sceens.</p>
<p>This behind-the-sceens patching occurred whenever a certain error condition was met &#8212; an error condition that has been more prevalent lately, leading to a lot of behind-the-sceens scrambling. In the past, management would not commit any resources to fix the problems since customers were not complaining, but we&#8217;re now in a position to allocate time to clean things up. Plus, a retooling allows us to leverage some new technology and some old lessons.</p>
<p><strong>Lessons Learned</strong><br />
It has me thinking about lessons learned in the life cycle (so far) of this product.
<ol>
<li>As always, don&#8217;t let sales drive development schedules too hard &#8212; everyone knows this rule but it still happens. Continue to educate them on the downsides to driving things too fast. Tip: Sales people have very short attention spans and want a few quick, punchy points to take away. Another tip: if developers are driven too hard up front, they often are too burnt out to go back and &#8220;make it right&#8221; after the fact, not to mention convincing management that it will be worth the time when other things are waiting for attention.</li>
<li>Wherever possible, lean towards simple designs; complexity can get to a point where it starts to breed.</li>
<li>Without getting at-odds with simplicity, anticipate future requirements and create flexible systems to handle them.</li>
<li>Triple-check your work to eliminate duplicate or unused code. The point above about anticipating the future does <em>not</em> mean write code that sits dormant. Code for today&#8217;s possibilities.</li>
<li>Try to allow time to re-organize and re-factor throughout the project; you are bound to learn something once you get started.</li>
<li>Take care to handle unanticipated error conditions along with the obvious ones. Carefully think through the side-effects of failures. For example, would the system be left in an indeterminate state? This sounds obvious, but it does not go without saying.</li>
<li>Include monitoring and administration in your design. It is sickening to find out that a previously-reliable system hasn&#8217;t been working for a week and you have to go back and reconstruct data out of log files.</li>
<li>Document lightly as you code, then heavily when done. The heavy documentation stage will sometimes catch bugs before customers do.</li>
</ol>
<p>Most of the above points I have read before, but for some reason they often get brushed to the curb in the rush to market. They really all boil down to one rule: slow down, look around, and walk with care.</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2006/05/07/deleting-and-retooling-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

