<?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 for The Software Purist</title>
	<atom:link href="http://www.softwarepurist.com/blog/index.php/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwarepurist.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 22 Jun 2011 09:36:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>Comment on Var/Auto is Ugly and in Some Cases, Downright Evil. by softwarepurist</title>
		<link>http://www.softwarepurist.com/blog/index.php/varauto-is-ugly-and-in-some-cases-downright-evil/comment-page-1/#comment-5116</link>
		<dc:creator>softwarepurist</dc:creator>
		<pubDate>Wed, 22 Jun 2011 09:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=257#comment-5116</guid>
		<description>Hey RM. I get what you&#039;re saying, let me elaborate.

Case 3 was sort of a gotcha that I didn&#039;t explain well. In C++, the methods that return iterators, begin() and end(), are overloaded so that they can return both const and non-const versions. If you use auto which do you get? I&#039;m guessing the const version. The issue with auto is it&#039;s &quot;fine&quot; unless the compiler isn&#039;t inferring the type the same way you&#039;re inferring the type. It&#039;s not always so obvious and the code has the risk of looking kind of non-uniform. I&#039;m okay using it in case 3; I don&#039;t think it really smells of abuse as much as some of the other cases.

As for this being out of context:

var myVar = new MyClass().DoThis().DoThat().DoSomethingElse().NowGet();

You have a good point about it being out of context. I can&#039;t think of a great example right now, but I have certainly seen code like in production. Let&#039;s say DoThis() returns an instance of class B, DoThat() returns an instance of class C, DoSomethingElse() returns an instance of D and NowGet() returns an instance of class E.

The problem here is it&#039;s really not obvious that you&#039;re getting an E. Moreso, maybe you weren&#039;t expecting to get an E in this case. You&#039;re not really using the type system to its fullest.

My dislike of the use of var/auto has to do with the fact that you&#039;re working in a strongly-typed language. You&#039;re supposed to get compile errors when you write code that doesn&#039;t meet the assumptions you had. When you use var/auto, you reduce the compiler&#039;s ability to help you in these cases. In some cases, it&#039;s relatively harmless, because the compiler will just bark at a later line. In other cases, it can lead to code with subtle errors.

&quot;Also, I can’t help but point out that inferring the type on the right hand side of the assignment wouldn’t make any sense for a language where classes are reference types, because the compiler would have to guess which constructor out of every subtype of Y you want to call.&quot;

It would have to be a language feature, of course. Inferring on the right-hand side is not unheard of. Java can do it, for example. Here&#039;s one example:

public class Utility
{
public static &lt;T&gt; ArrayList&lt;T&gt; newArrayList()
{
    return new ArrayList&lt;T&gt;();
}
}

... to use ...

ArrayList&lt;String&gt; arrayList = Utility.newArrayList();


This is kind of the idea I had in mind, except it would have to invoke the constructor on the type rather than just passing it as a generic argument to another, so it&#039;s a slightly different concept, but the idea is similar.</description>
		<content:encoded><![CDATA[<p>Hey RM. I get what you&#8217;re saying, let me elaborate.</p>
<p>Case 3 was sort of a gotcha that I didn&#8217;t explain well. In C++, the methods that return iterators, begin() and end(), are overloaded so that they can return both const and non-const versions. If you use auto which do you get? I&#8217;m guessing the const version. The issue with auto is it&#8217;s &#8220;fine&#8221; unless the compiler isn&#8217;t inferring the type the same way you&#8217;re inferring the type. It&#8217;s not always so obvious and the code has the risk of looking kind of non-uniform. I&#8217;m okay using it in case 3; I don&#8217;t think it really smells of abuse as much as some of the other cases.</p>
<p>As for this being out of context:</p>
<p>var myVar = new MyClass().DoThis().DoThat().DoSomethingElse().NowGet();</p>
<p>You have a good point about it being out of context. I can&#8217;t think of a great example right now, but I have certainly seen code like in production. Let&#8217;s say DoThis() returns an instance of class B, DoThat() returns an instance of class C, DoSomethingElse() returns an instance of D and NowGet() returns an instance of class E.</p>
<p>The problem here is it&#8217;s really not obvious that you&#8217;re getting an E. Moreso, maybe you weren&#8217;t expecting to get an E in this case. You&#8217;re not really using the type system to its fullest.</p>
<p>My dislike of the use of var/auto has to do with the fact that you&#8217;re working in a strongly-typed language. You&#8217;re supposed to get compile errors when you write code that doesn&#8217;t meet the assumptions you had. When you use var/auto, you reduce the compiler&#8217;s ability to help you in these cases. In some cases, it&#8217;s relatively harmless, because the compiler will just bark at a later line. In other cases, it can lead to code with subtle errors.</p>
<p>&#8220;Also, I can’t help but point out that inferring the type on the right hand side of the assignment wouldn’t make any sense for a language where classes are reference types, because the compiler would have to guess which constructor out of every subtype of Y you want to call.&#8221;</p>
<p>It would have to be a language feature, of course. Inferring on the right-hand side is not unheard of. Java can do it, for example. Here&#8217;s one example:</p>
<p>public class Utility<br />
{<br />
public static <t> ArrayList</t><t> newArrayList()<br />
{<br />
    return new ArrayList</t><t>();<br />
}<br />
}</p>
<p>&#8230; to use &#8230;</p>
<p>ArrayList<string> arrayList = Utility.newArrayList();</p>
<p>This is kind of the idea I had in mind, except it would have to invoke the constructor on the type rather than just passing it as a generic argument to another, so it&#8217;s a slightly different concept, but the idea is similar.</string></t></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on &#8220;What Language Should I Start With?&#8221; by softwarepurist</title>
		<link>http://www.softwarepurist.com/blog/index.php/what-language-should-i-start-with/comment-page-1/#comment-5115</link>
		<dc:creator>softwarepurist</dc:creator>
		<pubDate>Wed, 22 Jun 2011 09:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=77#comment-5115</guid>
		<description>Good points, GreaseMonkey. I generally agree. I think some people just starting out like Visual Basic, because the syntax may be a little closer to English. But, in general, VB had a terrible reputation for a long time and encouraged practices that were sometimes detrimental when you moved to other languages. It&#039;s now, finally a real language rather than an inside joke. It&#039;s basically C# with different syntax rules and slightly different language features. In any case, I absolutely would suggest C# .Net over VB .Net, since VB doesn&#039;t have any real advantages that I can see at this point.

I think you covered Lua and Ruby well. It&#039;s the general downside of interpreted languages with a dynamic type system: errors that could be caught easily by the compiler may not appear until much later, so you need good tests to exercise all code paths. Code coverage is not as critical in a compiled language, but I think it&#039;s almost essential when using an interpreted language with a dynamic type system.

C is tricky to make an argument about: C is actually very simple to start out with, but, the devil is in the details. I would say see C looks deceptively simple, but there are a lot of gotchas, but, not nearly as many as there are with C++.

Good discussion overall. Thanks!</description>
		<content:encoded><![CDATA[<p>Good points, GreaseMonkey. I generally agree. I think some people just starting out like Visual Basic, because the syntax may be a little closer to English. But, in general, VB had a terrible reputation for a long time and encouraged practices that were sometimes detrimental when you moved to other languages. It&#8217;s now, finally a real language rather than an inside joke. It&#8217;s basically C# with different syntax rules and slightly different language features. In any case, I absolutely would suggest C# .Net over VB .Net, since VB doesn&#8217;t have any real advantages that I can see at this point.</p>
<p>I think you covered Lua and Ruby well. It&#8217;s the general downside of interpreted languages with a dynamic type system: errors that could be caught easily by the compiler may not appear until much later, so you need good tests to exercise all code paths. Code coverage is not as critical in a compiled language, but I think it&#8217;s almost essential when using an interpreted language with a dynamic type system.</p>
<p>C is tricky to make an argument about: C is actually very simple to start out with, but, the devil is in the details. I would say see C looks deceptively simple, but there are a lot of gotchas, but, not nearly as many as there are with C++.</p>
<p>Good discussion overall. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Internet on Mars by softwarepurist</title>
		<link>http://www.softwarepurist.com/blog/index.php/the-internet-on-mars/comment-page-1/#comment-5113</link>
		<dc:creator>softwarepurist</dc:creator>
		<pubDate>Wed, 22 Jun 2011 09:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=146#comment-5113</guid>
		<description>Hi Lapė! Good points. It would definitely be a different kind of web, at least between planets. I agree, things like Ajax certainly wouldn&#039;t work. It would be closer to web 1.0 concepts than web 2.0, unless the latency issue was somehow solved -- or the dynamic content would have to operate against a cache, as you said. Thanks for your input! :)</description>
		<content:encoded><![CDATA[<p>Hi Lapė! Good points. It would definitely be a different kind of web, at least between planets. I agree, things like Ajax certainly wouldn&#8217;t work. It would be closer to web 1.0 concepts than web 2.0, unless the latency issue was somehow solved &#8212; or the dynamic content would have to operate against a cache, as you said. Thanks for your input! <img src='http://www.softwarepurist.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on &#8220;What Language Should I Start With?&#8221; by GreaseMonkey</title>
		<link>http://www.softwarepurist.com/blog/index.php/what-language-should-i-start-with/comment-page-1/#comment-4635</link>
		<dc:creator>GreaseMonkey</dc:creator>
		<pubDate>Fri, 20 May 2011 00:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=77#comment-4635</guid>
		<description>Argh, if only I&#039;d spotted this on the net earlier.

First thing I&#039;d drop a nuke on is Visual Basic. NO. WAY. Steer clear of that.

Lua is a fairly simple language, and it has absolutely no notion of a Goto, which is a start. It also has a fairly reasonable standard library, and you can actually do a lot with it (you can even learn about closures while you&#039;re at it).

Just be careful with Lua, because if you&#039;re going to do, say, object oriented programming (OOP), you need to hack your way around the language. With that said, it&#039;s still very powerful, so it&#039;s a good choice for an embedded scripting language, but I advise you start with another language instead.

Which leaves us with Ruby. Really nice to program with. The syntax is really weird, though... not in the sense of &quot;what does this do&quot;, but &quot;where&#039;s my syntax error&quot; - when I was screwing with Eversion&#039;s Ruby code, it took a while to actually get a syntax error.

However, it&#039;s still a very powerful language - there&#039;s a LOT of standard library available at your fingertips. It&#039;s just not particularly fast, that&#039;s all (it&#039;s slower than Python from what I gather).

Not sure what languages I&#039;d add to the table. C isn&#039;t an easy language as a starting language (heck, I learnt x86-16 assembler before I learnt C). People have managed to survive learning Java, though... I don&#039;t really know. Should I recommend assembler?

Yes, I highly recommend Python, but I forbid that you read the &quot;Learning Python the Hard Way&quot; book, it&#039;s TRULY HORRIBLE... use the official tutorial instead, it at least assumes you know how to add numbers together.

As for ActionScript, I don&#039;t know.

There&#039;s my rant.</description>
		<content:encoded><![CDATA[<p>Argh, if only I&#8217;d spotted this on the net earlier.</p>
<p>First thing I&#8217;d drop a nuke on is Visual Basic. NO. WAY. Steer clear of that.</p>
<p>Lua is a fairly simple language, and it has absolutely no notion of a Goto, which is a start. It also has a fairly reasonable standard library, and you can actually do a lot with it (you can even learn about closures while you&#8217;re at it).</p>
<p>Just be careful with Lua, because if you&#8217;re going to do, say, object oriented programming (OOP), you need to hack your way around the language. With that said, it&#8217;s still very powerful, so it&#8217;s a good choice for an embedded scripting language, but I advise you start with another language instead.</p>
<p>Which leaves us with Ruby. Really nice to program with. The syntax is really weird, though&#8230; not in the sense of &#8220;what does this do&#8221;, but &#8220;where&#8217;s my syntax error&#8221; &#8211; when I was screwing with Eversion&#8217;s Ruby code, it took a while to actually get a syntax error.</p>
<p>However, it&#8217;s still a very powerful language &#8211; there&#8217;s a LOT of standard library available at your fingertips. It&#8217;s just not particularly fast, that&#8217;s all (it&#8217;s slower than Python from what I gather).</p>
<p>Not sure what languages I&#8217;d add to the table. C isn&#8217;t an easy language as a starting language (heck, I learnt x86-16 assembler before I learnt C). People have managed to survive learning Java, though&#8230; I don&#8217;t really know. Should I recommend assembler?</p>
<p>Yes, I highly recommend Python, but I forbid that you read the &#8220;Learning Python the Hard Way&#8221; book, it&#8217;s TRULY HORRIBLE&#8230; use the official tutorial instead, it at least assumes you know how to add numbers together.</p>
<p>As for ActionScript, I don&#8217;t know.</p>
<p>There&#8217;s my rant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Var/Auto is Ugly and in Some Cases, Downright Evil. by RM</title>
		<link>http://www.softwarepurist.com/blog/index.php/varauto-is-ugly-and-in-some-cases-downright-evil/comment-page-1/#comment-4122</link>
		<dc:creator>RM</dc:creator>
		<pubDate>Thu, 21 Apr 2011 14:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=257#comment-4122</guid>
		<description>I don&#039;t really see the difference between use cases 2 and 3 here. In use case 3 you say that &quot;In this case, I can justify using var/auto, so I consider using auto a minor evil&quot; but fail to explain why - is it because you are familiar with the return type of the function you&#039;re calling so would rather not type it out?

The point of auto, as i can see it, is that you are aware of the code&#039;s context - most people writing code can right click a function call and go and look at the signature if they&#039;re not sure of the type. Staring at a piece of code like &quot;var myVar = new MyClass().DoThis().DoThat().DoSomethingElse().NowGet();&quot; out of context is not a real situation faced by a programmer.

Also, I can&#039;t help but point out that inferring the type on the right hand side of the assignment wouldn&#039;t make any sense for a language where classes are reference types, because the compiler would have to guess which constructor out of every subtype of Y you want to call.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t really see the difference between use cases 2 and 3 here. In use case 3 you say that &#8220;In this case, I can justify using var/auto, so I consider using auto a minor evil&#8221; but fail to explain why &#8211; is it because you are familiar with the return type of the function you&#8217;re calling so would rather not type it out?</p>
<p>The point of auto, as i can see it, is that you are aware of the code&#8217;s context &#8211; most people writing code can right click a function call and go and look at the signature if they&#8217;re not sure of the type. Staring at a piece of code like &#8220;var myVar = new MyClass().DoThis().DoThat().DoSomethingElse().NowGet();&#8221; out of context is not a real situation faced by a programmer.</p>
<p>Also, I can&#8217;t help but point out that inferring the type on the right hand side of the assignment wouldn&#8217;t make any sense for a language where classes are reference types, because the compiler would have to guess which constructor out of every subtype of Y you want to call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Internet on Mars by Lapė Kalė</title>
		<link>http://www.softwarepurist.com/blog/index.php/the-internet-on-mars/comment-page-1/#comment-3893</link>
		<dc:creator>Lapė Kalė</dc:creator>
		<pubDate>Fri, 01 Apr 2011 09:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=146#comment-3893</guid>
		<description>If we really face the constraint of such latency, we could forget web as it is now. There would be no problem if web was static and everything coud be cached, but now most web content is dynamic. Imaginate your friend on mars updated their facebook status, and it will take ten minutes for you to see it. Forget about all modern web features, like ajax auto completers, real time chats, and any dynamic content. Ten minutes to wait may be way too long sometimes.

Such latency is too much to cope with. We must to find a way to avoid it.</description>
		<content:encoded><![CDATA[<p>If we really face the constraint of such latency, we could forget web as it is now. There would be no problem if web was static and everything coud be cached, but now most web content is dynamic. Imaginate your friend on mars updated their facebook status, and it will take ten minutes for you to see it. Forget about all modern web features, like ajax auto completers, real time chats, and any dynamic content. Ten minutes to wait may be way too long sometimes.</p>
<p>Such latency is too much to cope with. We must to find a way to avoid it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Internet on Mars by softwarepurist</title>
		<link>http://www.softwarepurist.com/blog/index.php/the-internet-on-mars/comment-page-1/#comment-2831</link>
		<dc:creator>softwarepurist</dc:creator>
		<pubDate>Thu, 06 Jan 2011 06:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=146#comment-2831</guid>
		<description>Good thoughts, Lance. I agree with the idea that there would have to be other satellites to get around this problem.</description>
		<content:encoded><![CDATA[<p>Good thoughts, Lance. I agree with the idea that there would have to be other satellites to get around this problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Internet on Mars by Lance W</title>
		<link>http://www.softwarepurist.com/blog/index.php/the-internet-on-mars/comment-page-1/#comment-2830</link>
		<dc:creator>Lance W</dc:creator>
		<pubDate>Thu, 06 Jan 2011 04:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=146#comment-2830</guid>
		<description>I imagine for going around the sun, you could just have some relay satellites that orbit the sun as close as possible without getting interference, enough satellites so there are always some visible, and they can see each other, these could relay information around the sun to other planets.</description>
		<content:encoded><![CDATA[<p>I imagine for going around the sun, you could just have some relay satellites that orbit the sun as close as possible without getting interference, enough satellites so there are always some visible, and they can see each other, these could relay information around the sun to other planets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Purism vs. Pragmatism by Tu Piening</title>
		<link>http://www.softwarepurist.com/blog/index.php/purism-vs-pragmatism/comment-page-1/#comment-902</link>
		<dc:creator>Tu Piening</dc:creator>
		<pubDate>Sat, 14 Aug 2010 16:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=198#comment-902</guid>
		<description>I am quite new to the internet and needed to research this subject. Thought it was a wonderful blog very well written and helpful. I will definitely be coming back to your site to read more posts as i adored this one..</description>
		<content:encoded><![CDATA[<p>I am quite new to the internet and needed to research this subject. Thought it was a wonderful blog very well written and helpful. I will definitely be coming back to your site to read more posts as i adored this one..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SQLAPI++ &#8211; Database Access in C++ by jiabing</title>
		<link>http://www.softwarepurist.com/blog/index.php/sqlapi-database-access-in-cpp/comment-page-1/#comment-800</link>
		<dc:creator>jiabing</dc:creator>
		<pubDate>Thu, 22 Jul 2010 09:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.softwarepurist.com/blog/?p=53#comment-800</guid>
		<description>HI softwarepurist,

Must we call commit() after executing query SQL? I found an example from http://www.sqlapi.com/Examples/step4.cpp. Are there some problems if we don’t use commit() or rollback() . From the description of commit() or rollback(), seems there are just impact the records changed.</description>
		<content:encoded><![CDATA[<p>HI softwarepurist,</p>
<p>Must we call commit() after executing query SQL? I found an example from <a href="http://www.sqlapi.com/Examples/step4.cpp" rel="nofollow">http://www.sqlapi.com/Examples/step4.cpp</a>. Are there some problems if we don’t use commit() or rollback() . From the description of commit() or rollback(), seems there are just impact the records changed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

