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."

24 of 76 comments (clear)

  1. Try implementing the same programs in each by elliotj · · Score: 4, Informative

    This is just an idea, I've never tried it: how about taking simple programs and trying to implement the exact same program in each langauge. Oh sure, VB and COBOL are very different and the interfaces will no doubt be different, but looking beyond that, trying out the same exercise in each language could teach you a lot about them both as you see how they are similar and different. Using a common problem domain will allow you to focus on the differences in structure and syntax. I'm not suggesting trying tough projects here, just simple exercises: memory management, arrays, search trees etc.

  2. huh? by kevin+lyda · · Score: 3, Insightful

    i took three programming courses one semester and learned fp, ml, prolog, lisp, clos, vax assembler and ada. in addition i had some projects in modula-2 and c. and you're worried about cobol and visual basic? come on, yer just messing.

    study, play with the langs and generally learn.

    --
    US Citizen living abroad? Register to vote!
    1. Re:huh? by kevin+lyda · · Score: 4, Insightful

      did i learn all the ins and outs? no. but i learned enough to do my projects. and i learned some other things along the way - how to learn languages, how to work with a language, how to get information on a variety of tools and how different languages have cultures around them.

      that last part is hard to explain, but a good example might be perl - cpan, perlmonks, perl mongers and naming conventions. back then it was just newsgroups, but even those had their own conventions.

      you'll learn the depths of languages later on - primarily when you get a job programming. first learn what exists - though cobol and visual basic would admittedly be rather vile choices. kinda fun learning fp and vax assembly at the same time. fp had not variables or control structures; vax assembly was practically c! :)

      --
      US Citizen living abroad? Register to vote!
  3. Quick, transfer to another school!!! by Ashurbanipal · · Score: 3, Insightful

    Any place that considers COBOL a requirement, and Visual Basic worth spending course time on, is seriously out of touch with both the academic and business worlds.

    Most of the giant COBOL shops killed off their COBOL dependency during the Y2K fixup. COBOL programmers with 20 years of experience are a dime a dozen now. Most people I know with COBOL experience don't even bother putting it on their resume.

    Visual Basic is so trivially easy to master that it hardly requires a college course - a good manual and an on-line or CD tutorial should have you up to speed in two weeks or less.

    A school with a good program would be requiring C, and offering perl, C++, Java, python, and some more esoteric languages like Eiffel, Lisp, Icon, or such.

    Given no other choice, I'd skimp on the COBOL and practice the VB; you can use VB at home when you get a job as a Salesdroid, or use it with MSWindows in a mid-level management position.

    1. Re:Quick, transfer to another school!!! by klui · · Score: 2, Informative

      You have any facts to back up your claim? COBOL is probably not needed in Fantasyland, but I can assure you COBOL is being used by many companies today. When I was coding COBOL over 10 years ago, we had used 4 digits for the year thus our suite of general ledger programs did not require any fixup during Y2K. Programs are still running in production.

      A good program is spending time on developing a firm foundation for software engineering, regardless of what language is used. You know, modularity, code reusability, supportability--stuff that's taught in Computer Programming 101/102. With a firm foundation, a student can pick up a new language with relative ease. Without a firm foundation, all is lost.

    2. Re:Quick, transfer to another school!!! by SoCalChris · · Score: 2, Informative

      I'm going to have to disagree with you on your comments about VB.net.

      Since the .Net framework was released, VB is now every bit as powerful as the "real" languages. It supports threading, inheritance and is fully object oriented.

      Yes, it is simple to whip up a poorly written program using VB.net, but if given to someone who knows what they are doing, it is an extremely powerful & flexable language.

      Also, like it or not, there are quite a few jobs with .Net now. I would imagine there are a lot more jobs for VB than there are for the languages you listed as should be required (Eiffel, Lisp, Icon).

    3. Re:Quick, transfer to another school!!! by Sloppy · · Score: 3, Interesting
      The Microsoft proprietary language requirement is pretty suspicious for a CS cirriculum, but there may be a valid reason for the COBOL requirement.

      I remember way-back-when, I had to use FORTRAN in a data structures class, precisely because it was so poorly suited. I suspect a lot of programmers are used to languages/libraries that automagically manage memory and garbage-collect, or else languages where the details of the heap and stack are managed for you, even if you have to keep track or your malloc()s and free()s. But if you use a language that doesn't have dynamic memory management and can't do recursion, then the programmer has to learn how to deal with all that under-the-hood stuff, using arrays or something. It's probably good for CS guys, at some point, to be exposed to the cost of all the things that modern tools do for them. Would you trust a CS grad who doesn't know how malloc/free work?

      So maybe that's what the COBOL requirement is for? Or maybe not. ;-)

      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  4. If these are intro classes by GigsVT · · Score: 2, Interesting

    And I assume they are, then don't sweat it man, both of those languages are usually taught in an extremely simple way in intro classes. Especially VB. I wound up having to take two semesters of VB (even after already taking advanced data structures in C++), and I lost points for not changing the background of my windows from grey to something like pink or orange. In the second semester class. I'm not kidding. And people wonder why I dropped out.

    The only way you will learn anything remotely useful is to work with the language you want to learn extensively on your own. You actually still think you go to college to learn things??

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
  5. Easy to learn both well. by karnat10 · · Score: 3, Insightful

    Programming is something you know or you don't. Sure your skills improve over time, but there are some basics to that activity that won't change with different languages.

    During a programmer's lifetime, you will have to learn a lot of languages, and frankly, if you know how to program, you can learn a new language in an afternoon, and get to be an expert after a month or so working with it.

    So this is my advice: Choose a project for each of the languages, realize it, and you will know both of them well.

    (I have to admit I never learnt COBOL so in a way I don't know what I'm speaking of. In another way, in my life I have learnt Basic, Pascal, C, C++, Java, Visual Basic, JavaScript and all that stuff, and I got easier every time.)

  6. You're in luck. by Jack+Tanner · · Score: 3, Interesting
    COBOL and VB, arguably, come from similar philosophies -- they're both very verbose.

    COBOL is not tough. It's a relatively ancient, simple programming paradigm. Without various proprietory add-ons, it doesn't get into any of the web integration technologies or anything of the sort. You might actually pick up some useful insights into mainframes and the 'suit' mindset. Despite the FUD about COBOL, it's still going and growing VERY strong. COBOL-2002 is a new standard of the language, and code is still being written in it for many, many legacy applications. For example, here's a recent press release from a COBOL compiler manufacturer.
    Analyst firm Gartner estimates that applications managing about 85 percent of the world's business data are written in COBOL. Gartner further estimates that there are approximately 90,000 COBOL programmers in the U.S. and the annual growth of COBOL code over the next four years is 5 billion lines.

    VB, on the other hand, is completely proprietary, very up to date, but not nearly as useful server-side, and will have you hunting down advisories on MSDN.

    Summary: Focus on both. Neither is really hard. COBOL is easier. And if you really want to learn both, integrate a VB front-end with a COBOL legacy application.
  7. 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 :-)
    1. Re:How I learned multiple languages by Piquan · · Score: 3, Insightful

      I disagree. The most popular languages today all more or less follow this (mostly because they're all Algol descendants), but not all languages do.

      Alan J. Perlis said, "A language that doesn't affect the way you think about programming is not worth knowing." I agree. Once you've learned C, then learning Pascal or Perl is nothing. But I've seen a lot of people who are sharp-on in Perl that couldn't wrap their heads around functional languages. Ditto for teaching people OO for the first time.

      If you're just learning languages by thinking they're all the same, then you're not learning languages. Don't write Perl code in Lisp; learn Lisp.

  8. Concepts by Apreche · · Score: 4, Insightful

    I'm a CS major as well, and I know what it's like to learn many languages. I took a class called Programming Language Concepts (PLC). We learned LISP, PROLOG and Simulink(not really a language) in 10 weeks. The way I learned them so fast was to focus on the concept, not on the language itself. This has proved useful especially in the object oriented languages.

    Once you know the concepts behind a certain type of language. Say object oriented languages. You know things that are true about every object oriented language. There are classes, methods, public, private, exceptions, threads, locks, static stuff, polymorphism, inheritance, etc. Once you understand all of these things, every object oriented language should come easily to you. It took me awhile to learn C++, and a little less time to learn vb, then java. I learned C# in a matter of days, and I learned all of the basics of python in a few minutes this morning (no joke). Perl is next on my list.

    Get a book on object oriented/event driven programming. And get another book on procedural programming. Learn the concepts behind the languages, and not the languages themselves. The syntax and the API will be most of what you have to learn when picking up a new language. And those are things you can just reference repeatedly until you memorize them.

    --
    The GeekNights podcast is going strong. Listen!
  9. Here's some facts for you, Mr. Dinosaur! by Ashurbanipal · · Score: 2, Informative

    I went to www.jobsearch.com (which is a website I have NEVER visited before, AFAIK, I just figured the name would work and it did) and did some simple searches in their "help wanted" database.

    COBOL -- 242 hits
    JAVA -- 1183 hits
    " c program" -- 1740 hits

    So, COBOL's obviously the language to choose for a healthy career, right? It's DEAD, Jim. The only companies that use it will make you sit in a room with no windows and wear a tie. C'mon, you know it's true.

    Incidentally, I agree with almost everything else you said. But don't take it personally.

    1. Re:Here's some facts for you, Mr. Dinosaur! by sql*kitten · · Score: 2, Informative

      So, COBOL's obviously the language to choose for a healthy career, right? It's DEAD, Jim. The only companies that use it will make you sit in a room with no windows and wear a tie. C'mon, you know it's true.

      The COBOL job market is quite different from the Java job market. Mostly it's people who've been in the industry a long time and communicate through word-of-mouth, the trade press, and a network of recruiters.

  10. Hmmmm by Anonymous Coward · · Score: 2, Insightful

    "Due to early registrations scooping up most of the good electives at my school..."

    Maybe instead of worrying about programming languages, you should use an elective to learn about effective time management. Knowledge of all the programming languages in the world will not keep you in a job if you can't get to work on time and think ahead about projects.

  11. COBOL.NET by Atomizer · · Score: 4, Funny

    With .NET it doesn't matter what language you use, so in this case the obvious thing to do is to learn COBOL.NET.

    I saw some scary examples of it in the .NET seminars.

  12. Make a Comparison Table by Phouk · · Score: 2, Insightful

    Make a comparison table between both languages, listing similarities and differences, and features which exist only in one or the other language. This way, when you think about both languages in terms of differences, you are less likely to mix them up, but at the same time, best leverage similarities in your learning.

    Trying to create a good structure for that table is probable alone going to give you some insights into the structure of programming languages!

    When you're done, be nice and put your table up somewhere on the web, might be helpful for anyone coming from COBOL wanting to learn VB or the other way round. One never knows.

    --
    Stupidity is mis-underestimated.
  13. The "Real World" way to do it... by Bald+Wookie · · Score: 4, Funny

    Write all of your assignments in COBOL. Even the ones for your VB class. No matter what it is, implement it in COBOL first.

    Go party. Hard. Fear and Loathing in Las Vegas hard. Once your dorm room is full of bats start renaming variables and stripping out comments. If you can still remember what you wrote and why, you didn't party hard enough. Don't keep a backup copy of the original COBOL. That's cheating.

    The night before a VB project is due, dust off the corresponding COBOL. Now all you have to do is port the heavily obfuscated and undocumented COBOL to VB. You can even get extra points for realism by getting the prof to change the project spec sometime midstream.

    Once you've turned in your VB project, look back at the COBOL source. By now it should look like a bizzare cross between the tax code and naughty refrigerator poetry. The night before your COBOL project is due, start backporting it from the VB. Bonus points are awarded for targeting an ancient punchcard based architecture and then updating it to meet the project requirements.

  14. Wrong approach by cheezedawg · · Score: 3, Insightful

    Good CS school programs have almost nothing to do with specific languages. You need to spend some time learning the discrete mathematics and the fundamentals of languages. When you learn that well, picking up the little quirks of a new language is easy, and you are a more versatile programmer.

    I would recommend some courses in compiler design. That will give you a good understanding of grammars, languages, and programming constructs.

    --
    "The defense of freedom requires the advance of freedom" - George W Bush
  15. It is trivial or you should drop out by bluGill · · Score: 2, Insightful

    Learning programing languages is trivial to a programer. Learning how to use any on to the best advantage can take years, but all you do in those years is memorise more and more library/template procedures and the gotchas of useing them. If you cannot learn both well enough to fool the teacher, then you should not be in CS.

    When I took CS the only language course that was required tought 12 langugaes in 10 weeks. It wasn't a big deal, we learned the syntax, and how to do some simple things (a binary tree or simlear) and moved on. Of course we were just told what the "standard library" was called, and told if we really used the language to look it up, because it will save a lot of time.

    Come to think of it, other than the one class that covered 12 languages, we wre simply told in class to submit assignments in such and such a language, and if we didn't know it (and the introduction class was tought in Scheme in large part because it was likely we didn't know it!) we were expected to pick it up on our own. In this was I knew 3 of the 12 languages tought in the languages class when I could finially get into it.

    In the course description of Cobol there was a warning "CS student may not take Cobol for credit". The same line was in the description of Fortran and C. A CS student should pick up anything that a class on a language can teach on their own. A CS student is expect to spend their time learning data structers, algorithms, and other things that make the different between someone who can bang out a little ugly code when needed, and someone who can take requirement and turn out a maintanable program in as few line as possible.

  16. An important similarity by jbolden · · Score: 2, Informative

    Both Cobol and VB are a response to a business advanced by the major programming language firm of the time.

    In the early 1950s IBM pushed Fortran as a replacement for assembly arguing (succesfully) that it allowed for a large increase in programmer productivity without much loss of system performance. Fortran however was too "computer oriented" and many programmers with a strong business background found it difficult to express business ideas in terms of fortran succesfully. So an alternate language called COBOL was created which allowed for a better expression of business concpts at the cost of both performance and abstracting the details of how the machine was opperating.

    In the early 1990s Microsoft pushed visual development in C++ (visual C++) as a replacement for standard C arguing (succesfully) that it allowed for a large increase in programmer productivity without much loss of system performance. VisC++ however was too "computer oriented" and many programmers with a strong business background found it difficult to express business ideas in terms of fortran succesfully. So an alternate language called Visual Basic was created which allowed for a better expression of business concpts at the cost of both performance and abstracting the details of how the machine was opperating.

    So obviously the important thing to do since you understand C++ (and Fortran takes a day to learn) is to look at these languages as a reaction to the dominant languages of their day. Understanding what they were reacting too.

  17. Find another major. by rjh · · Score: 2, Insightful

    Judging from your comment about how Visual Basic is the only useful elective left, that leads me to think this is your senior year. If you're an upperclassman and you're having trouble with COBOL and Visual Basic, find another major.

    COBOL and Visual Basic are both pretty simple imperative languages--the simplest form of language to understand. (Yes, VB has objects nowadays, but it's usually used in a mostly-imperative fashion.) Not only that, but you already know C++, which supports both imperative and object-oriented programming.

    It's not like you're suddenly dropped into an AI course and you have to learn LISP and PROLOG both; it's not like you've been thrown a copy of Ullman's Elements of ML Programming and told you have a test on OCaml in a week. These languages all make you think about problems in a totally new way, and that can take a significant investment of time. But learning imperative languages when you already understand imperative programming should not be difficult. You're not learning anything new; you're just learning a new vocabulary and grammar to express things you already know.

    If it'll give you any problems, you should give very serious thought to whether or not you want to make computer science your career. It sounds as if you possess neither inclination nor motivation, and you will probably be a much happier person if you can find a field for which you possess both inclination and motivation.

  18. thinking back to the /day/ I learned COBOL... by Starman9x · · Score: 2, Insightful
    and realizing it was all of 1/2 hour, at lunch, [at a burger king in fact -- right off of the community college campus.]

    Generally I don't go for the "one upmanship" stuff of how fast I learned this or that, but in this case I make an exception because when I finished lunch I specifically remember thinking to myself, "OK, I've just skimmed through the book and I'm fairly certain I already know the concepts that will be presented during this semester." This was in the early 80's, I think my second semester in "college", and I had a pretty solid understanding of BASIC, a non-trivial amount of (z80) assembler, and a dabbling of "other languages" [APL, fortran, etc.]

    I had picked up the required book from the school's bookstore, went to lunch at the aforementioned BK, and started looking through the chapters. It didn't take long to realize that some things were simply renamed terms (table == array) and other things were "syntactic sugar" ("accept" vs. "input") At first, the amount of "preamble" seemed a bit daunting, but in practice that's when I found out how to effectively use a "mainframe" style line editor... :)

    One of the BEST things I think I've learned from COBOL is the underlying format of data in a "structure" -- don't underestimate the power of "redefines" or a level 88 variable! Investigate these to learn their "counterparts" in other languages...