Which Computer Language to Learn

In summary, if you want to learn a scripting language, I recommend either Python or Perl. Both languages are easy to learn and can be used for a variety of purposes. Java is also a good language to consider, but it is not a scripting language.
  • #1
Tom McCurdy
1,020
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.
 
Computer science news on Phys.org
  • #2
You should learn a scripting language 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.
 
  • #3
dduardo said:
You should learn a scripting language 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.

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).
 
  • #4
I'd recommend either Python or Java.

- Warren
 
  • #5
ty for ur suggestions
 
  • #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.
 
  • #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?
 
  • #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.
 
  • #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
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.
 
  • #12
I'm thinking Perl or Python...I just need to do a little more research on my own. Thanks for all the advice.
 
  • #13
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++.
 
  • #14
graphic7,

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
 
  • #15
Here, here. Perl is drifting from favor as a server side scripting language. PHP and JS are moving into 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:
  • #16
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 let's 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:
  • #17
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:
  • #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.
 
  • #19
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:
  • #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.
 
  • #21
PerlCC is available on Win32. I've compiled a few simple scripts, ported them between Windows systems, works fine. Keep in mind these are actually native-code binaries and don't suffer from the performance problems that Java does. I use a simple script that I wrote to strip out Windows new-lines characters on Unix workstations. The same script also works on Windows to strip out Unix escape sequence anomalies that may be present in text files.

My first programming language was Perl, and you may be correct in the sense that learning Perl is better if you have a Unix background. By that point, I was proficient and Unix and it wasn't too bad. I did find it easier to take up C and C++ after becoming familiar with Perl, though.

I just think the grandest part of Perl is it's ability to write some quick, dirty scripts. I wrote a script last year that found zeroes of the Riemann Zeta Function - roughly 100-150 lines of code. Shortly after doing this, I implemented it in C++, but it took much more time. I had to get used to the C++ way of doing complex numbers, but for the most part C syntax was very familiar to me because I was already familiar with Perl.

I don't have any experience with Python, so that may be why I'm still defending Perl.
 
  • #22
graphic7 said:
Another problem with Java is it's only good for graphical applications.
This is not correct. Where did you get this idea? I use Java for enterprise applications, and it all executes on the server. Graphical applications, although quite possible, are not and have never been the main use for Java.

graphic7 said:
I fail to see how deciding on a language refers to the subject of being able to create a virus with it.
You misunderstood his point.

I also fail to see how the Java VM can prevent someone from executing malicious code.
Again you misunderstand. A Java VM does not prevent someone from executing malicious code. It prevents the VM from preventing malicious code. Your failure to see this should be taken as a lack of understanding on your part, and not a failure of Java.


As far as I recall, the VM executes neutral bytecode, nowhere have I read or seen the VM doing some sort of "virus scanning."
Quite right, but irrelevant. Code that runs in a VM is limited in what it has permission to interact with on the OS.

Any "decent" language can create what you may call, "malicious code."
Correct, but irrelevant. Java runs in a VM, which is able to limit the ability of such code to run.
 
  • #23
"A Java VM does not prevent someone from executing malicious code. It prevents the VM from preventing malicious code."

That's sort of circular; "malicious," depending on what the program does is rather subjective.

I'd think the VM could get in the way of development; possibly raising additional difficulties in the debugging process of an application. If I have an application that modifies various files, will the VM prevent my application from accessing those files (even if its perfect legitimate)?

In order for Java code to run "decently" you have to compile in native bytecode. Which does two things: you lose portability, and you lose the features of the VM (security and such).

The question I'm raising is: Why use Java at all? Portability isn't a feature only possessed by Java anymore. Java sure doesn't have any notable performance qualities. Java can do graphics, so can C and C++.

I've seen quite a few Java applications in my life, all of them do something graphical. I've never seen any practical Java application being able to perform some relatively useful function from a Unix TTY or DOS console.
 
Last edited:
  • #24
this might be of interest

http://www.tiobe.com/tpci.htm

/Rikard
 
  • #25
When did Bash and CSH become languages? :rofl:
 
  • #26
graphic7 said:
That's sort of circular; "malicious," depending on what the program does is rather subjective.
If that were how it works. However, it is not.

I'd think the VM could get in the way of development; possibly raising additional difficulties in the debugging process of an application. If I have an application that modifies various files, will the VM prevent my application from accessing those files (even if its perfect legitimate)?
Not in a development environment. Read up on Security Managers.

In order for Java code to run "decently" you have to compile in native bytecode.
I disagree. Of course, I am not sure of how high your standards are for "decently".

The question I'm raising is: Why use Java at all?
Why not ask Oracle, IBM, Sun, and all of the other companies that promote it?

I've seen quite a few Java applications in my life, all of them do something graphical.
I believe you. However, the main use for Java at Oracle, IBM, and Sun, for example, is server-side middle-tier development, which are not graphical.
 
  • #27
I can see Java being applicable to web-based applications, but we must return to the topic of this thread. A good, first programming language. Frankly, web-based applications are not going to be bread and butter for the first-time programmer.

IBM's support for Java ended with Jikes. As far as I know, jikes hasn't had an update in quite awhile now. Sun has been spiraling downwards ever since they've hinted at removing Sparc line and dropping Solaris support. While I'm attempting not to get into corporate politics, I can say these aren't the best companies to reference to.

It just seems that if I were going to learn a programming language, perhaps my first, I would want it to be very applicable for a number of situations. You've failed to prove to me why someone should learn Java over C, C++ or other seasoned languages.

As for my standards, I consider Java to be below my standards in terms of performance, applicability, and portability.

While Java has been slipping out of the propiertary stage for awhile, it still is very much a propietary language, and not worthy of learning it as a first language.
 
  • #28
graphic7 said:
I'll take a totally different approach from most people.
I agree. Your approach is very different from mine.

graphic7 said:
It just seems that if I were going to learn a programming language, perhaps my first, I would want it to be very applicable for a number of situations. You've failed to prove to me why someone should learn Java over C, C++ or other seasoned languages.
I am not attempting to "prove" anything. Furthermore, I have never suggested in this thread, let alone claimed that I have offered proof, that Java should be learned over the other languages that you mention. Do you think that I ever made such a claim in this thread?

That said, I do consider that Java is a better choice than both C and C++, except for people who specifically anticipate using C or C++. I say this because I consider OO programming the wave of the future and a better paradigm, yet C++ is far more complext than Java and requires a work environment that most newbies will not need or be able to take advantage of.
 
  • #29
Well, if an OO background was truly the aspiration of a programmer, shoot for Smalltalk. By far, Smalltalk has the best OO implementation.
 
  • #30
graphic7 said:
Well, if an OO background was truly the aspiration of a programmer, shoot for Smalltalk. By far, Smalltalk has the best OO implementation.
I don't disagree with this. However, Java has a major advantage over Smalltalk in terms of industry support and job possibilities.
 
  • #31
I agree with you. That's the sad thing about industry. Industry hardly ever adopts the correct platforms and such.
 
  • #32
graphic7 said:
It just seems that if I were going to learn a programming language, perhaps my first, I would want it to be very applicable for a number of situations.
You can do literally anything in Java. Literally. You can write operating systems in it.
You've failed to prove to me why someone should learn Java over C, C++ or other seasoned languages.
Pedagogically, it exposes a new programmer to object orientation, I/O and other concepts with as a little fuss as possible. Java does automatic garbage collection. Java doesn't have pointers, which cause C and C++ users with tremendous pain, but provides the functionality in a much cleaner way. Java provides a standardized and consistent API for thousands of classes which can be used in virtually any way you can imagine. Java runs anywhere. Java doesn't suffer from the annoyances of header files. Simply put, Java provides the cleanest OO with the largest component library of any language on the planet, by a very large margin.
As for my standards, I consider Java to be below my standards in terms of performance, applicability, and portability.
It literally cracks me up when you say that you prefer Perl for its performance, applicability, or portability. :rofl: Everyone else in this thread is disagreeing with you -- why do you think this is so?
My first programming language was Perl, and you may be correct in the sense that learning Perl is better if you have a Unix background. By that point, I was proficient and Unix and it wasn't too bad. I did find it easier to take up C and C++ after becoming familiar with Perl, though...I don't have any experience with Python, so that may be why I'm still defending Perl.
This is, IMO, the heart of the matter here. You're an inexperienced programmer in the sense that you seem to have limited exposure to languages. You don't know Java, and you don't know Python, both of which are very important languages from both pedagogical and industry standpoints. You learned Perl first, which is virtually unheard of, and thus have some kind of emotional attachment to it, despite its, well, ugliness. If you actually gave either a try, I think you'd lose your irrational distaste for them. I strongly suggest that you actually have some competency in languages like Java and Python before telling other people they are, in so many words, unworthy. To tell a student they should avoid a language you don't even know is essentially intellectual dishonesty. Recognize the limits of your own knowledge, and stay within them.

- Warren
 
  • #33
Just as a review:


Perl, Python and Ruby are scripting languages while C, C++ and Java are not.

All of those languages except C and C++ are garbage collected.

Ruby and Python have the cleanest style of Object-Orientation. C is not at all object-oriented. Perl has OO in a very messy way. C++ has a somewhat ugly but reasonable OO system. The OO in Java is basically what you get when you take OO from C++ and clean it up and get rid of some of the nastier (mis?)features.

Perl, Java and C have the largest amount of libraries available. But Python, C++ and Ruby also have lots of libraries.

Comparing the speed of the languages is almost entirely worthless. For most cases, all of the languages are fast enough. In very special cases with limited CPU and/or memory, C and C++ may be needed, since they impose the smallest CPU and memory overhead. (All of the people I know who are actually competent enough to actually produce fast, secure C code are also smart enough to know not to waste their time doing so unless absolutely necessary)

Python is usually the easiest to learn. Then Ruby. Then Java. Then C. Then Perl. Then C++. And by learning, I mean learning how to take advantage of all the features of the language.

All of the languages can be used to write platform-independent programs. And all of them can be used to write platform-specific programs. Although C and C++ make it the easiest to make assumptions about what platform your program will be running on. The other languages make it more obvious when you're breaking platform independance.

Don't jump from language to language, learning as many as you can. You won't be good at programming in any of them. Don't learn only one language either, but put some effort into aquiring real skills at the language you are currently learning before moving on to something new. And when you do learn something new, try to make an effort to use something that's actually significantly different from what you already know, rather than just being a variation on your current skills.
 
  • #34
Chroot,

It's rather rude of you to engage in a personal attack on myself. I'm not going to make this a personal post about myself, but I assure my qualifications and expertise are valid when it comes to programming. I just choose not to take part in educating myself about languages "hot" in industry now, that's irrelevant. I've worked on plenty of operating systems, platforms, and have written many programs to know that Java is more of a "buzz" in industury. Everyone wants it, but that's not always the best is it?

Ask any experienced programmer (born before Java surfaced) that isn't an industry weener how decent Java's OO implementation is. You seem intelligent, so go Google, "java terrible language" or "java bloated" and see how many hits you come up with. You're right in some aspects - I haven't done much with Java, but I know where Java doesn't belong. You sure don't write operating systems in Java; I haven't seen one, nor would I use it. I don't know a sensible person that would write an OS in Java. Most sensible, serious OS developers would actually write their own memory management and garbage collection routines. Java is bloated, even a lot more than C++. Look at the sizes of a few Java binaries, compare those to C binaries that do the same thing. It's ugly. Java's a language more for a programmer who doesn't want to write (or trust C, C++'s memory management) a decent garbage collection or memory management routine(s). Garbage collection really isn't an issue with C++, anymore. Depending on the compiler and your skill to implement temporary variables correctly, you have nothing to worry about.

I don't see how anyone can claim security with it comes to the Java VM. I'd be willing to bet that I could rip off some Java application, compile it to native code, and insert some machine code via a hexadecimal editor. I'm rather certain the VM wouldn't detect that (try it). Unless Sun's programmers are a lot smarter than I think they are, the VM can't analyze machine code. Even if it did analyze *some* machine code, I doubt it could analyze machine code for every platform the JVM can run on. The only security features the JVM offers is protection from a 12 year old.

I'll say a few good things for Java, though. Java's excellent for web applications, and if that's your cup of tea then so be it. Java is standardized (type specifications are the same in any Java distribution, numerical precision varies, though); C and C++ are not. With Java it's *much* easier to put together a nice development environment; plenty of IDE's exist out there (not that I believe in that sort of thing, sit me down with vi, anyday). I know from experience how much of a pain it is trying to get a C or C++ development environment going, especially with GNU garbage. I'd much rather write code in a language distribution such as Java and Perl rather than languages that have attempted to be standarized by an enormous quantity of organizations, but when you want performance C or asm are the only alternatives.

Edit: By the way, how can you write an operating system in Java, given you don't have pointer arithmetic? Smooth one there Chroot (Talk about me being humurous, and don't refer to JOS.).
 
Last edited:
  • #35
I'd like to clarify that I don't think Java is a terrible language, but I don't think it's the second coming of programming languages. I just think that it's not the best thing in the world, given the application.
 

Similar threads

  • Computing and Technology
2
Replies
44
Views
3K
  • Computing and Technology
Replies
6
Views
1K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
11
Views
1K
  • STEM Academic Advising
Replies
12
Views
1K
Replies
14
Views
2K
  • Programming and Computer Science
Replies
8
Views
863
  • Programming and Computer Science
4
Replies
107
Views
5K
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Programming and Computer Science
Replies
6
Views
1K
Back
Top