Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Which Computer Language to Learn

  1. Jun 13, 2004 #1
    I was wondering if someone could compile a list of the newest and best computer languages to learn and what they would be for. I was considering learning something this summer after studying physics for awhile but I don't know where to start. I already know some languages Ti 83 basic and some c++/java where should i go from here.
  2. jcsd
  3. Jun 13, 2004 #2


    User Avatar
    Staff Emeritus

    You should learn a scripting langauge like ruby, perl, python, php, etc. These languages can be used to do things like prototype your programs so later you can convert them to c++/java. You can also use them to write server-side programs for the web. Finally, if your dealing with lots of files, these languages make it easy to code quick programs to extract and minipulate data.
  4. Jun 13, 2004 #3
    I would definitely second that. Scripting languages are great for prototyping and writing small programs, and often even writing large programs (sometimes you prototype a large system and then discover that it's easier just to finish the prototype than to rewrite it in a more "traditional" language).

    Personally I would recommend Perl or Python, although if poor Windows support isn't a problem then Ruby is great too. PHP is a good language too, although it's really geared more towards web development (it can be used to do general-purpose scripting, but it was originally designed for web development and its design still reflects that).
  5. Jun 13, 2004 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I'd recommend either Python or Java.

    - Warren
  6. Aug 18, 2004 #5
    ty for ur suggestions
  7. Aug 19, 2004 #6
    Instead of learning a plethora of languages, consider using C++ and learn about things you can do with C++. There are lots of interesting technologies e.g. sockets, GUI toolkits, or OpenGL that you could learn. You could also use C++ to practice techniques like "design patterns" that would immensely improve your object oriented programming skill in general.
  8. Aug 19, 2004 #7
    I too would like to learn a scripting language and have some experience with c++. So to further probe suggestions from you guys, what are some of the advantages/disadvantages between Perl, Python, Ruby and Java beside the aforementioned fact that Ruby has bad Windows support (i.e. learning difficulty, likeness to c++, platform compatability, predominant usage by programmers)? And is Java a scripting language or a "traditional" one?
  9. Aug 19, 2004 #8
    Whatever language you want to learn. Stick with it. Don't be one of those people who constantly jump from language to language without truly knowing anything. Read the text, Practice the exercises, then practice and practice it some more.
  10. Aug 20, 2004 #9
    Perl uses obscure language conventions but is exceedingly useful as the predominate scripting language in *nix environments. Python can utilize OOP techniques and is also important to *nix (not so much as Perl but it's getting there). Ruby was developed as an OOP scripting language but has limited real world applications as of yet (more people are picking it up though and languages take a few years to be adopted). Java is not a scripting language. Java is a compiled language similar to C/C++ except Java needs to be compiled on the developers machine and then again on the target machine.

    My advice, learn PHP. It's a great language. It's heavily use on the net. It's exceedingly easy to learn the basics. It comes packed with many useful functions. Like others have said though, pick a language and learn it. Once you do that it doesn't matter how screwy the language is.

    If your on a windows machine, I believe the windows scripting host(WSH) can use VB (another scripting language) or JavaScript(JS). WSH is usually disabled by default, but if you do enable it (big security risk) you can learn either of these scripting languages. VB is dwindling in popularity but still has a home in rapid development areas. JS is very useful as a net scripting tool.

    ASIDE: I'm a Mac/Linux user and haven't touched Win in a couple of years, so the last paragraph may not be entirely true for WinXP though I believe it is.

    Good Luck. Enjoy.
  11. Aug 20, 2004 #10


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

  12. Aug 20, 2004 #11
    Depends on what you have in mind for the future?
    I personally dislike C++ because it is not as OOP as many other languages. I would suggest Java instead or C#, depending on how you envision yourself using your knowledge.
  13. Aug 20, 2004 #12
    I'm thinking Perl or Python...I just need to do a little more research on my own. Thanks for all the advice.
  14. Aug 23, 2004 #13


    User Avatar
    Gold Member

    I'll take a totally different approach from most people.

    I would consider Perl a first programming language. It's rather nice and contains the same functionality as C and C++. It's a decent starting language and will introduce you to loops, functions (subroutines), and C-like syntax in general. Perl, however, in the hands of a seasoned programmer, can be a very powerful programming language. Perl scripts can also be compiled into executable binaries. You can really use Perl to almost write anything, and it's completely portable to other operating systems. If you want complex-number support, simply load Math::Complex. If you'd like to do some web programming or database development, plenty of modules exist. In fact Perl, contains a DBI interface unheard of in PHP.

    Depending on whether you're going into computer science, I'd recommend learning C (not C++). C is a very powerful programming language, like Perl. If you're going into a scientific field other than computer science or you are wanting to use an all-around decent programming language use C++.

    I'd stay away from the Windows-based programming languages like C## and Java. These are propiertary programming languages that offer no advantages over seasoned programming languages such as Perl, C, and C++.
  15. Aug 23, 2004 #14


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member


    On the other hand, Perl is oriented rather strongly to particular applications -- text processing. It's object orientation is wholly disgusting, and it's quite difficult to write full featured GUIs in it.

    I'd also like to point out that Java is by no means a Windows-based language! Sun Microsystems developed it, and at its very core it is cross-platform. :rofl:

    - Warren
  16. Aug 23, 2004 #15
    Here, here. Perl is drifting from favor as a server side scripting language. PHP and JS are moving in to fill the spots once filled by perl (I know JS is client side; however, moving some tasks client-side reduces the need for perl). Perl's main use IMO is as a *nix scripting language. Even here, python, and Ruby (there's a ruby linux distro even) are replacing Perl because of perl's obscure language usage. IMO writing anything in perl is more difficult than say python--even when one is proficient with both. Python also has the added benefit of integrated Tk thus making it good for Linux GUI RAD.

    If you must choose between Perl and Python go with the snake.

    My 2 cents. Enjoy.
    Last edited: Aug 23, 2004
  17. Aug 25, 2004 #16


    User Avatar
    Gold Member

    Perl offers the same Tk inferface as Python. You can download the Tk modules and the Tk Win32 runtime libraries, and create graphical interfaces in Windows just as you would with VC++ or Java.

    My problems with Java are optimization, applicability, and portability. Compared to C++ and especially C, Java just doesn't hold out when it comes to speed. Another problem with Java is it's only good for graphical applications. I can write a C++ or C program that uses X11 or Win32 API's, however, I can also write a C++ or C application that runs on a Unix TTY or DOS console.

    Faust, I fail to see how you can call Perl's syntax obscure. It's a mixture of C and C++. The objects and hashes resemble C++ objects and structures. If you're used to C syntax it's very easy to learn Perl. You just have to become acquainted with the idea of Perl modules, which are basically C include files or libraries.

    If you're going to learn a language, at least learn a language that can be used in numerous situations.

    Edit: Has Sun even open-sourced Java, yet? The last I heard, they haven't. If you would like to use Java, IBM has a compiler called Jikes, which I believe is open-sourced. GNU also has a compiler (I've never used it) called "gcj." What little Java programming I've done, I prefer Jikes over Sun's and GCJ (GNU is garbage, anyways). Jikes compiles *very* fast compared to that of Sun.

    Another advantage I've seen with Perl is you don't have to play with data types. If you're not a computer science student, you don't care a flip about types. Perl lets you just use any data type you like when you declare a variable, array, or hash, with no hassle. Perl also has some very impressive math support. Just load the complex number module, and you have full complex number support. Attempt to do complex numbers in C or C++ (include an include file, declare a complex type, etc.), and you see that it's rather a bit of a hassle.

    Perl also has CPAN, a collection of *every* module one could possibly need for development. Browse through the CPAN (http://www.cpan.org) archives and tell me Perl can't do something.
    Last edited: Aug 25, 2004
  18. Aug 25, 2004 #17


    User Avatar
    Gold Member

    Wasn't the whole point of Java to be portable? Of course, that was C and C++'s goals also, but with Perl it's more of a realization. Unless you have something uncalled for such as X86 assembley, all you have to worry about is if the system you wish to port to has the correct Perl modules and libraries installed (or unless your application is doing something that is specifically Unix or Windows dependent). In order to "witness" Java's portability features you have to install the Java base system which is a *lot* larger than Perl's base. Then, you must suffer through that Java code being uncompiled which I can't imagine what that must be like for a person. :)
    Last edited: Aug 25, 2004
  19. Aug 25, 2004 #18
    Java uses a virtual environment, meaning that it is impossible to build viruses to affect your computer since it does not run on your computer. ActiveX on the other hand uses the full windows environment, meaning that viruses can be built, but also meaning larger applications; It is downloaded to your computer.

    I say Java.
  20. Aug 25, 2004 #19


    User Avatar
    Gold Member

    I fail to see how deciding on a language refers to the subject of being able to create a virus with it. I also fail to see how the Java VM can prevent someone from executing malicious code. As far as I recall, the VM executes neutral bytecode, nowhere have I read or seen the VM doing some sort of "virus scanning." Any "decent" language can create what you may call, "malicious code." If Java has the capability to modify files and execute other programs (I hope it would, otherwise my opinion of Java would be even lower from already what it is now), it then has the capability to create malicious applications.

    Edit: Looking over Sun's Java 2 SDK download site I noticed something ironic. Java's primary goal is portability. As far as I see, Sun only acknowledges SPARC Solaris, X86 Linux/Windows, IA64 Linux/Windows. Believe it or not, that's a fraction of the platforms that exist in the world today. Why if someone has a VMS, Irix, or some other OS? They won't be able to run your impressive Java program on their operating system. It's just sort of ironic how Sun, the creators of Java, don't acknowledge other platforms, yet their goal is complete portability.
    Last edited: Aug 25, 2004
  21. Aug 25, 2004 #20
    graphic7: Perl's language is a little obscure because of its similarity to C/C++. The purpose of most scripting languages is to be able to write quick, easy code in order to perform simple tasks. Perl is built on (or from) existing languages and tools but learning all of these tools from scratch is difficult. Sed, Awk, C, Unix Shell, etc are included as tools and language constructs in Perl which for a C programmer are easy enough to pick up. For a non C programmer or someone who has never used regular expressions (Perl's main benefit as a scripting tool) it's tough--no doubt about it. If you are not proficient with Unix programming then Perl has a very steep learning curve. This is a know and much noted fact about this language.

    Other scripting languages like Python and Ruby and JS, and a few other languages are more direct. These languages are easier to pick up. Heck, JS is very easy to learn and useful on M$ platforms if the script host is enabled. Ruby and Python are very easy to learn and are OOP which can be extended to Java and C++ when someone wants to move to a compiled language.

    All in all, Perl has its place but IMO its place is not as a starter language. Trying to learn Perl would be discouraging to any novice to lower intermediate programmer and should be learned later. Learn Perl when you NEED to parse files on a *nix server. Learn Perl when you need to write *nix scripts.

    Finally, Perl's main usage is in *nix environments. Portability becomes a problem on Windows boxes because to use a Perl script you have to first "as you stated" ensure the system has all modules available. Python OTH can be compiled just like Java and packaged with an interpreter. Not a perfect system, but much, much more portable.

    My 2 cents.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook