Java? Python?

My programming experience is, I am afraid,limited to a bit of machine control under mostly Fig Forth and a bit of Basic programming. The closest I have gotten to GUI is a few hours with Visual Basic.
I have a current idea for a project that would involve sorting photographs and inserting meta-data into the jpeg files. I’d like my future projects to not be limited (too much) by my choice of ONE language to learn (I am really more of a hardware guy). Some day (soon?) I’d like to try an embedded Linux controller for machine control and would like a language that can do that.
After reading the posts, it seems that the recommendations center around Python and Java. I’m leaning towards Java. Any reason I should not? Netbeans seems to be the recommended Java environment, yes? I don’t know much about Java, but I have read about Java as a language and “Java Script”, and then a few mentions about a Java that is for web apps. Is this all bits of the same thing, or different things? Can you (gently please) convey the difference? Any other language I should choose instead?

I’ve tried C, C++, C#, Java and now Python and I’ll tell you Python is the best language!!! I’ve spent years trying to write programs in those first languages on and off. You have to really spend a lot of time keeping with those languages. But Python, I wrote 3 complete apps in just a couple of months. I regret I wasted so much time on those other languages and didn’t take on Python earlier. Now, I won’t touch anything else. You can write really cool apps with Python and Qt (PyQt) in no time. And the best thing about it is that it’s truly multi-platform. Yeah, try writing a GUI app in C++ or C# or Java for both Linux and Windows and see how much trouble you’re in for.

Python’s great for non-CPU intensive GUI apps. But if you really need to crunch the numbers, you better look elsewhere.

I use Eclipse for Java EE IDE with PyDev plugin - purely for syntax hilighting. But as I remember more functions, methods and properties I tend to use just KWrite for quick source editing.

As to Netbeans and Java, they’re Sooooooooooooooooooooo Sloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooow

I’ll put it this way - if you want to be a real programmer, learn C++ or Java, if you just want to write some apps for yourself quickly, that is if you want to be a hacker - learn Python. And I just love this quote:

“…when being pragmatic, working with real deadlines and something needs to be done/fixed/etc the hack gets things working in no time, while the ‘better programmer’ is still in the clouds thinking of how to abstract the problem so that it can solve X other problems we don’t care about.” - brilliantly said.

Python is an interpreted language which in itself isn’t bad if your goal is quick CLI apps and some very basic GUI stuff. It however lacks a good GUI builder of it’s OWN. As for java this language is suited explicitly for web development and online tools and interactions. Being a Hardware guy myself, neither of these are a good choice for embedded control unless you want said control to in some way be handled over the internet.
The best platform for embeded control is idealy based in Assembly language regardless of the OS especially if it requires tight timing and calculations for same.

Proponents here will likely recommend c/c++ because it’s what is used for development of the Linux kernel, DE, Apps. On the GUI side, there is GTK, QT4, Kdevelop, glade to name a few that help with GUI development and produce c/c++ output. xForms used to be good but in good conscience I can’t recommend it much anymore because of discontinued features.

You say you have some experience with with visual basic, while you will probably get some flak about it being cr** , Gambas2 allows creation of the GUI easy and produces tokenized output which allows you to tailer it to link with c++ modules. I personally don’t like this approach since the code out is tokenized and thusly not too portable. kbasic follows unstructured basic quite a bit but does work and produces c++ output. xbasic isn’t really basic at all even though it does use use basic keywords for simplicity. It functions similar to visual basic but produces pure assembly code output. It can use xbasic libraries, c libraries, pascal libraries, in a well structured manor.

I’m a former hardware person who got to grips with C/C++, but somehow never got around to Python until recently. Python really does make you more productive, and it’s fun. The trouble with C/C++ is that you’re forever having to do something beforehand to prepare to do the things you really want to do. With Python, your first task is simply to ask yourself where the module that nearly does what you want is, once you’ve found it, the rest takes care of itself.

As for embedded and being a hardware person, one of the first things I did only my current Linux embedded project was build Python for the target.

I’m leaning towards Java. Any reason I should not?

You’re always going to split the programming field down the middle with the python/java thing. The best answer might be “There is no reason why you sould not lean towards Java or its alternatives”.

*Netbeans seems to be the recommended Java environment, yes? *

Or eclipse. But until you build big applications, or big dynamic websites, there’s nothing wrong with a text editor and the command line. My vote is for Notepad++ in Windows or Emacs in Linux.

*I don’t know much about Java, but I have read about Java as a language and “Java Script”, and then a few mentions about a Java that is for web apps. Is this all bits of the same thing, or different things? *

Java SE is used for normal programs / applications etc. It includes the JDK. Java EE is for web applications / network programming in general. It inclused the JDK, and more libraries for JSP’s, Servlets, etc. You usually use Java EE with other stuff like Spring, Hibernate, EJB, and servers. All that is quite advanced stuff.

JavaScript is something different entirely. It is used mainly in HTML for “sprucing up” websites, making custom menus, pop-ups, etc. It is not as big as Java, and it is not compatible, but has somewhat similar syntax. It is called JavaScript because the inventors were trying to catch the Java popularity wave in the 90’s.

While there are some good recommendations, I want to throw another one into the thread:

FreePascal is a modern dialect of (Object-)Pascal that is designed after the Delphi programming system and follows a “write once, compile anywhere” concept which means, is focused on being platform independant on a scource level. It is quite easy to learn, has rather big standard/semistandard libraries (run time library, Free Component library/ Lazarus component library), supports object oriented programming, has a real Delphi-like RAD IDE (Lazarus) and a simple turbo-pascal-like IDE shipped with the compiler. It has two build-systems (fpcmake and fpmake) built in, and everything is available in the packman repository. It is compatible to any major pascal dialects. You can build any kind of application without limitations, because it produces highly efficient machine code. I think that is exactly what you asked for.

The Lazarus component library also features an abstraction layer for some gui-toolits so you can write your applications using the LCL and its graphical gui-designer and then when compiling it, tell the IDE to use qt, gtk, winapi or whatever you want. So, easy deployment of native Apps for different environments is possible too. Some of the bindings (like the qt one) are still experimental though and don’t work for me.

You could try Ada too, it’s kind of my favorite language and you can find a comiler in the official oss-repository. But it’s harder to find tools and libraries for it, because the typical applications using Ada are not so hobbyist-friendly. But perhaps your machine you want to control is a high-tech rocket launcher aiming for any openSUSE-resistance. :wink:

Java and especially Python are very nice languages, but you can’t just rely on them. In some situations (memory and/or processor intensive code or weak machines) you will get yourself into trouble. So, it’s nice to work with them, but they don’t fullfill your criteria.

In small embedded systems you simply cannot use them too. embedded systems are built with software and hardware well fitting together. Java or Python means you need much more expensive and energy consuming parts. You could also need external memory where internal would do it with other tools, so it can be a matter of board space and hardware complexity too. Dynamic systems and garbage collection means you will give up control over your system which is helpful in many situations, but can be bad in low-level code.

My programming experience is, I am afraid, limited to a bit of machine control under mostly Fig Forth …

Hey, everything is pink. If you have ever mastered Fig Forth, you can master any language on the fly. I believe that Fig Forth is the closest cousin to malbolge.

It is long ago, that I coded Fig Forth in Z80 assembler, just to try out the ackerman function (and write a decent forth editor).

For the project you mentioned I would go with just plain bash and call the right tools in the right manner. Otherwise have fun with python.

Try them all out and see what each is good for.

All computer languages are horrible in their own way, but most have some redeeming features. :wink:

Or put it another way: I never met a computer language I couldn’t beat, even if it meant changing to another language. :wink:

Some major java misconceptions here.

Java and especially Python are very nice languages, but you can’t just rely on them. In some situations (memory and/or processor intensive code or weak machines) you will get yourself into trouble.
Well yes, the JVM does take up an additional 28MB or so… that’s some very weak system there if it can’t run properly.

Also not having control over the garbage collection isn’t a problem 99,99% off the time… android is written in it and it’s INTENDED to be used on mobile devices/weak hardware so it hardly ever a problem.

As for java this language is suited explicitly for web development and online tools and interactions

No it isn’t. Javascript is intended to be used on websites (and in svgs and possibly in other places). Java is an entirely different thing and the thing coming the closest to it imo would be C#/.NET.
The syntax isn’t really similar either besides the basic that nearly every programming language shares.

eah, try writing a GUI app in C++ or C# or Java for both Linux and Windows and see how much trouble you’re in for.

Unless you start doing calls to the native OS functions you’ll run into no problem at all! The beauty of java is that it will run everywhere without needing to recompile it.
For example try installing a program like Jude. The windows installer places a .jar on your disk which you can run perfectly fine from Linux if you mount the partition.

Now all that’s out of the way… Java does handle some thing in a rather roundabout way. Coupling an action to a click on a button is in java unnessecary complicated imo. If you want your program to run on a wide variaty of platforms Java is however a very viable choice and both Netbeans and Eclipse are proof that you can write very complicated/powerful applications with it as besides both being java editors they’re also written in java.

You may forget that 28 MB is very much in the World of Computers. There’s much more in this world than full-blown desktop computers. Also, try to count your packages installed and your processes running on your PC. On a PC, an application is never alone. And there will be some point, were your computer just get slower. That point is earlier when using more memory and/or CPU per application, ie, when all the application developers say: “performance is no deal on todays computers”.

It is not really written in Java. There are many layers below the Java code of Android, as far as I know, but at least the kernel (because it’s Linux) and the Dalvik VM (because chicken/egg problem) are for sure not written in Java. Android provides an application framework for Java programming and a virtual machine for Java and as far as I know the UI and standard applications/widgets are written in Java. That’s not exactly what I’m thinking of when talking about low-level programming where you have to have exact control. That’s application development and that’s ok for Java in most situations.

You also have to consider that Android is not meant to be running on weak hardware. Todays smartphones, where android typically is deployed on, are pretty powerful machines. Give them a DVI and some USB connectors and they will make up a decent low-end desktop machine. The Nexus One has a 1GHz ARM processor and 512 MB RAM. That’s very close to modern netbook specs.