<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Cowboy Scrabble Programming</title>
	<atom:link href="http://cowboyprogramming.com/2007/01/12/cowboy-scrabble-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://cowboyprogramming.com/2007/01/12/cowboy-scrabble-programming/</link>
	<description>Game Development and General Hacking by the Old West</description>
	<lastBuildDate>Tue, 20 Jul 2010 15:03:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Seiska</title>
		<link>http://cowboyprogramming.com/2007/01/12/cowboy-scrabble-programming/comment-page-1/#comment-137158</link>
		<dc:creator>Seiska</dc:creator>
		<pubDate>Wed, 11 Nov 2009 19:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://cowboyprogramming.com/?p=45#comment-137158</guid>
		<description>That code doesn&#039;t look too messy and to me who doesn&#039;t know that much of c++. If you really want something done you can use what ever code you get the fastest done. There is nothing wrong if nobody likes the code if it does what it is supposed to.</description>
		<content:encoded><![CDATA[<p>That code doesn&#8217;t look too messy and to me who doesn&#8217;t know that much of c++. If you really want something done you can use what ever code you get the fastest done. There is nothing wrong if nobody likes the code if it does what it is supposed to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Hamilton</title>
		<link>http://cowboyprogramming.com/2007/01/12/cowboy-scrabble-programming/comment-page-1/#comment-102322</link>
		<dc:creator>Richard Hamilton</dc:creator>
		<pubDate>Thu, 16 Apr 2009 15:52:23 +0000</pubDate>
		<guid isPermaLink="false">http://cowboyprogramming.com/?p=45#comment-102322</guid>
		<description>If you are running Linux, here&#039;s a really easy one-liner
in the shell:

egrep &#039;^word$&#039; ospd.txt

YARTLL (Yet Another Reason To Love Linux:).</description>
		<content:encoded><![CDATA[<p>If you are running Linux, here&#8217;s a really easy one-liner<br />
in the shell:</p>
<p>egrep &#8216;^word$&#8217; ospd.txt</p>
<p>YARTLL (Yet Another Reason To Love Linux:).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Invertigo</title>
		<link>http://cowboyprogramming.com/2007/01/12/cowboy-scrabble-programming/comment-page-1/#comment-55313</link>
		<dc:creator>Invertigo</dc:creator>
		<pubDate>Sat, 11 Oct 2008 22:12:18 +0000</pubDate>
		<guid isPermaLink="false">http://cowboyprogramming.com/?p=45#comment-55313</guid>
		<description>A small aside: I stumbled upon this a little while ago, and you might also find it useful. The Windows NT shell includes a command called FINDSTR which is something like a poor man&#039;s grep. You could use it as follows:

@echo off
FINDSTR /X &quot;%1&quot; ospd.txt &gt; NUL
IF ERRORLEVEL 1 (ECHO %1 is BAD) ELSE (ECHO %1 is GOOD)

The switch /X only lets through entire line matches.</description>
		<content:encoded><![CDATA[<p>A small aside: I stumbled upon this a little while ago, and you might also find it useful. The Windows NT shell includes a command called FINDSTR which is something like a poor man&#8217;s grep. You could use it as follows:</p>
<p>@echo off<br />
FINDSTR /X &#8220;%1&#8243; ospd.txt &gt; NUL<br />
IF ERRORLEVEL 1 (ECHO %1 is BAD) ELSE (ECHO %1 is GOOD)</p>
<p>The switch /X only lets through entire line matches.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mick West</title>
		<link>http://cowboyprogramming.com/2007/01/12/cowboy-scrabble-programming/comment-page-1/#comment-55291</link>
		<dc:creator>Mick West</dc:creator>
		<pubDate>Sat, 11 Oct 2008 15:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://cowboyprogramming.com/?p=45#comment-55291</guid>
		<description>No, we never actually used the Scrabble checker.   They were not really that big players of Scrabble.  So yes, it was more just for something to do.

For my purposes, I wanted something (a command line tool) that would simply check if the word was in the file, without showing me partial matches, or the surrounding words.  So notepad would not fit the bill.   The ideal solution would have been the simple FOR statement batch file, above, and I feel annoyed that I did not persevere and figure that out.

I did not know the STL very well, and I still don&#039;t.  But normally I could have simply looked it up.  However, given my sad lack of familiarity with streams, iterators and the functions of the STL, it would probably have still taken me longer to figure out than the C code. 

I agree though that it&#039;s important to learn new things - especially if they can save time in the long run.  But there are also &lt;i&gt;sometimes&lt;/i&gt; situations where it&#039;s more important to get the task done in the shortest time possible.   The key is to be able to judge the difference.

Heh, I just noticed that there&#039;s only one comment in the code, and it&#039;s wrong :)</description>
		<content:encoded><![CDATA[<p>No, we never actually used the Scrabble checker.   They were not really that big players of Scrabble.  So yes, it was more just for something to do.</p>
<p>For my purposes, I wanted something (a command line tool) that would simply check if the word was in the file, without showing me partial matches, or the surrounding words.  So notepad would not fit the bill.   The ideal solution would have been the simple FOR statement batch file, above, and I feel annoyed that I did not persevere and figure that out.</p>
<p>I did not know the STL very well, and I still don&#8217;t.  But normally I could have simply looked it up.  However, given my sad lack of familiarity with streams, iterators and the functions of the STL, it would probably have still taken me longer to figure out than the C code. </p>
<p>I agree though that it&#8217;s important to learn new things &#8211; especially if they can save time in the long run.  But there are also <i>sometimes</i> situations where it&#8217;s more important to get the task done in the shortest time possible.   The key is to be able to judge the difference.</p>
<p>Heh, I just noticed that there&#8217;s only one comment in the code, and it&#8217;s wrong :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Invertigo</title>
		<link>http://cowboyprogramming.com/2007/01/12/cowboy-scrabble-programming/comment-page-1/#comment-55281</link>
		<dc:creator>Invertigo</dc:creator>
		<pubDate>Sat, 11 Oct 2008 11:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://cowboyprogramming.com/?p=45#comment-55281</guid>
		<description>I can appreciate the sentiment, but I don&#039;t think this a good example of &quot;quick and dirty gets the job done&quot;, nor is it a matter of one language being more powerful or expressive than another. It would serve better as a lesson on why it is useful to learn the standard library of a language well enough so that you don&#039;t have to waste time writing ten lines when of code when one would suffice. Take this solution for example:

ifstream stream(&quot;ospd.txt&quot;);
istream_iterator&lt;string&gt; begin(stream), eos;
bool found = find(begin, eos, argv[1]) != eos;
cout &lt;&lt; argv[1] &lt;&lt; &quot; is &quot; &lt;&lt; (found ? &quot;GOOD&quot; : &quot;BAD&quot;) &lt;&lt; endl;
stream.close();

Are these lines any harder to follow, for someone decently acquainted with C++ and the STL? More importantly, are they any more difficult to write? They do not make explicit use of pointers, dynamic memory allocation, or ASCII control codes, as your code (which is really more C than C++) does at great length. Nevertheless, there is a more important question to be asked.

Did you and your in-laws actually use this program to play a more engaging round of Scrabble? I suspect not; if that was your true goal, Notepad&#039;s &quot;find&quot; feature would have sufficed. No - it seems to me this was borne out of a desire to code something, and rather than tackling something more challenging you simply created work for yourself.

What bothers me most about this post is what it seems to say about Cowboy Programming, if it is to be taken as a &quot;good example&quot; of such. Namely, that Cowboy Programming involves:
- writing unnecessary code for already-solved problems
- sticking to what is familiar when it would be more appropriate to try something new
- ascribing inefficiencies in your code to a language instead of looking to eliminate them
- having a warped sense of perfection that really puts the special in specialization

The last one is truly puzzling; does it not bother you when a problem that can be described in a few words has a code representation that is dozens of lines long? I would say this goes beyond breaking something down into subproblems, to the point where you spend time and space on things that are hardly related to your original task. At that stage, you might as well be working it assembly, although I am quite certain this particular problem could be solved in fewer than 50 lines of x86 code.

In any case, if you happen to be looking for coding practice, I would recommend checking out Project Euler (http://projecteuler.net/). They have a great selection of problems, most of them (in the first 50, anyway) solvable in no more code than would fit on a single screen, if done properly. It is interesting to read the discussion pages - made viewable after solving a particular problem - where people often post their solutions. I&#039;ve been writing all my solutions in C while trying to give those using functional programming languages a run for their money in terms of code length (not an easy task, although not nearly so bad as if I were using Java).

Good luck, and have fun coding while fading into the Western sunset. And don&#039;t let presumptuous elitist programmers get you down.</description>
		<content:encoded><![CDATA[<p>I can appreciate the sentiment, but I don&#8217;t think this a good example of &#8220;quick and dirty gets the job done&#8221;, nor is it a matter of one language being more powerful or expressive than another. It would serve better as a lesson on why it is useful to learn the standard library of a language well enough so that you don&#8217;t have to waste time writing ten lines when of code when one would suffice. Take this solution for example:</p>
<p>ifstream stream(&#8220;ospd.txt&#8221;);<br />
istream_iterator&lt;string&gt; begin(stream), eos;<br />
bool found = find(begin, eos, argv[1]) != eos;<br />
cout &lt;&lt; argv[1] &lt;&lt; &#8221; is &#8221; &lt;&lt; (found ? &#8220;GOOD&#8221; : &#8220;BAD&#8221;) &lt;&lt; endl;<br />
stream.close();</p>
<p>Are these lines any harder to follow, for someone decently acquainted with C++ and the STL? More importantly, are they any more difficult to write? They do not make explicit use of pointers, dynamic memory allocation, or ASCII control codes, as your code (which is really more C than C++) does at great length. Nevertheless, there is a more important question to be asked.</p>
<p>Did you and your in-laws actually use this program to play a more engaging round of Scrabble? I suspect not; if that was your true goal, Notepad&#8217;s &#8220;find&#8221; feature would have sufficed. No &#8211; it seems to me this was borne out of a desire to code something, and rather than tackling something more challenging you simply created work for yourself.</p>
<p>What bothers me most about this post is what it seems to say about Cowboy Programming, if it is to be taken as a &#8220;good example&#8221; of such. Namely, that Cowboy Programming involves:<br />
- writing unnecessary code for already-solved problems<br />
- sticking to what is familiar when it would be more appropriate to try something new<br />
- ascribing inefficiencies in your code to a language instead of looking to eliminate them<br />
- having a warped sense of perfection that really puts the special in specialization</p>
<p>The last one is truly puzzling; does it not bother you when a problem that can be described in a few words has a code representation that is dozens of lines long? I would say this goes beyond breaking something down into subproblems, to the point where you spend time and space on things that are hardly related to your original task. At that stage, you might as well be working it assembly, although I am quite certain this particular problem could be solved in fewer than 50 lines of x86 code.</p>
<p>In any case, if you happen to be looking for coding practice, I would recommend checking out Project Euler (<a href="http://projecteuler.net/" rel="nofollow">http://projecteuler.net/</a>). They have a great selection of problems, most of them (in the first 50, anyway) solvable in no more code than would fit on a single screen, if done properly. It is interesting to read the discussion pages &#8211; made viewable after solving a particular problem &#8211; where people often post their solutions. I&#8217;ve been writing all my solutions in C while trying to give those using functional programming languages a run for their money in terms of code length (not an easy task, although not nearly so bad as if I were using Java).</p>
<p>Good luck, and have fun coding while fading into the Western sunset. And don&#8217;t let presumptuous elitist programmers get you down.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.235 seconds -->
