views:

484

answers:

12

We have been debating using PERL/PHP/Javascript/JAVA and some others to do the following things. Are there any others that can do all of these things well and easily?

1) run from command line
2) easily create a gui
3) easy configuration
4) can run quickly from command line (less overhead)
5) can easily connect to databases, run queries, and get the results
6) can efficiently open files.

I would lean towards PHP myself because I know it well, and all you really need is a php web server.

Are there any others that you would recommend or that may work better for our needs?

In response to comments. Preferrably both Windows and Unix, and no I am not limited to those four languages.

A: 

I'm not as familiar with Perl, but I'd stick with either PHP or Java, as either can do the tasks you require well. In the end, you should certainly give a good deal of consideration to the skill set of the developer(s). If you have a strength in PHP, that's probably the tool you should use.

Brian
+18  A: 

1) run from command line. Python, especially using the optparse library.

2) easily create a gui. Python, using wxWidgets or tkinter.

3) easy configuration. Python, since it's a dynamic language, you don't have to compile, you can just edit.

4) can run quickly from command line (less overhead). Python is relatively small, when compared with Java.

5) can easily connect to databases, run querys, and get the results. There are numerous libraries to connect Python directly to database, or add an ORM layer to simplify things.

6) can efficiently open files. Python is written in C and has all the performance advantages that come from that implementation.

S.Lott
So basically, no matter what the problem is, Python's the answer?
Don
@Don: for those 6 questions, yes. For other questions, the answer is no. No one asked about raw computation speed.
S.Lott
I have to agree; the GUI requirement in particular makes Python the best choice for these requirements.
Adam Lassek
+1  A: 

Any language will be sufficient. Just use one you're the most proficient with. For example, I would use Python.

Speaking strictly subjectively, I wouldn't use PHP for GUI. It's just not what that language was created for, am I correct?

Mike Hordecki
I agree that PHP would not be best for a GUI unless you want your GUI to be a web app.
EBGreen
Well that was what we were thinking, for most cases that may be all we need.
Adam Lerman
I'm not sure PHP knows what it was created for (or at least, it no longer cares!)
J Cooper
I've used a basic desktop application written in PHP, and it wasn't pretty.
Xiong Chiamiov
+3  A: 

Well, if you are only doing this in a windows environment then I would say Powershell. If you need to do this in *nix or both then I would second S.Lott's vote for Python.

EBGreen
A: 

Tcl can easily do all those things. If you add "can easily create single-file solutions for easy deployment" Tcl will win hands-down.

"Can easily connect to databases" is relative. Tcl has separate ways to connect to different languages (though a unified interface is in the works). For certain databases Tcl absolutely shines. Arguably no language supports SQLite better or easier than Tcl.

Bryan Oakley
+3  A: 

I'd say Perl, Java, or Python, but it really depends what you are doing with it.

PHP is more for web stuff, as is Javascript, which is great, if that is what you are planning to do. I wouldn't want to use either of them for a standalone app, which "run from a command line" and "easily create a gui" seem to suggest.

Perl and Python are both nice languages for quickly throwing together an app to do something fairly simple, and have big libraries of stuff to draw on for various functions. Both have various GUI toolkit bindings, though I haven't messed with them. The wx stuff for Python is supposed to be pretty nice.

If you're creating a fairly substantial standalone application, Java is probably your best bet of those choices.

  1. Can run from the command line quite easily.
  2. Easy and fast to create GUIs (that are cross-platform).
  3. Application configuration with properties files is pretty easy.
  4. Reasonably fast (not great, but it's decent).
  5. DB access is pretty easy, plus ORM stuff is out there if you need it.
  6. Not sure about file opening efficiency. What are you going to be doing?

And it's cross-platform, and has plenty of stuff built into the standard libs and tons of third-party APIs for whatever additional needs you have.

Adam Jaskiewicz
+4  A: 

Pretty much all languages can do this... I would recommend the one you know best.

Stephane Grenier
+1  A: 

To some extent, it depends on whether you meed to meet ALL of the requirements you specified, or if some are far more important than others.

Java meets all of the requirements.

However, other languages are as good or better at some of the specific requirements, so you really need to prioritize your list and then decide.

Again, if the language must do everything in the list, then Java is the better choice.

Cheers,

-Richard

Huntrods
A: 

I don't know what your intended use is -- do you need fast, scalable production code, or just a quick & convenient language to get stuff done? If it's the latter, I like REBOL. It's relatively unknown, however, so I don't know if you'd want to write client code in it.

Edoc
A: 

I think in your case it would be a fight between perl and python. Abundance of libraries in both would help you with everything you need and both run from command line very well. I would lean towards python more because of the code readability. Then its just me, maybe since u have previous experience with PHP you might like perl more.

Perpetualcoder
+2  A: 

None have mention ruby, which is a travesty. Ruby has all the advantages of python but, in my experience, the resulting code is much easier to read and modify later, once you've forgotten what you've done.

I like Ruby, but I disagree with a blanket statement that it is more readable than Python; some things are, but many Ruby-isms just cause me to scratch my head. The best advice I've seen on the subject is from a comment left on some blog by James Bennett: http://pastebin.com/f5a68d3ce
Xiong Chiamiov
A: 

Most of the comments here focus on how easy it is to write code, and by that criteria the languages aren't that different. If you look ahead to how easy it will be to debug and maintain code, Python might pull ahead of the pack. I find that code I write in Python is more likely to be correct than code I write in Perl, for example. I've never heard anybody say they write Perl because it's so easy to maintain.

John D. Cook
Many Perl programmers say this.
Alexandr Ciornii