<?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>A Series of Uncool Events &#187; Programming</title>
	<atom:link href="http://blog.uncool.in/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.uncool.in</link>
	<description>4 8 15 16 23 42</description>
	<lastBuildDate>Thu, 31 Dec 2009 18:11:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Episode 9: A Note to Myself</title>
		<link>http://blog.uncool.in/2009/10/27/episode-9-a-note-to-myself/</link>
		<comments>http://blog.uncool.in/2009/10/27/episode-9-a-note-to-myself/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 08:41:08 +0000</pubDate>
		<dc:creator>Ankur Sethi</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Things I Did]]></category>

		<guid isPermaLink="false">http://blog.uncool.in/?p=126</guid>
		<description><![CDATA[This post is exactly what the title says it is. Just a small note to remind me what I should be focusing on. Spending a weekend playing with genetic algorithms in Scheme is a wonderful learning opportunity, but it detracts from some of the bigger projects I&#8217;m working on. Idle curiosity can do more harm [...]]]></description>
			<content:encoded><![CDATA[<p>This post is exactly what the title says it is. Just a small note to remind me what I should be focusing on. Spending a weekend playing with <a href="http://en.wikipedia.org/wiki/Genetic_algorithms">genetic algorithms</a> in Scheme is a wonderful learning opportunity, but it detracts from some of the bigger projects I&#8217;m working on. Idle curiosity can do more harm than good if you&#8217;re trying to juggle college and code. Genetic algorithms can wait until Christmas.</p>
<h3>Ongoing Projects</h3>
<p>I never start projects. I bump into them. Sometimes they feel like a distant member of Grampa&#8217;s extended family. Other times, they feel like a close friend you&#8217;ve been dying to talk to for the past 6 months, but <em>gosh darn it</em> where&#8217;s his number? Unlike most seasoned hackers, I only have three large projects I wish to see to completion before I touch something new.</p>
<ul>
<li><a href="http://code.google.com/p/haiku-beacon/">index_server</a> &#8211; the full text indexing tool for <a href="http://haiku-os.org">Haiku</a> I wrote this summer.</li>
<li><a href="http://github.com/goonj/goonj/">Goonj</a> &#8211; a media player and music library manager for Mac OS X (I&#8217;m working on this with <a href="http://pratul.in">Pratul</a>).</li>
<li>Make the Dell Vostro 1520 100% Haiku compatible. For this, I need to write drivers for the following devices: (1) touchpad (2) wireless card (3) webcam and (4) sound card. I&#8217;ve already started digging through some driver code, but it will be a while before I have something usable.</li>
</ul>
<h3>Interests</h3>
<p>I&#8217;m a sad case, really. I need to write a blog post to remind myself what I&#8217;m interested in. If you don&#8217;t want your kids to turn out this way, make sure they take enough baths. Yes, even in winter.</p>
<p>High-level stuff bores me. I find I&#8217;m much more comfortable with C and C++ than Python. With that in mind, here&#8217;s a small overview of my fields of interest:</p>
<ul>
<li>Compilers</li>
<li>Virtual machines (and emulators)</li>
<li>Operating systems</li>
<li>File systems</li>
<li>Games (why not?)</li>
<li>Information retrieval</li>
</ul>
<p>Lately, I&#8217;ve been reading up on electronics. I&#8217;ve barely scratched the surface of what&#8217;s possible with just a few cheaply available components, and I&#8217;m already shaking with excitement. College does not permit me to learn as much as I&#8217;d like to, but I&#8217;m slowly getting there. I&#8217;ll have something to show for my efforts in a couple of months. Let&#8217;s see what comes of this new obsession <img src='http://uncool.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.uncool.in/2009/10/27/episode-9-a-note-to-myself/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Episode 5: Something to Do</title>
		<link>http://blog.uncool.in/2009/04/24/episode-5/</link>
		<comments>http://blog.uncool.in/2009/04/24/episode-5/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 15:36:53 +0000</pubDate>
		<dc:creator>Ankur Sethi</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.uncool.in/?p=88</guid>
		<description><![CDATA[First things first. Python and Django programmer for hire this summer (June and July). If anybody in or around New Delhi needs something built, I&#8217;m your man.
Now, on to the trivialities.
The results for Google Summer of Code 2009 came out on April 21, and I failed to make it. According to my mentoring organization, I [...]]]></description>
			<content:encoded><![CDATA[<p>First things first. <strong>Python and Django programmer for hire</strong> this summer (June and July). If anybody in or around New Delhi needs something built, I&#8217;m your man.</p>
<p>Now, on to the trivialities.</p>
<p>The results for Google Summer of Code 2009 came out on April 21, and I failed to make it. According to my mentoring organization, I was one of their top picks, but failed to get in because I didn&#8217;t submit as many patches as the other students. No GSoC work means I have no commitments this summer. <a href="http://code.scrapcrap.org">Akshay</a> is trying to get a RoR job somewhere, and I think <a href="http://rutsum.com">Apoorv</a> has something planned, too. I feel I ought to start making my own TODO list now.</p>
<p>I have spent the past few weeks thinking about how much time I waste on worthless activities (something which led to a fight between me and Apoorv &#8211; he&#8217;s absolutely certain he&#8217;s not wasting any time). The agenda for April is to cut out all the time-sucking activities from my routine. I&#8217;ll probably read up on time management and check out what the GTD hype is all about. Also part of the agenda is keeping my workspace clean. Right now, I have a single table for everything &#8211; study, web browsing, movies, programming and food. I&#8217;m going to have to try and keep my work and fun areas segregated so that when I sit down in my work chair, my mind goes, &#8220;Okay, time to work. No more distractions.&#8221;</p>
<p><a href="http://pratul.in">lut4rp</a> tells me I need to get some code &#8220;out there&#8221;. A lack of Objective-C knowledge is preventing me from delving deeper into Cocoa, so I will be spending some time writing ObjC code and putting it up on GitHub for everyone to see (and laugh at). I really wish I could spend more time with Python, but I want to go indie with a few desktop apps and that&#8217;s something which Python fails to do well (at least on OS X). I want to push the limits of ObjC, just to see how dynamic it really is (so far, I&#8217;ve used it like a spiced up version of C). In my experience with the language so far, I have felt it is nothing compared to heavyweights of the dynamic world &#8211; Ruby and Python. I sincerely hope I&#8217;m wrong.</p>
<p>The next logical step after Objective-C is to sharpen my 1337 Cocoa skillz. The strategy this time is to leave the more advanced technologies for later. What&#8217;s the point of getting into CoreData or Keyring Services if I never plan to use them? As an aside, the Hillegass book is awesome, but I don&#8217;t think it&#8217;s written for people new to Cocoa. It reads more like a cookbook than an introduction to OSX programming. I&#8217;ll be using Apple&#8217;s docs + online tutorials (and refer to Hillegass if the need arises). Since I&#8217;ve already covered more than 50% of what is required to write decent OSX apps, my next steps are mostly going to center around getting familiar with the libraries available to me.</p>
<p>My one-post-a-day idea bombed, mostly because exams kept me busy. I had two weeks of exams, followed by a week of semi-rest, followed by a week of practical exams. Another round of practicals begins on Monday, which will be followed by ten days of semi-rest and another two weeks of exams. The last two months of the semester are always like this at IPU. I&#8217;m used to it now, so no worries :p </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.uncool.in/2009/04/24/episode-5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Episode 4: Things Nobody Will Ever Tell You (At Least Not Nicely)</title>
		<link>http://blog.uncool.in/2009/04/03/episode-4-things-nobody-will-ever-tell-you-at-least-not-nicely/</link>
		<comments>http://blog.uncool.in/2009/04/03/episode-4-things-nobody-will-ever-tell-you-at-least-not-nicely/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 15:17:38 +0000</pubDate>
		<dc:creator>Ankur Sethi</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.uncool.in/?p=84</guid>
		<description><![CDATA[I have found that students of computer science (CS) and information technology (IT) in most Indian colleges have several misconceptions about programming and computers in general. This seems to be a common problem in other parts of the world, too. I&#8217;ve made a list of some of the most common problem areas, and I&#8217;m posting [...]]]></description>
			<content:encoded><![CDATA[<p>I have found that students of computer science (CS) and information technology (IT) in most Indian colleges have several misconceptions about programming and computers in general. This seems to be a common problem in other parts of the world, too. I&#8217;ve made a list of some of the most common problem areas, and I&#8217;m posting it here for the benefit of annoyed geeks all over the world who have to explain these things over and over to that annoying but <em>hawt</em> girl who never goes out with them. No offense meant to any annoying but <em>hawt</em> girls who might be reading this right now. Would you like to go out with me? I&#8217;m free this Friday at 7:00 PM.</p>
<p>Note that most of the problem areas I have listed deal with C++ and the Turbo C++ IDE. This is because most Indian colleges teach C and C++ in the first two years of the CS/IT course.</li>
<ul>
<li>C++ is a programming language, not a piece of software. To convert the C++ syntax into an executable, you need a compiler. In Indian colleges, Turbo C++ is a widely used compiler. So, if you need TC++, you have to ask me, &#8220;Do you have a C++ compiler?&#8221;, not, &#8220;Do you have C++?&#8221;. It&#8217;s not only annoying, but it shows you are incompetent.</li>
<li>Besides Turbo C++, there are many other compilers you could be using. Loosely speaking, C++ itself is a standard document containing all the rules of the language. Any compiler that follows these rules can compile your C++ code. Two compilers you will inevitably have to deal with are Microsoft Visual C++ and the GNU Compiler Collection (popularly known as GCC). More on this later.</li>
<li>A compiler is a command line tool. That means it has no graphical user interface (GUI) you can see. You just send it a C++ file, and it spits out an executable. The Turbo C++ IDE hides this compiler from you. When you press CTRL+F9, it sends your C++ code to the compiler along with several other options that tell the compiler to compile the code and produce an executable. If it wasn&#8217;t for the Turbo C++ IDE, you would have to type these commands by hand every time you wanted to compile your code. Again, more on this later.</li>
<li>Turbo C++ is a compiler. The Turbo C++ IDE is an integrated development environment (that&#8217;s what IDE stands for). The job of an IDE is to provide you with an editor (where you type your code), several tools to make your programming job easier (highlighting keywords, the ability to look up things in a help browser etc.) and to make it easy for you to organize your projects. That blue screen where you type all your code is not the compiler, it&#8217;s the IDE. A few of the most popular IDEs are Microsoft Visual Studio, Eclipse, NetBeans etc.</li>
<li>A C++ file (i.e., a file with a &#8220;cpp&#8221; extension) is just a plain text file containing code. You can open it in any text editor and make changes to it. Note that a text editor is a piece of software that is used to create plain text files without any formatting. Notepad is a plain text editor, whereas WordPad and Microsoft Word are not since they are used to create formatted documents.</li>
<li>Windows is an operating system from Microsoft. I&#8217;m sure you know what that means. What nobody ever told you was the fact that most of the popular operating systems differ from each other in many fundamental ways. If you compile a piece of code on Windows, and then run it on another computer running Windows, it will work perfectly. On the other hand, if you try to run that executable on a Linux or Mac OS X machine, it will not run because of these fundamental differences. That is the reason none of your Windows games work on Linux/OS X.
<li>
<li>Nope, you can&#8217;t &#8220;hack&#8221; a computer using just a simple tool. Ankit Fadia might claim he can teach you how to hack, but he knows no more about &#8220;hacking&#8221; than a tea leaf knows about the history of the East India Company. The correct term for breaking into a system by exploiting weaknesses in it is called &#8220;cracking&#8221;, and it&#8217;s not something you can learn in a classroom. That &#8220;ethical hacking&#8221; course is a fraud.</li>
<li>A programming language is supposed to be studied as a coherent whole. If you say &#8220;I&#8217;m great a loops, but I don&#8217;t understand functions.&#8221;, that indicates you don&#8217;t get programming.</li>
<li><b>Update [April 4]: </b>This is the most important part of this entire post, yet it inexplicably slipped my mind. Turbo C++ is a very old compiler from a bygone era. Nobody, I repeat, <em>nobody</em> uses it for actual development. I reccommend using the <a href="http://gnu.org/software/gcc">GNU Compiler Collection</a>. But GCC is just a set of compilers (and some related tools) which you will have to operate from the command line &#8211; not an easy task for someone who is just starting out. What you need is a decent IDE to go with your compiler. <a href="http://bloodshed.net">Bloodshed Dev C++</a> is a very nice IDE meant for beginners, and it comes with GCC so you won&#8217;t have to install that separately. Do yourself a favor and download it right now.</p>
</ul>
<p>I will keep adding new points to this list as I encounter them. Leave your suggestions in the comments section of this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.uncool.in/2009/04/03/episode-4-things-nobody-will-ever-tell-you-at-least-not-nicely/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Thoughts on Using a Mac as a Development Platform</title>
		<link>http://blog.uncool.in/2009/03/10/thoughts-on-using-a-mac-as-a-development-platform/</link>
		<comments>http://blog.uncool.in/2009/03/10/thoughts-on-using-a-mac-as-a-development-platform/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 18:25:06 +0000</pubDate>
		<dc:creator>Ankur Sethi</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.uncool.in/?p=47</guid>
		<description><![CDATA[This post was inspired partly by this Reddit post.
Take my opinions on the Mac as a development machine with a grain of salt, since I&#8217;m neither a professional programmer, nor do I contribute to any major open source projects. I&#8217;m still in the early stages of hackerdom, and most of the code I write is [...]]]></description>
			<content:encoded><![CDATA[<p>This post was inspired partly by <a href="http://www.reddit.com/r/programming/comments/83jyb/proscons_of_using_a_mac_as_a_development/">this</a> Reddit post.</p>
<p>Take my opinions on the Mac as a development machine with a grain of salt, since I&#8217;m neither a professional programmer, nor do I contribute to any major open source projects. I&#8217;m still in the early stages of hackerdom, and most of the code I write is either for learning, part of simple scripts I write to automate tedious tasks or, more recently, part of small desktop apps I write using the Cocoa libraries. Even though I haven&#8217;t written or worked on any complex piece of software, I grew up using Linux and open source software and have been exposed to many different programming languages (before I settled on Python as my language of choice). I installed Fedora Core 1 (or was it FC2?) just for fun when I was 14 and ended up using various Linux distributions for about four years before I bought my MacBook.</p>
<p>I bought the MacBook about 8 months ago, and started learning Cocoa for writing desktop apps for the Mac, and I&#8217;m loving every bit of it.</p>
<p>All right, here&#8217;s my list.</p>
<h3>The Good Parts</h3>
<ul>
<li>Mac OS X is UNIX under the hood. Heck, launch Terminal.app and have fun playing with awk, grep, sed and friends &#8211; the same stuff one would use under Linux. OS X also comes with Perl pre-installed. I have no idea if Python and Ruby are parts of the core system, but they&#8217;re definitely parts of Apple&#8217;s Developer Tools package.</li>
<li>You can grab all your favorite editors and languages off <a href="http://macports.org">MacPorts</a>, which is very similar to Debian&#8217;s APT (actually, it&#8217;s closer to Gentoo&#8217;s <i>emerge</i> tool).</li>
<li>Most Linux applications run perfectly on Mac OS X. In fact, many of the lesser known apps have Linux and Mac OS X ports, but no Windows ports. The <a href="http://transmissionbt.com">Transmission</a> BitTorrent client is one example.</li>
<li>I believe the UI of my OS has a profound effect on my productivity. The OS X UI has been designed to not draw attention to itself unless you look very hard. Contrary to popular belief, OS X does not have any eye candy, unless you consider smooth transitions from boot screen to login screen to the desktop eye candy. Exposé and Spaces look like eye candy to someone who has never touched a Mac before, but they are productivity features which just happen to be beautifully designed. A stock Ubuntu system with Compiz has much more intrusive eye candy than a stock OS X system.</li>
<li>If you&#8217;re looking for a new programming language and a new set of APIs to learn, then there&#8217;s no better choice than Objective-C and Cocoa (this is exactly what I&#8217;m learning these days). After having written a few apps using Cocoa, you will never want to go back to writing apps for Windows or Linux. The API is consistent and well designed, and contains classes for the most common tasks you might wish to perform in a desktop app. Interface Builder is awesome in the true sense of the word, and unlike most other IDEs, XCode is fast, responsive and almost a pleasure to use (<em>almost</em>, because I still prefer the editing capabilities of Emacs over any other editor).</li>
<li>No tinkering with config files, no hardware driver issues, minimal maintenance, no slowdowns over time, no malware issues and not having to do an <i>apt-get upgrade</i> every three hours. The <i>it just works</i> nature of the Mac has given me more time to work on my own code, rather than spending most of my time finding ways around other people&#8217;s mistakes.</li>
</ul>
<h3>The Bad Parts</h3>
<ul>
<li>If you&#8217;re writing commercial applications, then Windows is the way to go. Apple will <i>never</i> have significant market share on your average desktop, since both Windows and Linux can run on anything from a Rs.25000 ($500) Zenith desktop to a custom built, Rs.65000 ($1360) gaming machine, whereas the Mac OS runs only on Apple hardware.</li>
<li>Macs don&#8217;t play well with other operating systems. Installing Windows using BootCamp works fine and dandy, but running it for a long time causes my MacBook to heat up to over 65ºC. While installing Linux on a Mac is easy, it&#8217;s not officially supported by BootCamp, and getting it to play well with the hardware requires many hacks and workarounds.</li>
<li>Customizing a Mac is not easy. Linux allows you to customize every aspect of the OS, and even Windows allows a certain level of customizability, but the Mac allows none. Be prepared to either install unsafe hacks that mess with the OS or just STFU and follow the One True Way of Steve Jobs.</li>
<li>Be prepared to pay for quality. The software-wants-to-be-free culture of the Linux world is not acceptable in the Mac world. If you can&#8217;t pay up, then have fun using unstable ports of clumsily put together GTK apps under the X-Server.</li>
</ul>
<p>Even though the Mac has its own disadvantages, I&#8217;d rather use a Mac than a Windows/Linux machine for development any day.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.uncool.in/2009/03/10/thoughts-on-using-a-mac-as-a-development-platform/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Computer Science FAIL &#8211; Higher Education in India</title>
		<link>http://blog.uncool.in/2009/01/19/computer-science-fail-higher-education-in-india/</link>
		<comments>http://blog.uncool.in/2009/01/19/computer-science-fail-higher-education-in-india/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 18:15:17 +0000</pubDate>
		<dc:creator>Ankur Sethi</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.uncool.in/?p=30</guid>
		<description><![CDATA[Update (March 13): He&#8217;s back, but now he&#8217;s simply shying away from what he doesn&#8217;t know.
Update: The professor in question has been reported and is now banned from taking any more classes.
This piece might come across as one intended to bad mouth my own college, but I have a sneaking suspicion that things aren&#8217;t all [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update (March 13): </b>He&#8217;s back, but now he&#8217;s simply shying away from what he doesn&#8217;t know.</p>
<p><b>Update:</b> The professor in question has been reported and is now banned from taking any more classes.</p>
<p>This piece might come across as one intended to bad mouth my own college, but I have a sneaking suspicion that things aren&#8217;t all rosy in other parts of the country either.</p>
<p>I suppose every geek has had this same feeling before. You take a seat in the front row of your first <em>Introduction to Programming</em> lecture, all worked up about the fact that here, finally, is a class you can be on top of. The professor walks in, gives a little introduction, and you realize it&#8217;s going to be a long, long semester.</p>
<p>Today I decided to make a list of all the atrocities committed by my <em>Introduction to Programming</em> professor. I wasn&#8217;t expecting much because, even though he sounded like a complete knucklehead to the geek inside me, I was sure he at least knew the textbook inside-out. I was, as one would expect, wrong. So, hackers, get ready to cringe. Here&#8217;s my list.</p>
<ul>
<li><em>&#8230; Linux is basically a DOS based OS.</em></li>
<li><em>These days we are using 128 and 256 bit processors.</em></li>
<li><em>A compiler is a software that converts code written in a particular programming language to machine code. To compile a program, you must hit ALT+F9.</em> (It took me a while to realize he was talking about the Borland Turbo C++ IDE from 1992, a prehistoric compiler Indian colleges use for all C and C++ courses.)</li>
<li><em>The object code generated by a C++ compiler is almost identical to that produced by a Java compiler.</em></li>
<li><em>The first high level language was Ada, also known as Smalltalk.</em> (This was a big WTF moment.)</li>
<li><em>The second high level language was COBOL, which was an improvement over Ada.</em> (Cringe, cringe, cringe.)</li>
<li><em>FOTRAN came after COBOL.</em> (No, &#8220;FOTRAN&#8221; is not a typo. This is what he said.)</li>
<li><em>FOTRAN, COBOL, Ada and Smalltalk were not general purpose languages.</em></li>
<li>This one is classic: <em>C was the first language to run on UNIX systems. All languages before C ran only on Windows.</em></li>
</ul>
<p>I still haven&#8217;t completely recovered from the shock.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.uncool.in/2009/01/19/computer-science-fail-higher-education-in-india/feed/</wfw:commentRss>
		<slash:comments>196</slash:comments>
		</item>
		<item>
		<title>Learning New Programming Languages and APIs &#8211; What I Was Doing Wrong</title>
		<link>http://blog.uncool.in/2009/01/18/learning-new-programming-languages-and-apis-what-i-was-doing-wrong/</link>
		<comments>http://blog.uncool.in/2009/01/18/learning-new-programming-languages-and-apis-what-i-was-doing-wrong/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 17:45:30 +0000</pubDate>
		<dc:creator>Ankur Sethi</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.uncool.in/?p=17</guid>
		<description><![CDATA[For the past few months, I have been trying to learn how to write GUI applications for the Mac. The two best toolkits for this task are Cocoa and Qt. Since I have never written any GUI code before and none of my projects have ever been very complex, learning these two libraries turned out [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few months, I have been trying to learn how to write GUI applications for the Mac. The two best toolkits for this task are <a href="http://developer.apple.com/referencelibrary/Cocoa/">Cocoa</a> and <a href="http://trolltech.com">Qt</a>. Since I have never written any GUI code before and none of my projects have ever been very complex, learning these two libraries turned out to be a tough nut to crack. After many months of trying to become proficient at writing GUI code and failing, I have finally found out what I was doing wrong all this time. The fact that I have finally grasped Qt using my new methods is proof that my old methods had some very serious flaws. The following points are written in context of learning new APIs and languages, but they apply equally well to anything else you might ever want to learn.</p>
<h3>Hand-Holding Doesn&#8217;t Get You Anywhere</h3>
<p><b>What I Did Wrong:</b> I looked for a book on Qt which made understanding GUI programming concepts simple for a beginner such as myself.</p>
<p><b>Correction: </b>Such a book does not exist. Picking up a <em>For Dummies</em> book (or something equivalent) means shooting yourself in the foot. If you expect people to guide you step-by-step through learning difficult subjects, you should probably not be writing code at all.</p>
<h3>Immerse Yourself in the Material</h3>
<p><b>What I Did Wrong:</b> I searched hard for a book that would teach me Qt from beginning to end. I spent hours reading reviews, blog posts, forums and back covers searching for the One Book.</p>
<p><b>Correction:</b> One source is never enough, and the One Book does not exist. The best way to learn any new API or language is to completely immerse yourself in the material. Subscribe to mailing lists, hang out in IRC channels, read blog posts, articles and tutorials, help people out at <a href="http://stackoverflow.com">StackOverflow</a>, read code written by the experts, try to modify existing code, add new features to your favorite application and talk to people who know the stuff well. Oh, and buy a good book.</p>
<h3>Don&#8217;t be Systematic</h3>
<p><b>What I Did Wrong:</b> I tried to systematically study the material from the first chapter to the last, completing every exercise given in the text.</p>
<p><b>Correction:</b> Being systematic is the biggest mistake I made while learning Qt. Trying to be systematic will only tire your mind as you tediously work through some trivial exercise the author thought was important. Programming is a creative activity. The most painless way to learn something is to just let your brain run wild. Speculate, dream, design, experiment. Skip the boring exercises and do only the ones you find interesting or, better still, make up your own exercises. When you find yourself unable to complete the task you put yourself up to, skip around the book and try to find a way to solve the problem.</p>
<h3>Taste Things First</h3>
<p><b>What I Did Wrong:</b> As I read through the material, I typed the code samples into my editor to see what the author was trying to say. I moved on to the next chapter only when I had tried out every code sample and completed every exercise in the current chapter.</p>
<p><b>Correction:</b> When you&#8217;re reading through the material for the first time, always read it like it&#8217;s a novel. Instead of focussing on <em>how</em> you can accomplish a certain task, focus on <em>what you can accomplish</em>. This way, you will know the strengths and weaknesses of your tools before you sit down to code. Most importantly, you will know where to look for the functionality when you actually need it. Reading the material quickly makes it seem like you&#8217;ve accomplished a lot in very little time which keeps your brain from getting bored. Also, it makes reading through it the second time (this time focussing on the details) much easier.</p>
<h3>Aim High</h3>
<p><b>What I Did Wrong:</b> Whenever I didn&#8217;t understand something, I told myself it was okay. Whenever I felt stupid because I couldn&#8217;t grasp a simple concept, I told myself to relax. I thought it was okay to fail, and that not many undergrads even know about Qt. <em>Hell</em>, I thought, <em>there are so many great hackers who didn&#8217;t even know how to program at my age</em>.</p>
<p><b>Correction:</b> When you&#8217;re evaluating yourself, always compare yourself to the people who are better than you. If you think you&#8217;re stupid, you probably are.</p>
<p>These techniques were partly based on <a href="http://www.paulstips.com/brainbox/pt/home.nsf/link/11052006-Six-steps-for-learning-difficult-subjects-quickly">this article</a>. Check it out, it&#8217;s pretty good.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.uncool.in/2009/01/18/learning-new-programming-languages-and-apis-what-i-was-doing-wrong/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My Code Dojo</title>
		<link>http://blog.uncool.in/2009/01/08/my-coding-dojo/</link>
		<comments>http://blog.uncool.in/2009/01/08/my-coding-dojo/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 18:53:49 +0000</pubDate>
		<dc:creator>Ankur Sethi</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.uncool.in/?p=8</guid>
		<description><![CDATA[Update (March 27): It failed. It&#8217;s gone now.
From the site: [Uncool's Code Dojo] is a database of short, fun programming tasks that can be solved in under a week&#8217;s time.
Here&#8217;s a problem &#8211; I&#8217;ve just learned this new do-all-end-all-super-mofo programming language but I don&#8217;t know what to do with it. The Code Dojo is my [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update (March 27)</strong>: It failed. It&#8217;s gone now.</p>
<p>From the site: <i>[Uncool's Code Dojo] is a database of short, fun programming tasks that can be solved in under a week&#8217;s time.</i></p>
<p>Here&#8217;s a problem &#8211; I&#8217;ve just learned this new do-all-end-all-super-mofo programming language but I don&#8217;t know what to do with it. The Code Dojo is my contribution to bored programmers everywhere who share the same feeling.</p>
<p>Visit the Dojo at <a href="http://dojo.uncool.in">http://dojo.uncool.in</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.uncool.in/2009/01/08/my-coding-dojo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
