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.
  • #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! :rofl:
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.
:rofl: 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
 
Computer science news on Phys.org
  • #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! :rofl:

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.
 
  • #51
graphic7 said:
If you're used to C syntax it's very easy to learn Perl.
Absolutely true.
faust9 said:
If you are not proficient with Unix programming then Perl has a very steep learning curve.
Not true.

In bioinformatics Perl is the main programming language, mainly because of the ability to use regular expressions when search DNA and protein files. So for bioinformatics I'd say definitely learn Perl, but before doing that I'd start with learning C. By learning C you get programmed yourself to write clean scripts and declare variables, write your own functions etc. so you get a more comprehensive understanding of programming. Learning Perl after that is a piece of cake.

But running a program written in Perl can take considerably longer to run than a program written in C. Thirty secs vs 2 secs. Probably because Perl is compliled while it is being run, while C requires compilation before it can be run?

Anyway.. I'm not a hard-core programmer, but I found that programming in C and Perl is simple and that running Unix is not a big deal either. There are some things I still need to learn though, like extracting data from online databases..

Two questions I don't quite get yet:
1. What's the difference between scripting languages and others?
2. What's exactly is object oriented? What I understand is that it allows you to bring units from different programmers together into a single program? What's the use of being object oriented?
 
  • #52
1. A program written in an interpreted language is interpreted by an interpreter when run :rofl:

A program written in a compiled language is converted into machine code and can be executed directly by the processor.

2. Object oriented programming as opposed to procederal programming uses objects to represent things. For example:

class person {

string name;
int age;

};

main () {

person david, linus;

david = linus

cout << david.age ;

}

This is a rather simple example of OOP, but it shows you how you basically organize stuff into objects. In procedural programming you would need to do something like this:

string person1_name;
int person1_age;
string person2_name;
int person2_age;

person1_name = person2_name;
person1_age = person2_age;

cout <<person1_age << endl;

You can easily see how OOP is easier to understand.

----------------------

On other note, I've recently been doing some work in Python and I must say it is one of the tightest and elegant programming language I've worked with. Although I would probable always recommend C as the best language to learn first because it forces you to actually understand memory and other aspects of programming, Python really makes programming every so more enjoyable. Especially when you don't need to remember to put semicolons at the end of each line.
 
  • #53
A scripting language is essentially interpreted. With Perl, once your script is executed, it's passed through the Perl interpreter, the Perl interpreter reads the script and calls the necessary libraries and functions, just as the script would suggest.

This is a tidbit you may find useful - Perl scripts can also be translated to C code. Take a look at PerlCC. I've seen performance increases, but it's difficult to compile it if you're using tons of modules.

Object oriented programming is a much more structured way of programming. It's a little bit more intuitive than creating a subroutine. You can sort of actually create a subroutine that holds lots of other subroutines.

I'm sure you've exercised Perl's object oriented structure before:

$a = Some::Module->new();

etc. etc.

Any time, you're using a module, you are exercising the object orientation Perl features. If you call some module like Net::FTP, we know that we're calling Net, but we really want to call the FTP function. It would be funny finding the FTP function in some module; for instance, Math::FTP. I said earlier, that it's like "creating a subroutine within a subroutine," however we know Math or Net isn't a subroutine - they just hold lots of other subroutines.

There's a lot to OOP, like polymorphism, classes, etc. etc. Objects themselves are just skimming the surface of the OOP ocean.

I had no idea that Perl was used in your line of work. You mentioned regex; take a look at `awk' in UNIX. It's basically an interpreter that can accept regex's from the terminal. It might save you a few minutes the next time you're wanting to search through something, instead of having to hack up a Perl script with some simple regex, which is unneccessary.
 
Last edited:
  • #54
Which is the best language for graphics.
 
  • #55
thats a hard one.

Many here might say C++.
I would rather say C# than C++ (but that is because i bloody hate C++)

Altough, whilst i was still programming 3D games i do remember having seen a Delphi 3D engine once, and it was remarkable. But that was almost 3, perhaps even 4 years ago. So i have been out of the professional game dev loop for a while so i am going to leave this to others to answer.
 
  • #56
chound, it depends on what you mean by graphics. Any high end game is going to be written in C++. If your doing simple 2d or 3d drawing you can get away with slower languages.

Bah C#. I would never recommend locking your self into the .NET framework. This is just another way Microsoft can force you to pay their tax. I've never written anything in that language and I don't plan on doing so anytime soon. I'll stick to python thank you very much.
 

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
873
  • 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