<?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"
	>
<channel>
	<title>Comments on: C++ is an expert language</title>
	<atom:link href="http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/</link>
	<description>Four in the morning, still writing Free Software</description>
	<pubDate>Wed, 09 Jul 2008 03:33:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Enlaces del 28/04/2008 &#124; El Chigüire Literario</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1656</link>
		<dc:creator>Enlaces del 28/04/2008 &#124; El Chigüire Literario</dc:creator>
		<pubDate>Mon, 28 Apr 2008 11:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1656</guid>
		<description>[...] qué se usa C++ en los videojuegos? y C++ es un lenguaje para expertos. Enlaces robados a [...]</description>
		<content:encoded><![CDATA[<p>[...] qué se usa C++ en los videojuegos? y C++ es un lenguaje para expertos. Enlaces robados a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kg</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1446</link>
		<dc:creator>kg</dc:creator>
		<pubDate>Tue, 08 Apr 2008 06:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1446</guid>
		<description>At college I was taught how to program using C++, but I didn't really _learn_ C++ till I read C++ Primer (4th ed) by Stan Lippman, cover-to-cover.  I think it's probably the best book for learning the fundamentals and how to use C++ "the right way".  Admittedly, it's a very long read, but it's a good place to start if you want to grok C++ instead of just getting by.

Stoustrup's book seems more focused on the language itself and less focused on how to use it.  But, if you want to know why C++ is the way it is (although probably most people don't), check out his other book The Design and Evolution of C++.

Nowadays, I have to consult the C++ standard itself once in a while (the only way to get a definitive answer on some very specific questions).  ANSI sells it for about $30 (which is still highway robbery for a language standard).  Don't be afraid to get yourself a copy and have it as a reference.

I haven't read the Scott Meyers books, but they are probably very good, not so much for learning the basics, but for how to solve the kinds of problems that come up a lot when using C++ in the real world.  For this type of thing, also check out Herb Sutter's books and his Guru of the Week articles.

In any case, you are definitely right, C++ is geared more toward experts.  Hopefully C++0x will change that somewhat.  However, I'm of the opinion that becoming a C++ expert is worth the effort.  (Can you be an expert user of a language without being an expert in the language itself?)

Warning: Use of RAII may cause your debugging skills to falter, because you won't need to use the debugger as often.</description>
		<content:encoded><![CDATA[<p>At college I was taught how to program using C++, but I didn&#8217;t really _learn_ C++ till I read C++ Primer (4th ed) by Stan Lippman, cover-to-cover.  I think it&#8217;s probably the best book for learning the fundamentals and how to use C++ &#8220;the right way&#8221;.  Admittedly, it&#8217;s a very long read, but it&#8217;s a good place to start if you want to grok C++ instead of just getting by.</p>
<p>Stoustrup&#8217;s book seems more focused on the language itself and less focused on how to use it.  But, if you want to know why C++ is the way it is (although probably most people don&#8217;t), check out his other book The Design and Evolution of C++.</p>
<p>Nowadays, I have to consult the C++ standard itself once in a while (the only way to get a definitive answer on some very specific questions).  ANSI sells it for about $30 (which is still highway robbery for a language standard).  Don&#8217;t be afraid to get yourself a copy and have it as a reference.</p>
<p>I haven&#8217;t read the Scott Meyers books, but they are probably very good, not so much for learning the basics, but for how to solve the kinds of problems that come up a lot when using C++ in the real world.  For this type of thing, also check out Herb Sutter&#8217;s books and his Guru of the Week articles.</p>
<p>In any case, you are definitely right, C++ is geared more toward experts.  Hopefully C++0x will change that somewhat.  However, I&#8217;m of the opinion that becoming a C++ expert is worth the effort.  (Can you be an expert user of a language without being an expert in the language itself?)</p>
<p>Warning: Use of RAII may cause your debugging skills to falter, because you won&#8217;t need to use the debugger as often.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ben</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1443</link>
		<dc:creator>ben</dc:creator>
		<pubDate>Tue, 08 Apr 2008 05:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1443</guid>
		<description>In Ruby:

arr = [MyObj.new]</description>
		<content:encoded><![CDATA[<p>In Ruby:</p>
<p>arr = [MyObj.new]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen Goldsmith</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1438</link>
		<dc:creator>Glen Goldsmith</dc:creator>
		<pubDate>Tue, 08 Apr 2008 01:17:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1438</guid>
		<description>Hey Andy...

THanks so much.  

The Scott Meyers' books are probably what I'm looking for.  After taking a few C++ classes at school, I've been through several books -- and very important information  such as the above, aren't covered in beginning books.

Most of these beginning books cover syntax, a little OOP theory, a dash of UML 2 and after 800 pages and 15 chapters...  congrats!  You can put C++ on your resume now!

So this is very helpful stuff.

The web of course is an extremely helpful tool --- but to answer specific questions without knowing why, it's great.  On example:  What's the fastest way to copy very large amounts of small files.  The web has that answer, but usually never "why" the code is that answer.  They don't go into the depth and background you need to know... to get some experience so you can take that knowledge forth and prosper.

Keep up the great blog.</description>
		<content:encoded><![CDATA[<p>Hey Andy&#8230;</p>
<p>THanks so much.  </p>
<p>The Scott Meyers&#8217; books are probably what I&#8217;m looking for.  After taking a few C++ classes at school, I&#8217;ve been through several books &#8212; and very important information  such as the above, aren&#8217;t covered in beginning books.</p>
<p>Most of these beginning books cover syntax, a little OOP theory, a dash of UML 2 and after 800 pages and 15 chapters&#8230;  congrats!  You can put C++ on your resume now!</p>
<p>So this is very helpful stuff.</p>
<p>The web of course is an extremely helpful tool &#8212; but to answer specific questions without knowing why, it&#8217;s great.  On example:  What&#8217;s the fastest way to copy very large amounts of small files.  The web has that answer, but usually never &#8220;why&#8221; the code is that answer.  They don&#8217;t go into the depth and background you need to know&#8230; to get some experience so you can take that knowledge forth and prosper.</p>
<p>Keep up the great blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jlnr</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1435</link>
		<dc:creator>jlnr</dc:creator>
		<pubDate>Mon, 07 Apr 2008 23:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1435</guid>
		<description>Article- I agree that many details make this complicated, but it's not *that* fundamentally bad. For most of the other languages, you inevitably have to understand the difference between references and values; Ruby tries to turn everything into a reference, but if you want to be clever and create a list of ten empty strings via [""] * 10, the fundamental problem comes up again as soon as you try to modify one of them. In Java you also have to understand the (annoying) difference between primitives and objects.
But once you understand to divide your classes into value types and noncopyable reference types, and use tr1 pointers to handle the reference types, it gets so much easier and the whole design suddenly makes a lot of sense, though technically, even more things are happening under the surface.

I don't understand why everything surrounding copying is brought up so often, while I haven't read much criticism for completely failed concepts such as argument dependent lookup, which is PHP-class bad in that it makes a seemingly harmless feature (calling a function) overly complex. Templates being complex is just something you should expect ;)

Kyle- Totally disagree. Define copying/assignment at the lowest level, i.e. smart pointers, containers etc., then just do nothing in the upper levels. Things owning an object that can't be copied have a scoped_ptr member so aren't copyable (rightly so!), structs that only have some strings and ints can be copied. Problem solved ;)</description>
		<content:encoded><![CDATA[<p>Article- I agree that many details make this complicated, but it&#8217;s not *that* fundamentally bad. For most of the other languages, you inevitably have to understand the difference between references and values; Ruby tries to turn everything into a reference, but if you want to be clever and create a list of ten empty strings via [""] * 10, the fundamental problem comes up again as soon as you try to modify one of them. In Java you also have to understand the (annoying) difference between primitives and objects.<br />
But once you understand to divide your classes into value types and noncopyable reference types, and use tr1 pointers to handle the reference types, it gets so much easier and the whole design suddenly makes a lot of sense, though technically, even more things are happening under the surface.</p>
<p>I don&#8217;t understand why everything surrounding copying is brought up so often, while I haven&#8217;t read much criticism for completely failed concepts such as argument dependent lookup, which is PHP-class bad in that it makes a seemingly harmless feature (calling a function) overly complex. Templates being complex is just something you should expect ;)</p>
<p>Kyle- Totally disagree. Define copying/assignment at the lowest level, i.e. smart pointers, containers etc., then just do nothing in the upper levels. Things owning an object that can&#8217;t be copied have a scoped_ptr member so aren&#8217;t copyable (rightly so!), structs that only have some strings and ints can be copied. Problem solved ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1432</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Mon, 07 Apr 2008 21:42:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1432</guid>
		<description>MFC does suck.  And sucks hard (at least back in 2001 when I had to use it).

As far as understanding the under-workings of the STL, I think, instead, that a basic understanding of how different data structures work and where they are appropriate is sufficient, especially since, as previously pointed out, that the STL is implemented differently all over the place.

Also, PHP:

$arr = array( new MyObj() );

and JavaScript:

var MyObj = {}, arr = [ MyObj ];</description>
		<content:encoded><![CDATA[<p>MFC does suck.  And sucks hard (at least back in 2001 when I had to use it).</p>
<p>As far as understanding the under-workings of the STL, I think, instead, that a basic understanding of how different data structures work and where they are appropriate is sufficient, especially since, as previously pointed out, that the STL is implemented differently all over the place.</p>
<p>Also, PHP:</p>
<p>$arr = array( new MyObj() );</p>
<p>and JavaScript:</p>
<p>var MyObj = {}, arr = [ MyObj ];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Balaam</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1428</link>
		<dc:creator>Andy Balaam</dc:creator>
		<pubDate>Mon, 07 Apr 2008 21:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1428</guid>
		<description>Hi Glen, glad to hear you found it useful.  As someone else pointed out, don't forget about the destructor (although if you don't have any raw pointer members, the compiler-provided one may well be fine).

I use &lt;a href="http://www.research.att.com/~bs/3rd.html" rel="nofollow"&gt;Stroustrup&lt;/a&gt;, but I'm not convinced it is the best place to start.  Whenever anyone asks me about books I usually just say "always choose an O'Reilly", but in this case I happen to think that &lt;a href="http://www.oreilly.com/catalog/cplus2/" rel="nofollow"&gt;Practical C++ Programming&lt;/a&gt; is not that good (it's the book I used to learn, and I didn't find it inspiring).

This one looks quite cool: &lt;a href="http://www.oreilly.com/catalog/1886411956/" rel="nofollow"&gt;How Not to Program in C++&lt;/a&gt;, but I've never read it.

If you want to keep going deeper, I've found some really interesting stuff on the &lt;a href="http://www.ddj.com/cpp/" rel="nofollow"&gt;Dr Dobb's Journal&lt;/a&gt; web site, and I can recommend &lt;a href="http://accu.org/" rel="nofollow"&gt;ACCU&lt;/a&gt;'s publications Overload and CVu.

&lt;a href="http://www.aristeia.com/" rel="nofollow"&gt;Scott Meyers&lt;/a&gt;' books "Effective C++" and "More Effective C++" are excellent, but not aimed at beginners.  They cover exactly the type of thing I described above in this blog entry.

Perhaps others have suggestions for good books they used to learn C++?</description>
		<content:encoded><![CDATA[<p>Hi Glen, glad to hear you found it useful.  As someone else pointed out, don&#8217;t forget about the destructor (although if you don&#8217;t have any raw pointer members, the compiler-provided one may well be fine).</p>
<p>I use <a href="http://www.research.att.com/~bs/3rd.html" rel="nofollow">Stroustrup</a>, but I&#8217;m not convinced it is the best place to start.  Whenever anyone asks me about books I usually just say &#8220;always choose an O&#8217;Reilly&#8221;, but in this case I happen to think that <a href="http://www.oreilly.com/catalog/cplus2/" rel="nofollow">Practical C++ Programming</a> is not that good (it&#8217;s the book I used to learn, and I didn&#8217;t find it inspiring).</p>
<p>This one looks quite cool: <a href="http://www.oreilly.com/catalog/1886411956/" rel="nofollow">How Not to Program in C++</a>, but I&#8217;ve never read it.</p>
<p>If you want to keep going deeper, I&#8217;ve found some really interesting stuff on the <a href="http://www.ddj.com/cpp/" rel="nofollow">Dr Dobb&#8217;s Journal</a> web site, and I can recommend <a href="http://accu.org/" rel="nofollow">ACCU</a>&#8217;s publications Overload and CVu.</p>
<p><a href="http://www.aristeia.com/" rel="nofollow">Scott Meyers</a>&#8216; books &#8220;Effective C++&#8221; and &#8220;More Effective C++&#8221; are excellent, but not aimed at beginners.  They cover exactly the type of thing I described above in this blog entry.</p>
<p>Perhaps others have suggestions for good books they used to learn C++?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen Goldsmith</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1427</link>
		<dc:creator>Glen Goldsmith</dc:creator>
		<pubDate>Mon, 07 Apr 2008 20:53:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1427</guid>
		<description>Wow.  Good info.

Are there some good books that discuss this type of thing ?  I've had a couple of C++ classes at college... and you know I've never run into that information before.

Thanks for the heads up....
Glen</description>
		<content:encoded><![CDATA[<p>Wow.  Good info.</p>
<p>Are there some good books that discuss this type of thing ?  I&#8217;ve had a couple of C++ classes at college&#8230; and you know I&#8217;ve never run into that information before.</p>
<p>Thanks for the heads up&#8230;.<br />
Glen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Balaam</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1426</link>
		<dc:creator>Andy Balaam</dc:creator>
		<pubDate>Mon, 07 Apr 2008 20:43:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1426</guid>
		<description>&lt;strong&gt;Kyle&lt;/strong&gt;:

&lt;blockquote&gt;Granted, the compiler will let you CREATE a class without these, but even a C++ newbie, even somebody who’s had a single class in the language, knows that every class in C++ must have a default constructor, a copy constructor, and an assignment operator.&lt;/blockquote&gt;

No, every class with value semantics needs these.  John Lakos' talk "Toward a Common Intuition and Reusable Testing Methodology" at the ACCU conference (which inspired my use of this example here) was very interesting on this topic.  I don't know whether he has put his slides online - they might be interesting, but really you'd need to see the video to get the full force of it!

&lt;strong&gt;Misc&lt;/strong&gt;:

&lt;blockquote&gt;Yeah .. You need to know what you’re doing, which is completely unlike every other language on the planet.&lt;/blockquote&gt;

I presume this is meant sarcastically.  I think there are degrees of "knowing what you're doing", and I think C++ requires a higher degree.

&lt;strong&gt;Karl&lt;/strong&gt;:

&lt;blockquote&gt;the details you cited as things you have to know about how it works have nothing to do with the implementation of std::vector, they are only parts of the complicated interface of std::vector.&lt;/blockquote&gt;

Yes, agreed in theory.  As I mentioned in another comment, though, in practice, the only way I have found to remember such details is to think (in general terms) about how the artefacts I am using are implemented.  Stroustrup encourages this approach, probably partly because it is a book intended to help those who implement the language as well as those who use it.

&lt;blockquote&gt;If you want to argue that C++ occupies an entirely separate "complication class," you will need a different argument.&lt;/blockquote&gt;

I agree that it is perfectly possible to remember requirements like these without thinking about the implementation, but I can't think of an easier way.

I think I'd be happy to say that C++ is more complex than other languages, rather than belonging to a separate class.

&lt;strong&gt;Frank&lt;/strong&gt;:

&lt;blockquote&gt;Bad programmers are detrimental, regardless of the language.&lt;/blockquote&gt;

Agreed.  What about inexperienced coders?  How damaging are they?  How easy is it to spot their errors?

&lt;blockquote&gt;The issue raised in this article is less about cpp and more about garbage collection/reference counting.&lt;/blockquote&gt;

I'd say it was a more general point than that.  In general I have found that people documenting C++ libraries talk about the implementation (in general terms) quite often, whereas I have found that that is much more rare when documenting libraries for other languages.  Perhaps it is purely a cultural issue.

&lt;blockquote&gt;Pascal used array of int, nothing complex there in cpp either&lt;/blockquote&gt;

My point here is that Pascal is simpler.  If you want more complex semantics you have to write them yourself.

&lt;blockquote&gt;C example uses value type copied by value. Ownership of members is ‘undefined’, a crash waiting to happen.&lt;/blockquote&gt;

Yes, if your struct contains pointers.

&lt;blockquote&gt;Most of the CPP errors result from passing the object by value. The compiler is warning you that it can’t do it correctly without being told how.&lt;/blockquote&gt;

Yes, the existence (and use in STL) of by-value semantics in C++ is an example of one of the ways it is more complex than less flexible languages.

&lt;strong&gt;raincat&lt;/strong&gt;:

&lt;blockquote&gt;To C++’s defence here: the program you have written here is semantically very different from the other languages.&lt;/blockquote&gt;

&lt;blockquote&gt;Actually, I don’t know of any other language than C/C++ where you can have arrays with your own objects as value types.&lt;/blockquote&gt;

Yes, that is exactly my point - having these difficult to understand facilities available makes C++ complex.

&lt;blockquote&gt;However, I wouldn’t argue that you’re wrong. C++ is an arcane and complex language. You can gain a little efficiency and direct control of the computer hardware, but it is rarely worth all the problems.&lt;/blockquote&gt;

I think I really must have put myself across badly if it sounded like I was criticising C++.

I agree that C++ is complex, and sometimes arcane, but it is also an amazing phenomenon, full of power and beauty, and incredibly useful for almost anything.</description>
		<content:encoded><![CDATA[<p><strong>Kyle</strong>:</p>
<blockquote><p>Granted, the compiler will let you CREATE a class without these, but even a C++ newbie, even somebody who’s had a single class in the language, knows that every class in C++ must have a default constructor, a copy constructor, and an assignment operator.</p></blockquote>
<p>No, every class with value semantics needs these.  John Lakos&#8217; talk &#8220;Toward a Common Intuition and Reusable Testing Methodology&#8221; at the ACCU conference (which inspired my use of this example here) was very interesting on this topic.  I don&#8217;t know whether he has put his slides online - they might be interesting, but really you&#8217;d need to see the video to get the full force of it!</p>
<p><strong>Misc</strong>:</p>
<blockquote><p>Yeah .. You need to know what you’re doing, which is completely unlike every other language on the planet.</p></blockquote>
<p>I presume this is meant sarcastically.  I think there are degrees of &#8220;knowing what you&#8217;re doing&#8221;, and I think C++ requires a higher degree.</p>
<p><strong>Karl</strong>:</p>
<blockquote><p>the details you cited as things you have to know about how it works have nothing to do with the implementation of std::vector, they are only parts of the complicated interface of std::vector.</p></blockquote>
<p>Yes, agreed in theory.  As I mentioned in another comment, though, in practice, the only way I have found to remember such details is to think (in general terms) about how the artefacts I am using are implemented.  Stroustrup encourages this approach, probably partly because it is a book intended to help those who implement the language as well as those who use it.</p>
<blockquote><p>If you want to argue that C++ occupies an entirely separate &#8220;complication class,&#8221; you will need a different argument.</p></blockquote>
<p>I agree that it is perfectly possible to remember requirements like these without thinking about the implementation, but I can&#8217;t think of an easier way.</p>
<p>I think I&#8217;d be happy to say that C++ is more complex than other languages, rather than belonging to a separate class.</p>
<p><strong>Frank</strong>:</p>
<blockquote><p>Bad programmers are detrimental, regardless of the language.</p></blockquote>
<p>Agreed.  What about inexperienced coders?  How damaging are they?  How easy is it to spot their errors?</p>
<blockquote><p>The issue raised in this article is less about cpp and more about garbage collection/reference counting.</p></blockquote>
<p>I&#8217;d say it was a more general point than that.  In general I have found that people documenting C++ libraries talk about the implementation (in general terms) quite often, whereas I have found that that is much more rare when documenting libraries for other languages.  Perhaps it is purely a cultural issue.</p>
<blockquote><p>Pascal used array of int, nothing complex there in cpp either</p></blockquote>
<p>My point here is that Pascal is simpler.  If you want more complex semantics you have to write them yourself.</p>
<blockquote><p>C example uses value type copied by value. Ownership of members is ‘undefined’, a crash waiting to happen.</p></blockquote>
<p>Yes, if your struct contains pointers.</p>
<blockquote><p>Most of the CPP errors result from passing the object by value. The compiler is warning you that it can’t do it correctly without being told how.</p></blockquote>
<p>Yes, the existence (and use in STL) of by-value semantics in C++ is an example of one of the ways it is more complex than less flexible languages.</p>
<p><strong>raincat</strong>:</p>
<blockquote><p>To C++’s defence here: the program you have written here is semantically very different from the other languages.</p></blockquote>
<blockquote><p>Actually, I don’t know of any other language than C/C++ where you can have arrays with your own objects as value types.</p></blockquote>
<p>Yes, that is exactly my point - having these difficult to understand facilities available makes C++ complex.</p>
<blockquote><p>However, I wouldn’t argue that you’re wrong. C++ is an arcane and complex language. You can gain a little efficiency and direct control of the computer hardware, but it is rarely worth all the problems.</p></blockquote>
<p>I think I really must have put myself across badly if it sounded like I was criticising C++.</p>
<p>I agree that C++ is complex, and sometimes arcane, but it is also an amazing phenomenon, full of power and beauty, and incredibly useful for almost anything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Balaam</title>
		<link>http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1424</link>
		<dc:creator>Andy Balaam</dc:creator>
		<pubDate>Mon, 07 Apr 2008 20:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.artificialworlds.net/blog/2008/04/07/c-is-an-expert-language/#comment-1424</guid>
		<description>&lt;strong&gt;Tac-Tics&lt;/strong&gt;:

&lt;blockquote&gt;arr = [MyObj()]&lt;/blockquote&gt;

I was expecting to use the MyObj later, and/or do some more stuff to it before I added it to the array.  I write quite a lot of Python, so obviously at least one people does use this kind of style.  I admit it is probably quite Java-y.

&lt;blockquote&gt;The Haskell code is more less good.&lt;/blockquote&gt;

:) The Haskell example was added for fun and is my first ever line of Haskell.  Sounds like I made quite a few mistakes.  I have corrected it based on another comment.  Please let me know if the corrected version is wrong in any way.

&lt;blockquote&gt;you should probably be more careful if you’re going to make a point about language inexperience&lt;/blockquote&gt;

Point taken :).

&lt;strong&gt;T4C&lt;/strong&gt;:

&lt;blockquote&gt;it’s a volume of details, not concepts that are required&lt;/blockquote&gt;

I think there is a large number of very complex concepts too - more than most languages.

&lt;strong&gt;markus&lt;/strong&gt;:

&lt;blockquote&gt;But one problem is that, with languages like Ruby and Python becoming more popular, and C still being the oldschool powerhorse - why is the complexity inside C++ needed?&lt;/blockquote&gt;

Ruby or Python with C for the fast parts is a compelling alternative in some situations, but C++ can really express some things you can't do in other languages... and isn't it just more exciting to code in?

&lt;strong&gt;noah&lt;/strong&gt;:

Thanks, yes, I was assuming I'd be doing something to the MyObj before putting it into the array.  I don't know why I was assuming that...

&lt;strong&gt;kL&lt;/strong&gt;:

&lt;blockquote&gt;array ~= obj;&lt;/blockquote&gt;

Wow, cool operator!

&lt;strong&gt;Riaan Minne&lt;/strong&gt;:

&lt;blockquote&gt;the idea that you have to understand how things work under the hood of a language should be applied to any language&lt;/blockquote&gt;

My argument is that in C++ it is &lt;em&gt;necessary&lt;/em&gt; to know how things work before you even start.  Of course, one can become an expert in any programming language, and yes, many of the concepts you acquire are transferrable.  By no means all, though.

&lt;strong&gt;rrwood&lt;/strong&gt;:

&lt;blockquote&gt;I suspect that there are cases where C++ really makes sense&lt;/blockquote&gt;

Yes, and I'm not at all saying you shouldn't use it - I'm mainly saying you should make sure you hire gurus, I think.  Actually, I'm not completely sure what I am saying you should do - I'm basically just saying that C++ is for experts.

Incidentally, one compelling area for using C++ is embedded.  But I think it can be great for anything.

&lt;strong&gt;Err&lt;/strong&gt;:

&lt;blockquote&gt;You don’t have to know how the STL is implemented, because the requirements on the type traits of vector elements are specified in the standard.&lt;/blockquote&gt;

That is technically true.  However, the only way I can think of to remember those otherwise arbitrary restrictions is to have some kind of mental model of what is going on underneath.  That's certainly how I remember them (when I do).  If you prefer to remember them by memorising the standard, then my argument is simply that there is a large amount of arbitrary information which needs to be learnt before you use STL containers.

&lt;strong&gt;Anon&lt;/strong&gt;:

&lt;blockquote&gt;do you mean ArrayList&lt;/blockquote&gt;

Thank you, yes, I am an idiot.  Example corrected.

&lt;strong&gt;erm....&lt;/strong&gt;:

&lt;blockquote&gt;if people are not going to hire newbs, how are they going to become !newbs ?&lt;/blockquote&gt;

Yes, that is a major problem.  I started learning C++ during my PhD, which helped because I had no employer as such, but I have become a lot better (certainly not expert...) since I started using it for my job.  I am very grateful to my employer for taking me on, but very regretful about a lot of the code I wrote in the past - I wish I had been mentored much more.

&lt;strong&gt;Ric&lt;/strong&gt;

&lt;blockquote&gt;Like the C example, the PErl can be simplified from this:
...snip...
To this:

my $obj = MyObj-&gt;new();
my @arr = ( $obj );&lt;/blockquote&gt;

Simplified or shortened?  I prefer the longer version to clarify what each step does (especially in an example...).

&lt;strong&gt;fname lname&lt;/strong&gt;:

DIM a$
INPUT "Enter your name", a$
PRINT "Hello, ", a$

&lt;strong&gt;Mike&lt;/strong&gt;:

&lt;blockquote&gt;Your example cites only references to the Standard Template Library, which is not an integral part of the C++ language itself.&lt;/blockquote&gt;

Since it's part of the standard, I would argue that it is.

&lt;blockquote&gt;I would agree that the STL is overly complex&lt;/blockquote&gt;

It remains an open question as to whether it is possible to implement a powerful library in C++ that does not require you to have a good feel for how it works under the covers before you use it.  Maybe someone can suggest an example of such a library.

Perhaps the compromise would be in terms of performance, which would take away a lot of people's reasons for using C++ in the first place.

BTW, I never said that STL is overly complex, only that it is complex.

&lt;strong&gt;Edgardo Portal&lt;/strong&gt;

&lt;blockquote&gt;The three things you note about C++ are about the first thing most books mention (along with providing a (possibly virtual) destructor), so I’d venture to guess that most people venturing to use the STL would have that under their belts by then.&lt;/blockquote&gt;

I certainly didn't have this under my belt when I first used STL containers - I just got scared and put pointers into STL containers and had to manage the memory myself.  Understanding by-value semantics came later for me.  Perhaps it was because I didn't really read books.  (I'm trying to correct that now.)

&lt;strong&gt;Sgt. Pepper&lt;/strong&gt;:

&lt;blockquote&gt;Another stupid and pointless C++ flame…&lt;/blockquote&gt;

It's not a flame - I love C++!

I hope it's not pointless - maybe it will help us think about things like:

- How to teach C++?  (e.g. Charles Bailey and I had an interesting chat today about whether you can teach C++ by starting with by-value semantics and only covering pointers later.  Hopefully he'll blog about that, along with the myriad ways he disagrees with me :)

- How to write libraries?

- The need for mentoring of new developers?

&lt;strong&gt;Max&lt;/strong&gt;:

&lt;blockquote&gt;To me it sounds more like you are saying C++ is a language for people that have actually used it for longer than a week.&lt;/blockquote&gt;

I have used it for several years and have loads left to learn.  I also know people who are way, way stronger than me and they say they have a lot left to learn as well.  You could be an incredibly fast learner.

&lt;strong&gt;B.G.&lt;/strong&gt;:

&lt;blockquote&gt;The truth is, most developers writing C++ code are doing so using MFC, or the Borland equivalent (C++ Builder) - especially in Europe.&lt;/blockquote&gt;

I work as a programmer in Europe and I use STL whenever I can, which is a lot.  All the underlying classes we use company-wide are based on STL templates and algorithms, where they are appropriate.

STL is excellent!  I've heard that MFC is horrible, but I've never used it.

One reason to use the standard facilities is portability.  Surely for "Enterprise" software this is important?  Our product runs on 4 platforms, only one of which has MFC.

Lots of people at last week's ACCU conference were very interested in STL, so some people are definitely using it.

&lt;blockquote&gt;This post reads as old-school, pretentious, bullcrap! What’s next - every car should have a Porsche engine? Every medical procedure MUST be carried out in the number 1 US hospital? Every wife should appear in Maxim’s top 100 list before the ring is offered, otherwise they’re too ugly and should be dumped at the alter?&lt;/blockquote&gt;

I don't understand your point.  Please could you be more explicit?</description>
		<content:encoded><![CDATA[<p><strong>Tac-Tics</strong>:</p>
<blockquote><p>arr = [MyObj()]</p></blockquote>
<p>I was expecting to use the MyObj later, and/or do some more stuff to it before I added it to the array.  I write quite a lot of Python, so obviously at least one people does use this kind of style.  I admit it is probably quite Java-y.</p>
<blockquote><p>The Haskell code is more less good.</p></blockquote>
<p>:) The Haskell example was added for fun and is my first ever line of Haskell.  Sounds like I made quite a few mistakes.  I have corrected it based on another comment.  Please let me know if the corrected version is wrong in any way.</p>
<blockquote><p>you should probably be more careful if you’re going to make a point about language inexperience</p></blockquote>
<p>Point taken :).</p>
<p><strong>T4C</strong>:</p>
<blockquote><p>it’s a volume of details, not concepts that are required</p></blockquote>
<p>I think there is a large number of very complex concepts too - more than most languages.</p>
<p><strong>markus</strong>:</p>
<blockquote><p>But one problem is that, with languages like Ruby and Python becoming more popular, and C still being the oldschool powerhorse - why is the complexity inside C++ needed?</p></blockquote>
<p>Ruby or Python with C for the fast parts is a compelling alternative in some situations, but C++ can really express some things you can&#8217;t do in other languages&#8230; and isn&#8217;t it just more exciting to code in?</p>
<p><strong>noah</strong>:</p>
<p>Thanks, yes, I was assuming I&#8217;d be doing something to the MyObj before putting it into the array.  I don&#8217;t know why I was assuming that&#8230;</p>
<p><strong>kL</strong>:</p>
<blockquote><p>array ~= obj;</p></blockquote>
<p>Wow, cool operator!</p>
<p><strong>Riaan Minne</strong>:</p>
<blockquote><p>the idea that you have to understand how things work under the hood of a language should be applied to any language</p></blockquote>
<p>My argument is that in C++ it is <em>necessary</em> to know how things work before you even start.  Of course, one can become an expert in any programming language, and yes, many of the concepts you acquire are transferrable.  By no means all, though.</p>
<p><strong>rrwood</strong>:</p>
<blockquote><p>I suspect that there are cases where C++ really makes sense</p></blockquote>
<p>Yes, and I&#8217;m not at all saying you shouldn&#8217;t use it - I&#8217;m mainly saying you should make sure you hire gurus, I think.  Actually, I&#8217;m not completely sure what I am saying you should do - I&#8217;m basically just saying that C++ is for experts.</p>
<p>Incidentally, one compelling area for using C++ is embedded.  But I think it can be great for anything.</p>
<p><strong>Err</strong>:</p>
<blockquote><p>You don’t have to know how the STL is implemented, because the requirements on the type traits of vector elements are specified in the standard.</p></blockquote>
<p>That is technically true.  However, the only way I can think of to remember those otherwise arbitrary restrictions is to have some kind of mental model of what is going on underneath.  That&#8217;s certainly how I remember them (when I do).  If you prefer to remember them by memorising the standard, then my argument is simply that there is a large amount of arbitrary information which needs to be learnt before you use STL containers.</p>
<p><strong>Anon</strong>:</p>
<blockquote><p>do you mean ArrayList</p></blockquote>
<p>Thank you, yes, I am an idiot.  Example corrected.</p>
<p><strong>erm&#8230;.</strong>:</p>
<blockquote><p>if people are not going to hire newbs, how are they going to become !newbs ?</p></blockquote>
<p>Yes, that is a major problem.  I started learning C++ during my PhD, which helped because I had no employer as such, but I have become a lot better (certainly not expert&#8230;) since I started using it for my job.  I am very grateful to my employer for taking me on, but very regretful about a lot of the code I wrote in the past - I wish I had been mentored much more.</p>
<p><strong>Ric</strong></p>
<blockquote><p>Like the C example, the PErl can be simplified from this:<br />
&#8230;snip&#8230;<br />
To this:</p>
<p>my $obj = MyObj->new();<br />
my @arr = ( $obj );</p></blockquote>
<p>Simplified or shortened?  I prefer the longer version to clarify what each step does (especially in an example&#8230;).</p>
<p><strong>fname lname</strong>:</p>
<p>DIM a$<br />
INPUT &#8220;Enter your name&#8221;, a$<br />
PRINT &#8220;Hello, &#8220;, a$</p>
<p><strong>Mike</strong>:</p>
<blockquote><p>Your example cites only references to the Standard Template Library, which is not an integral part of the C++ language itself.</p></blockquote>
<p>Since it&#8217;s part of the standard, I would argue that it is.</p>
<blockquote><p>I would agree that the STL is overly complex</p></blockquote>
<p>It remains an open question as to whether it is possible to implement a powerful library in C++ that does not require you to have a good feel for how it works under the covers before you use it.  Maybe someone can suggest an example of such a library.</p>
<p>Perhaps the compromise would be in terms of performance, which would take away a lot of people&#8217;s reasons for using C++ in the first place.</p>
<p>BTW, I never said that STL is overly complex, only that it is complex.</p>
<p><strong>Edgardo Portal</strong></p>
<blockquote><p>The three things you note about C++ are about the first thing most books mention (along with providing a (possibly virtual) destructor), so I’d venture to guess that most people venturing to use the STL would have that under their belts by then.</p></blockquote>
<p>I certainly didn&#8217;t have this under my belt when I first used STL containers - I just got scared and put pointers into STL containers and had to manage the memory myself.  Understanding by-value semantics came later for me.  Perhaps it was because I didn&#8217;t really read books.  (I&#8217;m trying to correct that now.)</p>
<p><strong>Sgt. Pepper</strong>:</p>
<blockquote><p>Another stupid and pointless C++ flame…</p></blockquote>
<p>It&#8217;s not a flame - I love C++!</p>
<p>I hope it&#8217;s not pointless - maybe it will help us think about things like:</p>
<p>- How to teach C++?  (e.g. Charles Bailey and I had an interesting chat today about whether you can teach C++ by starting with by-value semantics and only covering pointers later.  Hopefully he&#8217;ll blog about that, along with the myriad ways he disagrees with me :)</p>
<p>- How to write libraries?</p>
<p>- The need for mentoring of new developers?</p>
<p><strong>Max</strong>:</p>
<blockquote><p>To me it sounds more like you are saying C++ is a language for people that have actually used it for longer than a week.</p></blockquote>
<p>I have used it for several years and have loads left to learn.  I also know people who are way, way stronger than me and they say they have a lot left to learn as well.  You could be an incredibly fast learner.</p>
<p><strong>B.G.</strong>:</p>
<blockquote><p>The truth is, most developers writing C++ code are doing so using MFC, or the Borland equivalent (C++ Builder) - especially in Europe.</p></blockquote>
<p>I work as a programmer in Europe and I use STL whenever I can, which is a lot.  All the underlying classes we use company-wide are based on STL templates and algorithms, where they are appropriate.</p>
<p>STL is excellent!  I&#8217;ve heard that MFC is horrible, but I&#8217;ve never used it.</p>
<p>One reason to use the standard facilities is portability.  Surely for &#8220;Enterprise&#8221; software this is important?  Our product runs on 4 platforms, only one of which has MFC.</p>
<p>Lots of people at last week&#8217;s ACCU conference were very interested in STL, so some people are definitely using it.</p>
<blockquote><p>This post reads as old-school, pretentious, bullcrap! What’s next - every car should have a Porsche engine? Every medical procedure MUST be carried out in the number 1 US hospital? Every wife should appear in Maxim’s top 100 list before the ring is offered, otherwise they’re too ugly and should be dumped at the alter?</p></blockquote>
<p>I don&#8217;t understand your point.  Please could you be more explicit?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
