Slashdot Mirror


Tips and Tricks When Learning Multiple Languages?

BoneFlower asks: "Due to early registrations scooping up most of the good electives at my school, I'm stuck with learning COBOL(required CS class at my school) and Visual Basic.NET (only useful CS elective left) at the same time. The only tips I've gotten from IRC are 'drop one' and 'Focus on COBOL only enough to pass, and put most of your effort on Visual Basic'. I'd prefer to learn both well, do any of you have any suggestions on how to do this? What aspects of each could I use to enhance the other, and what apparent similarities should I keep in mind as dangerous traps? I also have some C++ knowledge, up to basic classes and memory management, so any of that that I could use in the current classes would be useful as well."

1 of 76 comments (clear)

  1. How I learned multiple languages by trajano · · Score: 5, Insightful

    Most languages tend to have 3 basic building blocks:

    1) Assignment (a = 1)
    2) Conditional (if ... then)
    3) Loops (do while ...)

    Everything else around it is syntactic sugar and what really defines the language.

    The syntactic sugar basically manages the complexity of the program (it does not make things less complex).

    What I normally do is learn how to do those three things first and get a simple program that does something like

    a = 10
    while (a > 0) {
    if (a > 5) {
    print "greater than 5"
    }
    else {
    print "less than 5"
    }
    a = a - 1
    }

    Then I learn how to do procedures if it is a procedural language or how to do objects if it is OO. I tend to go to procedural first if it is supported since it is easier to learn and deal with.

    Next thing I learn to do (if needed) is the memory and pointer stuff. Nowadays I do not deal with it since most modern languages already handle it for you.

    By this point, I now have the basic framework of the language itself. However, it does not stop there.

    For any task that is given to you, you should always think that it should've been done before. So its quite helpful to get a searchable reference handy. This is basically the key thing.

    For example, I won't implement sort myself, I would use qsort() in C or the std::sort() in C++. Nor would I implement a stack or other simple data structures, I usually expect them to be there now, of course I still adjust to the language and I still remember how to do it anyway, it will just take some elbow grease.

    To paraphrase the Perl reference, there are 3 virtues each programmer should have... laziness (don't implement what you think should be standard), impatience (keep the reference guide with you when you are coding, its the fastest way to get at the information), hubris (well that just builds up as you get better and start getting A+'s)

    Good luck!

    --
    Archie - CIO-for-hire :-)