Which Computer Language to Learn

AI Thread Summary
The discussion centers on the best computer languages to learn, particularly for someone with a background in physics and some knowledge of C++ and Java. Participants recommend learning scripting languages like Python, Perl, Ruby, or PHP for their ease of use in prototyping and server-side programming. Python is highlighted for its object-oriented capabilities and suitability for scientific applications, while Perl is noted for its utility in Unix environments. Java is clarified as a compiled language, not a scripting one, and while it has cross-platform capabilities, it is criticized for performance issues compared to C++. Ultimately, the consensus emphasizes the importance of choosing a language and mastering it rather than jumping between multiple languages.
Tom McCurdy
Messages
1,017
Reaction score
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
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.
 
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).
 
I'd recommend either Python or Java.

- Warren
 
ty for ur suggestions
 
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.
 
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?
 
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.
 
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. :smile:

- 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? :smile:
 
  • #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. :smile: 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.
 
  • #36
graphic7 said:
I just choose not to take part in educating myself about languages "hot" in industry now, that's irrelevant.
Of course it's revelant -- YOU ARE TALKING ABOUT THE LANGUAGES.
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?
Yet you don't actually know the language.
Ask any experienced programmer (born before Java surfaced) that isn't an industry weener how decent Java's OO implementation is.
I've been programming since 1988, long before Java was invented. I learned C++ in 1991. Java is by far one of the best OO implementations ever created, and the vast majority of programmers agree with me. Why don't you present some cogent arguments on Java's flawed OO, rather than telling me to go google? You probably can't, since you don't know Java! :smile:
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.
You haven't seen one? There are several. Maybe you should do some research...
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.
I beg to differ. Write up a graphical "Hello World" app in Java, and another in Win32 if you'd like, and show you the difference in file size. They're virtually the same. You obviously don't know what you're talking about -- again.
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).
Or perhaps it's for programmers who'd prefer to let a very talented algorithm designer develop a garbage collection algorithm and build it into the language.
Garbage collection really isn't an issue with C++, anymore.
:smile: Memory leaks remain one of the single largest issues in application development. Have you worked in any production software environments in your whole life?
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).
It most certainly won't work -- it'll fail the bytecode verifier immediately. Why don't you go read a book on the language before making stupid comments like this?
Unless Sun's programmers are a lot smarter than I think they are, the VM can't analyze machine code.
It doesn't, it analyzes bytecode. It runs bytecode. And apparently they *are* a lot smarter than you think they are. Of course, you don't know the language, so you are again handicapped and not really able to make any sensible arguments.
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.).
Why would you need pointers? Your blessed language, Perl, doesn't include them directly.

Put a sock in it graphic7... you don't know your ass from a hole in the ground on this one, and you might as well let it rest. Go educate yourself before making comments about languages you don't know. It's simple, really.

- Warren
 
  • #37
graphic7 said:
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.
Who the hell ever said it was? It's ideal for some applications. It has its place, just like C++, Perl, Python, Ruby, Icon, Scheme, Lisp, etc...

- Warren
 
  • #38
graphic7 said:
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).
You made comments about the Java VM in a previous post that lead me to think that you really don't understand it all that well.

Your comments here lead me to think that you don't understand it all that well.

You might find it interesting to read up on the Java Virtual Machines, and particularly on its security functionality.
 
  • #39
I agree with much of what Mr root said (though I'd say in less caustic terms:biggrin:)

Here's an OS created using Java JX

graphic7: There's been only one known Java virus and that one only alters class files. I believe Sun has since patched Java to prevent virii (is this a real word, always wondered but never looked into it) attacks such as this since 1999 BTW (when the only virus appeared). It is exceedingly difficult (not impossible, never is) to make a Java virus because the JVM simply won't allow it. The OS running a Java app doesn't execute the Java code per-say--the OS only hands the information to the JVM for execution. You can hide as much malicious asm code in a chunk of Java Byte code as you want because the OS will never see said asm code as anything other than information (not commands). The JVM OTOH looks at the byte code prior to execution and verifies that the code is 100% java code. If it's not a pure jar file then no dice--it won't run.

Moreover, Java apps CAN be infected by a virus (though difficult) but applets cannot. Applets run under a different mechanism and have no access to write to a file tree so if infected cannot spread said infection. Only Java apps can spread infection yet as stated twice this is very difficult to accomplish.

Java is pushed because it is cross platform. It is mature. It is safe. It is stable. It is just this side of C/C++. It is easy because there are 1000's of functions already available. It is moderately fast if the programmer takes the time to use proper import statements (no import java.util.*; instead only import the functions you need). As chroot said java bytecode is comparable to any GUI bytecode. As an example, write an array q-sort algorithm with GUI on your favorite OS and do the said in Java. Java's readily available q-sort algorithm is fast and small. Unless you full optimize your own algorithm the one you write will be the same size as the java version I dare say. Java is easy. It is useful for web applets. It is useful for enterprise RAD. It's forgiving. It offers different ways to implement GUI's (awt and swing). It is useful as a server side tool. Is has many modules that make the internet more useful. It enables one to write code that runs on win32 and a sparcStation in exactly the same manner (mono isn't 100% there yet and C# is an offshoot of Java to begin with). It is OO. It fixes some of smalltalk's flaws as well as C/C++ flaws.

It's not perfect by any means but at the same time your characterization seems based on second hand knowledge and is overly critical of a few aspects.

Graphic7:look into Java's "sandbox" scheme. This should help clear up some misconceptions about Java's JVM.

PS. PHP is a lovely language(my favorite in fact) for anyone who want's to learn a scripting language. PHP has a lot of built in tools and is very useful as a web tool. There is a project working on porting PHP to a system level tool in the same vein as Perl and Python. This is an off argument aside simply because I like PHP so much.
 
Last edited:
  • #40
For the most part, I quite agree with what you say. I just want to make 2 points.

faust9 said:
IMoreover, Java apps CAN be infected by a virus (though difficult) but applets cannot.
For this statement, you are assuming default security manager settings. These can and should be changed, at least for applications.

he programmer takes the time to use proper import statements (no import java.util.*; instead only import the functions you need).
Import statements do not import functions, but classes. As well, the use of import statements that you recommend only has compile time advantage; it has no run time advantage.
 
  • #41
Prometheus said:
For the most part, I quite agree with what you say. I just want to make 2 points.


For this statement, you are assuming default security manager settings. These can and should be changed, at least for applications.


Import statements do not import functions, but classes. As well, the use of import statements that you recommend only has compile time advantage; it has no run time advantage.

Thanks for the corrections. Not a 'true' Java guru myself--only a moderate dabbler. Had to learn it because I worked for a company that manufactured high end network equipment (backbone equipment) and the testing of said equipment was done using windows and sparcStations. Java was a perfect tool because the same app could do all that needed to be done on both OS's available from a central server. I had to maintain the code for a few months though so I only program java at a moderate level.

When I made my first statement I did assume default security settings because I've never trusted others to deviate from the default. Look at how many windows attacks in the past could have been alleviated by users altering the sloppy windows defaults. Programmers can be no better with this when a deadline comes down the pipe. I know, I've taken shortcuts to get a working app onto the floor in time just to get people off my back. I also know I'm not alone in doing this.

PS. I learned C as my first language so classes and functions are the same to me. I understand the terminology is wrong but it's hadr to teach an old dog new tricks.
 
  • #42
faust9 said:
PS. I learned C as my first language so classes and functions are the same to me. I understand the terminology is wrong but it's hadr to teach an old dog new tricks.
How lucky you are. I used a dozen languages before I learned C. I thought that I was in heaven when I found C, and I never wanted to give it up. Then, I discovered Java. I really like the OO paradigm (and the WWW), and now I don't code C any more.
 
  • #43
Prometheus said:
How lucky you are. I used a dozen languages before I learned C. I thought that I was in heaven when I found C, and I never wanted to give it up. Then, I discovered Java. I really like the OO paradigm (and the WWW), and now I don't code C any more.

Yeah, I got my first computer in 88--an Amiga 2000--after going to a friends house and playing some games on his dad's Amiga. Said friend's dad was an Amiga software developer who got me started. He gave me my first c compiler and a couple of c books. I was going to try and learn Amiga Basic was persuaded to go straight for C.
 
  • #44
faust9 said:
Yeah, I got my first computer in 88--an Amiga 2000--after going to a friends house and playing some games on his dad's Amiga. Said friend's dad was an Amiga software developer who got me started. He gave me my first c compiler and a couple of c books. I was going to try and learn Amiga Basic was persuaded to go straight for C.
Back in the olden days, every machine had its own version of Basic. All of them were easy, but they were, well, basic. I never learned Amiga basic, but I learned too many others. C is such a beautiful language compared to the others that I used.

Before C, the language that I thought was the most fun was called APL ("A Programming Langauge"). This was an IBM language, and it was fun.

In 1999, I had an offer to make 6 figures doing Y2K COBOL programming. One last fling, so to speak. Forget it. COBOL is one language that I don't mind if I never see again. Dinosaur code.
 
  • #45
chroot said:
I've been programming since 1988, long before Java was invented. I learned C++ in 1991. Java is by far one of the best OO implementations ever created, and the vast majority of programmers agree with me. Why don't you present some cogent arguments on Java's flawed OO, rather than telling me to go google? You probably can't, since you don't know Java! :smile:

I couldn't pass up this, even though this remark wasn't directed at me. There is a horrible, horrible thing in Java's OO design. It has "objects" which are not "Objects". Things like int and double and char and so on. It's not as much of a problem now that autoboxing is being added to the language; but it is an ugly wart on the language.

And arrays...why are they even in Java? Any language with a collection class doesn't need arrays. Arrays are just a special type of collection, and there isn't any benefit to making them a special case that works differently.


Of course, the OO in Java is a good, solid model. But I think it's stretching it to call it "one of the best OO implementations ever created". What does Java's OO model do that other models don't?
 
  • #46
And a nitpick on sorting: Collections.sort uses a merge sort, not a quick sort, because the specification requires it to be a stable sort. (I should compare it to SGI's implementation of C++'s stable_sort sometime)

I don't think Java has a quicksort built in... but I can hardly claim to know everything it has. :smile:
 
  • #47
master_coda said:
I couldn't pass up this, even though this remark wasn't directed at me. There is a horrible, horrible thing in Java's OO design. It has "objects" which are not "Objects". Things like int and double and char and so on.
Java has 8 primitive types. These are available because they reduce overhead and increase execution time. Each of these has a corresponding Java class.
 
  • #48
Prometheus said:
Java has 8 primitive types. These are available because they reduce overhead and increase execution time. Each of these has a corresponding Java class.

Even if it was true that they we a good optimization, that doesn't change the fact that it drastically reduces the elegance of the OO in Java. It wouldn't be so bad if the primitives were just an added speed feature that could be ignored, but they aren't. The primitive types are used in most of the core classes, and since the standard arithmetic operators don't work on the Java classes it's a pain to use them for arithmetic.

And it isn't a good optimization. A much better one would have been to just have the Java classes, and to represent them internally using primitives, converting them into full-blown objects only when necessary.
 
  • #49
What exactly is php...
i have been able to do some crazy stuff with it as far ascessing service information.
 
  • #50
php is one of the best (if not the best) webprogramming languages. i use it a lot (its the foundation of my website: www.dematrix.net). I like php for several things:

1. it is open source, and this makes it easy to learn plus all the valuable info is located at www.php.net
2. its syntax is similar to c++ (i think they took it from c++). this is good for me because my main programming language is c++.
3. it is powerful, in that you can perform many functions as you can see from php.net. i have done asp and coldfusion (not as indepth as php) but i think php has more functions

there are many more reasons why php is one of the best and if you use it for webprogramming you will see for yourself.
 
Back
Top