How long to learn a programming language?

<p>The following may contain personal and subjective opinions. Needless to say, they may or may not be appropriate for everyone. I want to make a long post so similar questions can be answered by providing a link.</p>

<p>First let me start off with this image. Please look at it.
<a href=“http://fyeahcomputersciencemajorpenguin.■■■■■■■■■■/photo/1280/4346885661/1/tumblr_lj4igxcniU1qhjhdt[/url]”>http://fyeahcomputersciencemajorpenguin.■■■■■■■■■■/photo/1280/4346885661/1/tumblr_lj4igxcniU1qhjhdt&lt;/a&gt;&lt;/p&gt;

<p>I am a sophomore in computer engineering. I don’t have a software job so I do not really deal with programming every day. But I am pretty good in Python, C++, and Matlab. I am still learning Java. </p>

<p>---- Prior to College (elementary school – high school) -----</p>

<p>I started out with HTML. HTML is not a programming language, but we can always treat it as one. It taught me how to create and design a webpage. At that time CSS wasn’t that popular at all because it just came out. I was in my 3rd grade by the way. You will be surprise how helpful knowing HTML and CSS can be in the future. In particular, you may be interested in working with a web framework written in Python, C++, or Java (or PHP, or Ruby, etc).
For years I was hopping from one thing to another (PHP, HTML, C++, Perl, etc), and until I hit my senior year I finally got my belly together and wanted to learn a language seriously. I picked C++. </p>

<p>---- College -----</p>

<p>I had my first programming class in my first semester of college. I didn’t need it. It’s an elective course, but I took it with a friend anyway because I really wanted to get to know computer science better. The professor was really laid back and he didn’t teach us how to program. He told us to google the syntaxes and play around with them. Later in the class we learned Python for a few weeks and we had a final project in Python. Fun! </p>

<p>In that class I learned to program in both Matlab and Python. Although I learned C++ over the summer before my freshman began, I didn’t really get what programming is about until I hit my first required programming class. Let’s called it CSC 102. 102 is required for all engineering students. It is taught in C++ (another section is Python, however). The professor was very nice too, but he doesn’t go too deep. I actually had time to investigate different technique in that class, because the work load wasn’t so bad. But some homework did take me an hour or two to get the right result.</p>

<p>Now I am taking my fourth computing class - software design (well CS major goes on with software engineering… not important at all in this discussion), and in software design we use Java. The class before this is Data Structure, and it is taught in C++.</p>

<p>From my experience (as a student), one has to pick his or her first language carefully. Everyone’s learning ability is different. What is true is that one can pick up another language with confident if and only if one has learned its first language correctly.
Take your time. You are still very young. Unlike me - I am becoming a junior next semester. I am running out of time to enjoy programming. Should I have known that programming would be part of my potential study I would cherish my time back in the days. If I actually did the right time back then, I would have at least eight years of programming experience prior to college.</p>

<p>---- So what is the right language for you? ----</p>

<p>I don’t know. But personally, I think C++ is better than Python.

  1. The philosophy of the two languages is very different.
         a. Python = minimalistic; more shortcuts than C++, and most of the time you just need to import the right modules.
          b. C++ is much older than Python. It comes with STL (standard template library), but beginners would not use it anyway. Thus, you would end up writing almost everything yourself.</p>

<p>Some of my classmates had troubles going from Python to C++ just because of that. </p>

<ol>
<li><p>Syntax rules are also different
     a. Python? No Semicolon, no braces like C++. No main function.
     b. C++ follows the C-style.
As I had tutored my classmates in 102 and had taught high school students to program in C++, I learned that C-style syntax really throw them off, and missing semicolon, braces are the most frequent errors during compilation.</p></li>
<li><p>Data types, defining variables, etc
    a. Python is an interpret language. In general, Python interpreter can figure out what type of data you are providing. I won’t get into the technical side of this, but as I said before, IN GENERAL, you don’t have to worry about integer (int), double, floating, etc.
    b. C++, however, you do. Defining the right data type and how to manipulate them look challenging to starters.</p></li>
</ol>

<p>There are many reasons why one would recommend Python over C++ to beginners. But all the obstacles will pay off. I recommend learning C++ before any other language. C’s printf, sprint aren’t really difficult. In a way I can relate them to Python’s . Anyway</p>

<p>I take my time to learn things. One day I asked people online for help because my loop didn’t work correctly. The helper told me to trace my output. I spent the rest of my night tracing the problem on papers… you can see that in the following link
[Untitled</a> Document](<a href=“http://www.i3physics.com/cplus/sentinel-solution.html]Untitled”>http://www.i3physics.com/cplus/sentinel-solution.html)</p>

<p>So which language is the best?
It really depends on the application. For example, last time I was counting money (bills, coins). I wrote a short program in Matlab because I can easily do vector algebra on Matlab. Say I have ten $1 bills, and twenty $0.25. In C++, Python, or Java, one has to write number<em>of</em>quarter * 0.25 to calculate the total of amount of quarter in dollars. I need to do that too in Matlab. But summating up the total (of everything) would require an additional line. Of course, if you know programming well, you can reduce unnecessary lines too (I can do this too). However, I don’t like typing too much. So in Matlab, I can sum the vector with a syntax sum().</p>

<p>— Finally remark —</p>

<p>Programming is a very small subset of your computer science education. In fact, writing code is a very small subset of a software developer’s work cycle. They spend most of their times debugging, writing comments (documentation), and planning. So unless you really like sitting in front of a desk tracing errors for hours (sometime you really do spend a few days just to find out), then programming is not going to be your candy. But don’t be afraid. Everyone has to go through this cycle, mentally.</p>

<p>Mainstream languages like C++, C, Java aren’t enough. Sometime you will be surprised how useful knowing languages like Fortran, Lisp (someone has mentioned it already), Hackshell, Bash…. Matlab would probably be always there in your statistical career.</p>