<?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>Alejandro Segovia Azapian &#187; Article</title>
	<atom:link href="http://www.alejandrosegovia.net/category/article/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alejandrosegovia.net</link>
	<description>C++ and Graphics</description>
	<lastBuildDate>Mon, 06 Feb 2012 08:00:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Linux Journal Article available online</title>
		<link>http://www.alejandrosegovia.net/2011/02/07/linux-journal-article-available-online/</link>
		<comments>http://www.alejandrosegovia.net/2011/02/07/linux-journal-article-available-online/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 15:00:18 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://www.alejandrosegovia.net/?p=45</guid>
		<description><![CDATA[I&#8217;m very glad to announce that the Introductory CUDA article I wrote for RealityFrontier (and that was published by the Linux Journal Magazine) is now available for online reading. You can access the article here: http://goo.gl/jFz3z; it features an introduction to Parallel Programming using the NVIDIA CUDA technology and some cool screenshots made using a renderer [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-48" title="Linux-Journal-cover-200" src="http://www.alejandrosegovia.net/wp-content/uploads/2011/02/Linux-Journal-cover-2001.jpg" alt="" width="120" height="161" />I&#8217;m very glad to announce that the Introductory CUDA article I wrote for RealityFrontier (and that was published by the Linux Journal Magazine) is now available for online reading.</p>
<p>You can access the article here: <a title="http://www.linuxjournal.com/article/10840/?page=0,0" rel="nofollow" href="http://goo.gl/jFz3z" target="_blank">http://goo.gl/jFz3z</a>; it features an introduction to Parallel Programming using the NVIDIA CUDA technology and some cool screenshots made using a renderer I wrote specifically for representing the concepts being treated in the article.</p>
<p>I can also provide links to the full source code used for the benchmarks, in case you want to have a look at it.</p>
<p>Just drop me a line in the comments. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alejandrosegovia.net/2011/02/07/linux-journal-article-available-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C as a programming learning language</title>
		<link>http://www.alejandrosegovia.net/2010/02/09/c-as-a-programming-learning-language/</link>
		<comments>http://www.alejandrosegovia.net/2010/02/09/c-as-a-programming-learning-language/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 21:58:48 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Education]]></category>

		<guid isPermaLink="false">http://www.alejandrosegovia.net/?p=12</guid>
		<description><![CDATA[Recently we were talking with a colleague from my University about how programming is taught nowadays in college. In my University, the programming language used for teaching how to program is Java. I was discussing with a colleague the disadvantages I saw in using it as a language for teaching programming basics and why, in [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we were talking with a colleague from my University about how programming is taught nowadays in college.</p>
<p>In my University, the programming language used for teaching how to program is Java. I was discussing with a colleague the disadvantages I saw in using it as a language for teaching programming basics and why, in my mind, it didn&#8217;t stack up against teaching a language such as plain C. The following story aims to reproduce the high points in the conversation.</p>
<p>Suppose you are a first year professor, teaching programming fundamentals, and I&#8217;m one of your students.</p>
<p>How would you start? If you&#8217;re anything like me, the first &#8220;hands-on&#8221; lab, you&#8217;ll probably write a classic &#8220;Hello World&#8221; program on the whiteboard and ask your students to copy that.</p>
<p>In order to do so, you instruct them to open up their &#8220;IDEs&#8221;, create a new class and copy that into a &#8220;method&#8221;&#8230;</p>
<p>Wait&#8230; what? As your student, chances are that by now, I&#8217;m probably wondering what an &#8220;IDE&#8221; is anyway.</p>
<p>As a teacher on a basic programming course, you&#8217;ll probably just tell me that IDEs are used for programming and that I&#8217;ll most likely have to use that every time I want to write a program (otherwise, what are we using it for?)</p>
<p>Okay, but &#8220;why don&#8217;t I have to use an IDE every time I want to use an application in my Windows&#8221;? Bam&#8230; now you must either explain the difference between code &#8220;in development&#8221; and code &#8220;in production&#8221; or ask me just to trust you and please focus on the example on the board for now.</p>
<p>Okay, let&#8217;s move on. You said I had to copy what you wrote into a &#8220;class&#8217; main method&#8221;&#8230; What is a &#8220;class&#8221; and what is a &#8220;method&#8221;? Ahh, okay. Here, you are trapped. Clearly these are OOP concepts, and you certainly don&#8217;t want to start digging into that before your students even write their first &#8220;Hello World&#8221; application. All you can do here is to ask them, once again, to just trust you by saying that &#8220;that&#8217;s the way things work in Java&#8221;.</p>
<p>So, your students have finally created a project in an &#8220;IDE&#8221;, created a &#8220;class&#8221;, defined a &#8220;public static&#8221; &#8220;method&#8221; and wrote the snippet you typed at the whiteboard in their IDE&#8217;s text editor.</p>
<p>The final code looks something like this:</p>
<pre class="brush:java">public class HelloWorld
{
    public static void main(String[] args)
    {
        System.out.println("Hello, world!");
    }
}</pre>
<p>They press &#8220;Play&#8221; on their &#8220;IDEs&#8221; and it just works. Everything is good.</p>
<p>Quick question: how many things in this code do you think are completely strange to your students? Probably all of it, since it&#8217;s the first time they&#8217;ve seen a program being coded. That&#8217;s okay, but how many of these things do you think are feasible to be explained in a programming 101 course? just <em>println</em>, maybe?</p>
<p>Why? Because in order to explain what a &#8220;class&#8221; is, what a &#8220;method&#8221; is, what &#8220;public&#8221;, &#8220;static&#8221;, &#8220;String[]&#8220;, &#8220;System&#8221; and &#8220;out&#8221; mean, you have to start digging into OOP concepts from day one. And you don&#8217;t want to do that, because chances are 1) you&#8217;ll end up confusing everyone and 2) most of that stuff will not really be useful for the course at all!</p>
<p>So&#8230; if teaching this way seems to be so complicated, why are we using Java for teaching programming? Well, I think we shouldn&#8217;t. C would be a much better candidate.</p>
<p>Compare the previous Java program with the following C equivalent:</p>
<pre class="brush:cpp">#include &lt;stdio.h&gt;
int main()
{
    printf("Hello, world!");
    return 0;
}</pre>
<p>Which one do you think is easier to explain? At most, what your will probably end up asking is &#8220;what does #include mean?&#8221;. You can just answer that it&#8217;s a file where printf is defined. That&#8217;s it. No strings attached. No &#8220;public static void Main(String[] args)&#8221;. Just a plain and simple <em>printf</em>.</p>
<p>What about all that &#8220;IDE&#8221; mess? Well, it turns out you can just use a plain text editor with some syntax highlighting and a C compiler and you are good to go. Compiling C code is extremely simple, if the system is correctly configured. Just issuing a command like the following will be enough for producing an executable file:</p>
<pre class="brush:bash">gcc hello.c -o hello.exe</pre>
<p>It&#8217;s that easy. And best of all is that you get an executable. A plain .exe file on Windows. That&#8217;s what your students <strong>are</strong> expecting. That&#8217;s what a program <strong>is</strong> to them. An .exe file! In Java, your compiler would&#8217;ve generated a &#8220;.class&#8221; file, and then you would have to teach your students how to invoke the Java Virtual Machine, explain what a Runtime is and why is it needed to have your code (which is already complied, isn&#8217;t it?) run.</p>
<p>Another final advantage? By asking them to compile their code by hand, you indirectly have them learn how to use the Terminal application (believe me, most students don&#8217;t know what that is or how it&#8217;s used nowadays) and you are laying the foundation for them to learn how to use a non-GUI operating system.</p>
<p>You can achieve all this (and more) without having to ask them to &#8220;trust you&#8221; or to hold their questions for one to two <strong>years</strong>, until they have their first OOP course.</p>
<p>You could argue that, even though Java might seem more complicated at first, it&#8217;s more popular and thus it could never be a mistake to teach it. I completely agree, but I think it should be taught as a second or third language, not as the first one. Not only does Java require the student to wait until he or she goes through 2 or 3 programming courses in order to be able to fully &#8220;get&#8221; the language, but also, there are some concepts that they will just never learn this way, such as memory management or pointers.</p>
<p>So, please, if you&#8217;re a programming 101 teacher who&#8217;s doing Java, I ask you to reconsider. C does not have to be hard, and your students will thank you for conducting a exhaustive, self-contained course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alejandrosegovia.net/2010/02/09/c-as-a-programming-learning-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

