This forum is in permanent archive mode. Our new active community can be found here.

Programing Languages

edited April 2006 in Technology
There are many programing laguages out there rigth now. I think the most common ones are Java, Java Script, Visual Basic, and C++. My question is which one is the over all best and which ones has which strengths. (Feel free to metntion other common ones I forgot)
«1

Comments

  • It's time for Scott's oft-repeated programming language rant.

    In short, every programming language is different. Few are absolutely better or worse than others. Every language has an appropriate time and place to be used. As a programmer, languages are my tools. When I have to hit a nail I use my hammer language. When I have to cut wood I use my saw language. Some languages are chainsaws, and some are swiss army knives. The tool analogy for programming languages can be taken pretty far without it breaking down.

    If you want to list languages, we'll be here for days. There are probably as many programming langauges as there are spoken ones. You see, there are different categories of languages: procedural, object oriented, machine, etc. Once you learn the basic concepts of one category of languages you can easily learn all the languages in that category. Once you know the concept behind a language, all that's left is to memorize syntax. Due to this fact I have been able to learn a great many languages. With the help of an O'Reilly book I can put a new tool on my utility belt in a week's time. That of course assumes I need, or want, to learn the language in the first place.

    Having said all that, I can't really answer your question. What you are asking is much too general for me to feel comfortable responding. Ask me some more specific questions, then I can give a really good answer. Good questions would be "What are the pros and cons of using language X to make an application like Y?" or "I want to make a program like X, what language would be best?"

    I reccomend you start by learning the difference between object-oriented and procedural languages. Then read the individual wikipedia pages for the languages you listed in your post. That should get you thinking in the right direction. Also be sure to listen to all of our "how computers work" episodes. You'll be sure to learn a great deal about languages there.
  • edited April 2006
    10 PRINT "poop"
    20 GOTO 10

    BASIC is the only programming language you'll ever need.
    Post edited by thaneofcawdor on
  • "10 PRINT "poop"
    20 GOTO 10"
    Output:
    poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop
  • for(int i=0; i>=0; i++)
    System.out.print("poop");
  • ,>,>++++++++[<------<------>>-]
    <<[>[>+>+<<-]>>[<<+>>-]<<<-]
    >>>++++++[<++++++++>-],<.>.
  • edited April 2006
    wtf
    precisely!
    Post edited by Apreche on
  • All right. It worked ;^)

    What Scott posted is indeed valid code in a language that makes me want to cry. The language is real. It is called BrainFuck.
  • Output:
    poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop poop
    That's not nearly enough poop.
  • Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
    Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
    Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
    Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
    Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
    Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.


    I don't think I have any desire to learn Ook!. BF would be bad enough. And so would COW, but Ook! would be the worst of the lot.
  • edited April 2006
    ******* +
    +
    * ******+
    +
    + *
    + *
    + +
    v
    Post edited by Andrew on
  • I haven't seen basic syntax in a long time. I don't miss those days.
  • edited April 2006
    Well, since you never got an answer (though it was nice to see brainfuck again), I'll be a bit more pretentious than Scott, and give you two general recomendations.

    As Scott mentioned, thar be procedural, and thar be object-oriented. It is very true that learning one procedural language helps you learn them all, and the same is true of OO languages. You should, in my opinion, learn both, and you should learn procedural first. You should also shoot for a language that doesn't dumb down data types, and leaves the conversions to you. (There are lots of discussions about why this is a good/bad thing, but the jist of the argument for it is that it teaches you to think like the computer does, and thus makes you a better, more agile programmer)

    Bearing that in mind, I don't think anyone will be surprised by my recomendations:
    Learn C, then learn C++.

    C and C++ are fairly similar. You can, in fact, write valid C code that will compile with a C++ compiler (don't, though...it's just silly). Why these? I'm glad you asked.

    Both of these languages allow you to learn the basics pretty quickly, if you are willing to read a book and do some mental work. Many people find C too difficult to be an "introductory" language, so they push for kiddie languages like BASIC. BASIC will destroy your mind. I spent much of my late teens undoing the brain damage that language caused me. C can be used at a fairly high level, but when you learn enough, you can write damn-near anything with it. And while the structure of other procedural languages may be very different, the underlying concepts are all fully represented by C, so you'll be able to start learning other languages with most of the conceptual tools you'll need.

    I recommend C++ because 1) Its syntax and structure are quite similar to C and 2) It is extremely similar to most other OO languages.

    As for references, I learned with the Deitel & Deitel series, C how to Program and C++ how to Program (clever guys, those Deitels). They may not be widely regarded as the best books, but they got me through.

    Wow, I didn't mean to get this wordy. Short answer: Use C and C++, because I want more C/C++ zealots in the world :-p

    Two things I forgot about: 1) C and C++ are very cross-platform compatible, in their basic forms. 2) If you use linux (you do, RIGHT!?!?), you probably already have the GNU cross compiler (GCC) on your system. This handles C and C++ very nicely, and there are several options for using the compiler in windows, my favorite being cygwin
    Post edited by belarm on
  • I like c++

    Well what do you know I got a rare event! im sleepy for once! so bye people.
  • edited June 2007
    HAI
    CAN HAS STDIO?
    VISIBLE "IT IS CAN BE NECRO TIME PWEASE?"
    KTHXBYE
    Post edited by Andrew on
  • edited June 2007
    I love LOLCODE =)

    Another sample:
    HAI
    CAN HAS STDIO?
    I HAS A VAR
    IM IN YR LOOP
    UP VAR!!1
    VISIBLE VAR
    IZ VAR BIGGER THAN 10? KTHXBYE
    IM OUTTA YR LOOP
    KTHXBYE
    Post edited by Sail on
  • I'll stick with COBOL and Fortran, thank you very much.
  • I'll stick with COBOL and Fortran, thank you very much.
    I would have thought you would still be using punch cards. Glad to see you joined the modern world. By the way, how was that stint you had as a telegraph operator?
  • edited June 2007
    When the zombies come, you'll wish you knew Morse Code and how to do things like build a crystal radio, but you'll just have your high-falutin' but useless HTML and I'll be laughin' . . .
    Post edited by HungryJoe on
  • edited June 2007
    image

    This has me jumping in the air and high-fiving everyone I meet.

    U can has it in Python:

    # sys is used for COMPLAIN and ARGZ
    import sys as _lol_sys

    from datetime import date as DATE

    def FIBBING ( N ) :
    'ITERATE FIBONACCI TERMS LESS THAN N'
    assert N >= 0
    # BTW, FIBONACCI LIKE BUNNIES! LOL
    yield 1
    yield 1
    I = 1
    HE = 1
    while 1:
    I , HE = HE , I + HE
    if HE >= N :
    break
    yield HE

    if __name__ == '__main__' :
    print >>_lol_sys.stderr, 'NOW IZ' , DATE . today ()
    if len(_lol_sys.argv) == 1 :
    N = 100
    else :
    N = int(_lol_sys.argv[ 1 ])
    for I in FIBBING ( N ) :
    print I

    # The end.
    Post edited by Jason on
  • Jason, Python is dependent on indentation, you better tab up that code if you want it to work( i.e tab everything once in your function, again if it falls under a loop/if statement).
  • edited June 2007
    image
    lolcats, how I love thee.
    Post edited by Corbin on
  • image
    Copyrights be damned.
  • He should have placed the "int count;" inside of the for statement.
  • He should have placed the "int count;" inside of the for statement.
    Depends on the C standard. If you are using K&R; C, then you have to do it the way shown above. Doing something like this for( int count = 0; count < 10; ++count ) { is a relatively new development.
  • Putting it inside of the for statement would have saved him having to write the variable name an extra time.
  • Putting it inside of the for statement would have saved him having to write the variable name an extra time.
    Did you, did you read what I wrote? Putting int inside the for statement was not valid until I think 1999. Even then, many compilers use the old style by default and you have to tell it special things for it to use the new style. Many coders still write in the old style for various reasons, many of which are not bad reasons at all.
  • edited June 2007
    This is Foxtrot! He's on the bleeding edge! Why would he do it the old way?

    I'm not debating the finer points of coding in this case, I'm debating that the character in the strip would have done it the new way because of who he is.

    Which brings me to the next question, which version of Linux would he run if he did not have a Mac?
    Post edited by HMTKSteve on
  • This is Foxtrot! He's on the bleeding edge! Why would he do it the old way?

    I'm not debating the finer points of coding in this case, I'm debating that the character in the strip would have done it the new way because of who he is.

    Which brings me to the next question, which version of Linux would he run if he did not have a Mac?
    I don't think you are quite understanding. It's not just the new way, it's the non-default way. For example, let's say you have a program in file test.c that contains code for( int count.... If you were to compile it using the default gcc parameters with the newest gcc, like so gcc test.c you would get an error message! You have to do something special gcc -std=c99 test.c to make it work your way. You know what? Most people do it the old way. You know that whole gigantic open source C program, that um, Linux kernel thing. Yeah, it's written the default way. That's the way the vast majority of C code is written. I don't want to explain the finer points of C coding standards, and why they are the way they are. Just accept the following statement as fact. The code in the Foxtrot comic is correct, and you are wrong.
  • edited June 2007
    Nerd fight! Solve for X!

    Come on guys, aren't we just a little above arguing over syntax?
    Post edited by Corbin on
Sign In or Register to comment.