Stories
Slash Boxes
Comments

SoylentNews is people

posted by LaminatorX on Saturday January 24 2015, @01:02AM   Printer-friendly
from the bicycle-chains dept.

Blogger Carl Cheo, who maintains a website providing numbered lists of tips for maximizing online productivity, has pulled together an easy-to-follow graphic answering the newbie question "What programming language should I learn first?" (pdf here). Cheo chose nine commercially viable languages as possible destinations as the viewer navigates the flow chart. Further down the page, there are tabs with annotated links to educational resources for each language. So what's in it for Soylentils, most of whom I'm guessing were programming newbies in the previous millenium? Well, maybe you have nephews or nieces who chose the wrong major in college. Besides, the graphic is amusing and clever, though probably not the last word on the subject.

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Informative) by doublerot13 on Saturday January 24 2015, @02:08AM

    by doublerot13 (4497) on Saturday January 24 2015, @02:08AM (#137516)

    I'd learn the languages I know in this order...

    -Python
    -Java
    -C++/C
    -Scheme
    -Smalltalk
    -MIPS asm

    I actually started with C++. I don't recommend it. It might make you hate programming, before you know programming.

    Starting Score:    1  point
    Moderation   +1  
       Informative=1, Total=1
    Extra 'Informative' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 2) by hash14 on Saturday January 24 2015, @02:50AM

    by hash14 (1102) on Saturday January 24 2015, @02:50AM (#137523)

    Yeah, C++ is a mess and a first language to learn because it tries to be multiple things - compatible with C and native-binary object-oriented at the same time.

    If you're going to be a lifelong programmer, you have to understand both how the computer works, and how to use those tools to do what you want to achieve. And everybody learns these things a different way, so there's no single shot that will work for everyone.

    But given these requirements, I would probably prefer learning both C and Python together as first languages. C because it helped me understand what the computer is really doing when I program it; and Python because it helps me grasp what I can really do when I know what I'm doing.

    In fact, the first time I ever used Python (zero previous knowledge) was when I had to solve a numerical programming problem and I finished it in about half a day. But still, if all I knew today were Python, I would still have no understanding of what the computer was doing and as a result, I would have no trust that anything I had created was ever actually working as I intended. And let's not forget that this also teaches concepts like interpreted vs. compiled, static vs. dynamic, etc.

    So ultimately, I would say that it's good to know a mix, and then meet in the middle when you find the right balance of productivity and usefulness for what you're trying to do. No one can call his or her self a software engineer/computer scientist knowing only one language. Ultimately, a programming language is a tool and any good engineer has to know how to pick the right one.

    And sorry for omitting functional languages... but in all honesty, those are actually my favorites...

  • (Score: 3, Insightful) by Marand on Saturday January 24 2015, @04:19AM

    by Marand (1081) on Saturday January 24 2015, @04:19AM (#137541) Journal

    If I could change anything about what I've learned, it would be to pick up Ruby a lot sooner than I did. I kept avoiding it because I already knew Perl inside and out, and OO-heavy languages like C++ and Java never really clicked for me, so the idea of "it's sort of like Perl or Python, but fully OO!" just didn't seem compelling.

    As it turns out, Ruby's approach of making everything in the language an object, along with the Smalltalk message-passing concept, is what finally made OOP click for me. Being able to poke at the insides of all the data types, getting info about the objects, and doing things like 10.methods.sort and seeing all the methods, including operators like + and -, helped make OOP make sense to me in a way that all the inane examples in books and tutorials never did. (Like Java's "imagine a class as a bicycle, and a subclass as a specific type of bicycle, blah blah blah" shit.)

    It seems like it'd be a good language for beginners to start on, though I don't see people suggest it. It's always Python for some reason.

    ---

    I don't get why people are so hung up on Python being such a great beginner language. It even shows up in that infographic, with "I prefer to learn things the [easy|best] way" suggesting Python, and a bit about "widely regarded as the best language for beginners". The syntax is alien compared to other languages and encourages you to not think about closing blocks, so if anything, it seems like it would teach bad habits. But hey, at least the code will be indented nicely, I guess.

    I would think that something with a more flexible syntax and clear block beginnings and endings would be more useful when getting started. Perl gets you closer to a C-style syntax while being lenient, for example, or Ruby for more flexible block structure using real words instead of curly braces and a better introduction to OOP. Not the only examples, of course, but the point is that a bit of lenience is good at the start, and they're both very forgiving, with a lot of punctuation (periods and parentheses especially) frequently being optional.

    During learning/testing, I tend to slam out some quick test code first, then indent it after. One focus at a time. Even after knowing other languages, I found Python's insistence annoying. If I'd had my first programming language harassing me for not indenting to its preference, interrupting me from picking up basic language concepts, I probably would have said "fuck this" and found something else to do instead.

    It's not just about Python, though. Like you said, you started with C++ and it could have been detrimental, and I've had the same experience with Java (hate hate hate). When you're first starting, a language being "good" is less important than the language being easy to get something useful out of with as few barriers as possible. As a beginner, you're either doing it because you want to make something or because it seems fun. Not because you want to sacrifice boilerplate code and syntax errors to the compiler gods.

    • (Score: -1, Troll) by Anonymous Coward on Saturday January 24 2015, @04:53AM

      by Anonymous Coward on Saturday January 24 2015, @04:53AM (#137550)

      As it turns out, Ruby's approach of making everything in the language an object, along with the Smalltalk message-passing concept, is what finally made OOP click for me.

      So basically, you're retarded.

    • (Score: 2) by M. Baranczak on Saturday January 24 2015, @02:46PM

      by M. Baranczak (1673) on Saturday January 24 2015, @02:46PM (#137621)

      "Flexibility" is not a good thing for beginners, because it makes things more complicated. When there's 20 different ways to iterate over a list, it means you have to learn all of them, otherwise you won't be able to read other people's code. And having the freedom to indent however you want is a detriment for people who still haven't learned the importance of proper indentation.

      Ruby and Python are both good choices for beginners, I just think Python's better. It's simpler, and it teaches good habits.

      • (Score: 2) by Marand on Sunday January 25 2015, @02:47AM

        by Marand (1081) on Sunday January 25 2015, @02:47AM (#137752) Journal

        And having the freedom to indent however you want is a detriment for people who still haven't learned the importance of proper indentation.

        Ruby and Python are both good choices for beginners, I just think Python's better. It's simpler, and it teaches good habits.

        I get the reasoning, I just don't entirely agree. What good habits does Python teach? You get indentation at the cost of not learning to close blocks properly, that's a wash at best. You also get taught that if you aren't doing it the way the devs like then you're wrong. I don't see how that's a good habit, either. The forced indentation also interferes with code sharing unless everyone indents the same (usually PEP-8) way, going back to "do what the devs like or GTFO"

        Good formatting is important, yes, but shouldn't be the primary reason to teach a specific language, especially in a controlled environment where you can have the instructor kick your ass for poor coding practices.

        I'm not saying it's a terrible choice, and it's definitely far better than diving right into C or Java as a starter language. It's just that I don't think it's all rainbows and unicorn farts and the best teaching langauge ever like the smug pythonistas seem to think.

        "Flexibility" is not a good thing for beginners, because it makes things more complicated. When there's 20 different ways to iterate over a list, it means you have to learn all of them, otherwise you won't be able to read other people's code

        What? No it doesn't. It means you can learn all of them, not that you must. Certain ways are more common and, especially if you're using something like Perl's camel book or Ruby's pickaxe book, the style should be consistent throughout. Realistically you'll only be learning one way, at least at first.

        I wasn't talking about Perl-style "there's 50 ways to do it, all of them unreadable" anyway. That's why said flexible syntax, and mentioned optional parentheses as an example of what I meant, though it also includes things like requiring semicolons at end-of-line. I think reducing unnecessary punctuation is a good thing, especially when it allows English-like constructs. For example, a Ruby if/else without parentheses:

        if a == b then
            print "match"
        else
            print "no match"
        end

        Even without more than the vaguest understanding of programming it should be readable and can cleanly parsed in English. "if a equals b then print 'match', else print 'no match'. End." Python get some of it (no semicolons), but it's more strict about parentheses in other places and makes you litter colons around instead of sticking to words.

        It doesn't seem like a big deal if you're already familiar with other languages, but if you're picking up these fundamentals for the first time, it helps if they can be represented in an English-like way. (I happen to like Perl's "unless" statement for if-not-equals stuff for similar readability reasons, but wouldn't necessarily throw it at a newbie right off)

        • (Score: 2) by Magic Oddball on Sunday January 25 2015, @07:12AM

          by Magic Oddball (3847) on Sunday January 25 2015, @07:12AM (#137795) Journal

          You also get taught that if you aren't doing it the way the devs like then you're wrong. I don't see how that's a good habit, either.

          That's what I was originally taught about C in the class I took back in college — if we didn't write code in the same nebulous style the instructors preferred, we'd only get partial credit for our work even if the program performed perfectly. Our final exam was even multiple choice, with "which of these is written the right way" type questions with a partial focus on style. (Suffice to say I felt lucky that I got a C in the class.)

          • (Score: 2) by Marand on Sunday January 25 2015, @08:51AM

            by Marand (1081) on Sunday January 25 2015, @08:51AM (#137811) Journal

            At least with an instructor, after the class is done you can adjust your style to your liking. In that way it's sort of like martial arts; while learning, you have to do what the teacher wants, but inevitably it gets changed to suit you, sometimes only slightly, sometimes greatly. It's harder to do that when the "my way or the highway" is baked in, which is what I don't like about Python. There's plenty to like about the language, but it just has this authoritarian feel to it in some ways that I don't care for and would find unappealing as a learning language.

          • (Score: 2) by maxwell demon on Sunday January 25 2015, @11:31AM

            by maxwell demon (1608) Subscriber Badge on Sunday January 25 2015, @11:31AM (#137840) Journal

            Of course you got a C. It was a C class, after all.

            --
            The Tao of math: The numbers you can count are not the real numbers.
  • (Score: 2) by bzipitidoo on Saturday January 24 2015, @05:41AM

    by bzipitidoo (4388) Subscriber Badge on Saturday January 24 2015, @05:41AM (#137555) Journal

    I figured Python would be the winner. It really does have a cleaner syntax.

    The order I learned was roughly:

    BASIC (TRS-80, Applesoft, GW)
    6502 assembler

    DOS batch
    Pascal
    PL/1
    assembler on an IBM mainframe
    assembler on a DEC VAX
    x86 assembler
    Scheme
    Prolog
    C

    Fortran
    shell script (bash)
    HTML
    C++
    Java
    Perl 5
    SQL
    CSS
    JavaScript
    Python

    This reflects what was available. Some have said, for dramatic effect, that learning BASIC first causes irreparable damage, teaches bad habits that can't be unlearned, but it's not true of course. Got my start in middle and high school on the TRS-80 and Apple II+. Then in the poor quality CS program I attended, in which they took an engineering emphasis and didn't teach such fundamental concepts as Big O, I learned Pascal, and PL/I of all things. I mean, if they're not going to do a proper job of teaching algorithms, just going to hammer on specific programming languages and snuggle up to specific hardware by emphasizing assembler, you'd think they could at least pick good languages, particularly a close to the metal language like C, and not an old dog like PL/I. But their senior professor was an old IBM mainframe hacker, even pushed Job Control Language. At least they taught Scheme, which I found difficult maybe because that's where I really had to unlearn those bad habits I picked up from BASIC? They did not teach in C, I had to learn that on my own. I learned C++ on my own after graduation, but still before the STL existed. By the time I picked up Perl 5, learning a new language was no big deal any more. The underlying principles are much the same, all I need is a reference manual and I can be writing code within the day. Sadly, most employers won't hear a word of that, and remain firmly committed to the idea that experience in a specific language is what counts, whether or not they really believe that themselves.

    Perl was my introduction to the next generation, and I was thrilled that hashes were a built in type, and it was no longer necessary to hack together your own crummy throwaway hash function like you'd have to in C, before the days of the STL. The regular expression engine was very cool too. And not having to declare variables was real convenient, gets rid of boilerplate, saves time. It was a nice return to and improvement on a feature of BASIC I'd always liked and never could see why Pascal, PL/1, C/C++, Java, Modula, and seemingly every "professional" and "real" language didn't allow. Maybe Pascal could be expected to take that attitude since it was strictly typed, but C? And then Java is even more anal, forcing the programmer to put each class in a separate file. One big thing I don't like about Perl is having to use the $ sigil all over the place, but it seemed the price of not having to explicitly declare "scalar" variables. However, Python manages that trick, so why can't Perl?

    • (Score: 0) by Anonymous Coward on Saturday January 24 2015, @06:40AM

      by Anonymous Coward on Saturday January 24 2015, @06:40AM (#137559)

      BASIC (the original, not VB) was my first language and I think it was great, very good training especially for thinking in terms of loops. And it gave me confidence that I could master any other programming language or system, although obviously the others would take more time.

      I appreciate that kids today wouldn't be satisfied learning a command line language that wasn't Internet aware. Sometimes, a step forward is a step back.

      • (Score: 2) by bzipitidoo on Sunday January 25 2015, @03:37PM

        by bzipitidoo (4388) Subscriber Badge on Sunday January 25 2015, @03:37PM (#137899) Journal

        Thinking in terms of loops? What made Scheme hard was being forced to deal with recursion. Scheme doesn't have explicit loop constructs. You create loops through recursion.

        Recursion scares a lot of people. Some programmers never use it. Recursion is not that hard, but the attitude surrounding it can be off-putting.

  • (Score: 1) by gnuman on Saturday January 24 2015, @05:43PM

    by gnuman (5013) on Saturday January 24 2015, @05:43PM (#137645)

    I actually started with C++

    That's why you start with C. Then you'll be able to grok the extras of C++ using concepts from C.

    Starting with C++ is inadvisable. Even the hello world program,

          std::cout << Hello world" << std::endl;

    is difficult to explain to newcomers. The above involved classes, operator overloading, multiple function calls, inheritance and return references. Really, stick with C for beginners,

          printf("Hello World\n");

    • (Score: 2) by maxwell demon on Sunday January 25 2015, @11:44AM

      by maxwell demon (1608) Subscriber Badge on Sunday January 25 2015, @11:44AM (#137841) Journal

      You don't explain every detail on the first encounter. Indeed, the worst courses are those who try to explain everything the first time you encounter it. No matter what language, it almost certainly means that you get swamped with details which you don't need to care about yet.

      When taught correctly, the cout interface is the simpler one. You just have to explain that cout means "output", things you want to output are added with << foo, and endl means "end of line, show now".

      Just as at this point you'll not teach that standard output is just a special case of a file, with certain restrictions like that you cannot seek, you'll also not teach at this point that cout is a class, that << is an overloaded operator, or that endl is actually a function. All the details you'll explain when you get there (for example, wne it comes to output your own types), not earlier.

      --
      The Tao of math: The numbers you can count are not the real numbers.