Amiga.org

The "Not Quite Amiga but still computer related category" => Alternative Operating Systems => Topic started by: trekiej on January 24, 2008, 07:31:03 PM

Title: Any Java Programmers here?
Post by: trekiej on January 24, 2008, 07:31:03 PM
What is your view of Java?
What IDE's would you recomend?
Thanks.
Title: Re: Any Java Programmers here?
Post by: Caius on January 24, 2008, 07:41:18 PM
Quote
What is your view of Java?

I think it's clumsy and bloated. I really don't like it, but that's probably because it was forced down my throat at university.

Quote
What IDE's would you recommend?

I've mostly programmed Java in a UNIX shell, with Emacs. But it seems NetBeans (http://www.netbeans.org/) is one of the more popular IDEs.

Quote
Thanks.

You're welcome!
Title: Re: Any Java Programmers here?
Post by: Crumb on January 24, 2008, 07:52:04 PM
I don't like it much... but for me it looks more "clean" than .net

I use Eclipse although I have used IBM RAD and it's great. Unfortunately it's quite expensive.

I haven't looked much at netbeans but IIRC it had better DB integration/plugins.

Eclipse is nice but its plugins usually suck pretty badly. E.g.: If you try to commit some file using the subversion plugin and the server is down it will show a message stating that there are no changes comparing the file with the server instead of showing a warning stating that there's no connection with the server.

Maven2 plugin also sucks IMHO. And Tomcat plugin could give you a pair of headaches
Title: Re: Any Java Programmers here?
Post by: bloodline on January 24, 2008, 08:13:53 PM
Quote

trekiej wrote:
What is your view of Java?


What are you trying to achieve?

Quote

What IDE's would you recomend?
Thanks.


I like Bloodshed's DevC++ I think they do a Java version.
Title: Re: Any Java Programmers here?
Post by: Speelgoedmannetje on January 24, 2008, 08:21:09 PM
Quote

trekiej wrote:
What is your view of Java?

Fantastic idea, sluggish on certain accounts (memory management, GUI libraries)
Quote

What IDE's would you recomend?

Eclipse. Netbeans is ok for gui building, but the source of these GUI's are not portable; you cannot compile a GUI of a netbeans project in another IDE.
Also, the GUI design program in Netbeans is rather limited.
Quote

Thanks.
You're welcome :-)
Title: Re: Any Java Programmers here?
Post by: Speelgoedmannetje on January 24, 2008, 08:24:36 PM
Quote

Crumb wrote:
I don't like it much... but for me it looks more "clean" than .net
You have to get used to C#. It's more clean than java. With delegates, you'll be able to code your project more 1on1 to your design (no need for implementations with threading and observable/observer patterns).
Title: Re: Any Java Programmers here?
Post by: Trev on January 24, 2008, 08:33:40 PM
I only write Java code when I need ColdFusion to do something it doesn't, like paged LDAP searches. (i.e. My view of Java is limited to the environments I support.)

Nothing wrong with Java as a language. Just make sure your runtime environment (JRE, application server, etc.) is stable and fit for your purposes.

We use Eclipse.

Trev
Title: Re: Any Java Programmers here?
Post by: trekiej on January 24, 2008, 10:29:10 PM
Thanks alot to all.

I want to see if the Write Once Run Anywhere Pardigmn is any good.
I would like to make applications that could run in a browser or be stand alone.  I understand that Java has this ability.
I know that Python is abit portable (if it has been ported the platform of choice) and I do not know if C# is a Msoft only idea.

I do not know much about C++ portability, care to elaborate?

In the end I would like to write software for the Amiga/Aros platform and may do it from another machine.

Good day.

Title: Re: Any Java Programmers here?
Post by: Speelgoedmannetje on January 24, 2008, 10:35:30 PM
Quote

trekiej wrote:
I understand that Java has this ability.
Basically, yes. But AFAIK some things like AWT are not completely platform-independent. Also, ppl can use platform dependent libraries in their software. Like joystick control is based on such.
Quote

and I do not know if C# is a Msoft only idea.
Well it is.. but there is a WIP to get .NET running on Linux. C# will then be a next step, naturally.
Title: Re: Any Java Programmers here?
Post by: Trev on January 24, 2008, 10:37:33 PM
Java is portable, but you can't make assumptions about the capabilities of the JVM. For example, some environments lack graphic display capabilities; others lack network connectivity.

In theory, C and C++ source code is portable as long as you use standard libraries or libraries you know are available on the platforms you want to support. In practice, however, not every platform implements the standard libraries in the same way, so compiling source on a new platform usually requires some sort of porting effort. What usually kills modern applications is the lack of a GUI toolkit.

If you want to write for Amiga-like operating systems, Java is definitely not the solution. Stick to C (or C++ if you have access to a well-maintained compiler).
Title: Re: Any Java Programmers here?
Post by: Tripitaka on January 25, 2008, 01:19:55 AM
Quote

I think it's clumsy and bloated. I really don't like it, but that's probably because it was forced down my throat at university.


LOL, I'm doing my BaSci(Hons) with Open University at the momment, LOOOOAAAADDSS of java.
Title: Re: Any Java Programmers here?
Post by: trekiej on January 25, 2008, 02:21:31 AM
I wish I had a book on Zune/Mui.
I have downloaded the muldev.lha but still need to finish my c++.
I do have ami dev cpp but have not used it yet.
Thanks.
Title: Re: Any Java Programmers here?
Post by: nyteschayde on January 25, 2008, 03:09:38 AM
Asking a site full of Amiga programmers, err I mean users, if they like Java is the same as asking for punishment. Java, as a language, is a good one. Most modern computers can run Java well enough to use it as a substitute for most types of applications.

Java 5 and 6 now has support for direct input polling (https://jinput.dev.java.net/) (for joysticks, controllers and the like), OpenGL (https://jogl.dev.java.net/) and OpenAL (https://joal.dev.java.net/) through some open source projects by Sun. Java 6 has hardware-accelerated translucent images. These things alone allow you to be in a postition to write decent games in Java.

As far as IDEs go; if you are not very proficient or if you just want great code completion Eclipse (free) or, my favorite, IDEA IntelliJ (commercial with a trial available) are great IDEs. If you know Java in and out a decent text editor like TextMate (http://www.macromates.com) for the Mac or e-texteditor (http://www.e-texteditor.com) for Windows plus a decent set of JavaDocs will do you just as good.

If you have further questions or need support, PM me.
Title: Re: Any Java Programmers here?
Post by: avanham on January 25, 2008, 07:00:43 AM
I use Java all the time and I really like it.  It certainly is not meant for every application (eg 1st person shooter games are a poor choice for Java development) but for creating a GUI based program it works great.  There are a few things that make Java my favourite language:

1.  There are TONS of books about java (several hundred, at least).  Compare that with, say, Python or Ruby (not to bash either of those languages) where the number of books can almost be counted on your fingers and toes.  If you are a hobbyist like me, this is a godsend.

2.  IntelliJ IDEA.  It is an amazing IDE that makes programing in Java much more enjoyable.  I recommend it over Netbeans, and especially over Eclipse (which I have never been able to figure out).

3.  The Java Forums at Sun's java developer site are incredibly rich.  Whenever I have a problem I check there first and often I find someone who has asked the same question and the answer proposed by someone else.

4.  Java has garbage collection.  If you have ever programmed in C++ (or C for that matter) then you know what a hassle dealing with memory allocation / deallocation is.  With Java you don't have any of these problems.

5.  Java runs on most of the platforms out there.  Programs I write on my Mac, work perfectly on PCs and Linux.  There are differences in how they look on those platforms, but they still work.

6.  Java is an object-oriented language.  This is pretty much a must for any language these days.
Title: Re: Any Java Programmers here?
Post by: uncharted on January 25, 2008, 07:18:23 AM
Quote

nyteschayde wrote:
Asking a site full of Amiga programmers, err I mean users, if they like Java is the same as asking for punishment. Java, as a language, is a good one. Most modern computers can run Java well enough to use it as a substitute for most types of applications.


Couldn't have said it better myself.  Why is it always the most clueless that are the loudest and most opinionated? :headwall:
Title: Re: Any Java Programmers here?
Post by: Ohno on January 25, 2008, 08:17:19 AM
I am a Java developer by profession, so yes, I like it. Wouldn't be doing it otherwise  :-D
Creating a program in Java usually means it'll be pretty easy to get it running on Windows, Linux and Mac (although some issues might require more thinking through because of differences in the way those systems work).

If you want to go mobile, Write-Once-Run-Anywhere doesn't apply anymore. Every device and every manufacturer seems to support a different set of API's and profiles. Blackberry has it's own graphics API for example (no AWT), while others do depend on AWT but have different implementation bugs. That's what Amiga-Anywhere tried to fix (and it worked quite well) and it's also what Google Android tries to fix. Android, again, uses their own custom API's but they hope to cover a huge number of mobile devices with their platform.

Sun has recently been paying a lot of attention to a better user-experience, which is especially important if you want your program to work in a webbrowser. Soon those updates will be released, but you can already download update N (https://jdk6.dev.java.net/6uNea.html).

Writing games is also perfectly possible, but usually you'll end up using native libraries for hardware accelleration and those libraries don't always work inside a browser (Java applets). For writing games I'd advise you to take a look at Slick (http://slick.cokeandcode.com/).

My favorite browser is also IntelliJ IDEA (http://www.jetbrains.com/idea), but if you're just getting started, one of the Open Source IDE will probably do just fine for you. Or maybe just JCreator (http://www.jcreator.com). It's a great high-performance IDE with less bells and whistles, so it'll be easier to get started (less stuff to work through). They offer a light-edition for free, but it'll only work on Windows.
Title: Re: Any Java Programmers here?
Post by: Caius on January 25, 2008, 09:18:12 AM
Quote
Quote

nyteschayde wrote:
Asking a site full of Amiga programmers, err I mean users, if they like Java is the same as asking for punishment. Java, as a language, is a good one. Most modern computers can run Java well enough to use it as a substitute for most types of applications.

Couldn't have said it better myself. Why is it always the most clueless that are the loudest and most opinionated?

That's a very good point. The choice is programming language should always depend on context. Which tool is right for the job? If you're just knocking up a simple command line tool an interpreted language (scripting language) is a valid choice. Java would be overkill in that case. While I don't care much for Java, it doesn't mean I'd never use it if it was the most obvious choice.

My personal preference is C/C++, but I'm well aware of the inherent problems with these languages. You need to spend time, carefully planning a strategy for resource handling because of the lack of garbage collection. Another problem is that it's easy to introduce subtle bugs that the compiler doesn't pick up, for example implicit type conversions that you didn't really intend. C++ is slightly better here.

As for portability it's already been mentioned that the standard libraries are sometimes implemented in different ways. A good example is the BSD socket library (while not part of the C standard library, it's still THE standard network library in C/C++). In one implementation a function may take a 'char' as an argument, while under another implementation the same function may take an 'int'. Because a C compiler allows implicit type conversions (as noted above), you'll often not even be warned about your mistake. The socket library under Win32 is based on BSD sockets, but it's full of these subtle differences.

So the answer to the question if C and C++ is portable, is "Yes, and no.".
Title: Re: Any Java Programmers here?
Post by: Waccoon on January 25, 2008, 09:22:17 AM
Like most languages, Java is a mixed bag.  Java is slow if you're doing anything related to graphics, though it's very usable for processing.  It's also very, very picky about structure, so if you're used to something like shell or script programming, Java will appear quite bloated and annoying.  If you know basic C first, picking up Java is a lot easier.  In Java, you must use booleans for conditions, type conversion can be a real pain, and everything must be a class, so even simple programs can be big, confusing, and have a lot of variables.  It does have excellent documentation, tons of good books available, and the compiler is fairly intelligent, so you tend to run into fewer newbie mistakes when you're starting out.  Applets can be easy or infuriating, depending on what you're doing (especially when Sun once again changes their mind about security policies).

The portability of Java is questionable, since it depends what APIs you use, but if you know enough about Java so portability is an issue, chances are you already know what to do.  I really have no idea what Java is like on the Amiga -- I mostly work with applets.

You need to learn OOP principles if you want to code in Java.  Unlike other languages, Java really doesn't like doing things procedurally.  Unfortunately, few books really teach OOP well, or even provide good reasons for doing things that way.  I think that's why there's such a backlash against OOP.  It's a different way of thinking, designed to solve specific problems.  Some people love it, some hate it.  Java loves it, and lets you know it constantly.

If you're looking for a good starter's book, I'd recommend Head First Java (http://www.amazon.com/Head-First-Java-Brain-Learners/dp/0596004656).  The presentation is a bit silly, but in terms of content, it really is a terrific book.  OOP is explained well, and it gives you a lot of tips early on that most books tend to save for later, which saves you from having to un-learn informalities and shortcuts from previous chapters.  The book prefers to teach Java, rather than endlessly praise it.  I'm at odds with Java, but I love this book.

Eclipse is a popular IDE, but I haven't used it.  IntelliJ IDEA (http://www.jetbrains.com/idea/) is the one I use, and it is very good if you value the best auto-complete and code inspection features -- so long as you're not fussy about navigation and indentation.  A friend of mine also uses JEdit (http://www.jedit.org/), which is good for converting code to Java, though it's pretty slow.  Personally, I prefer EditPlus (http://www.editplus.com) as an all-around text editor with some useful IDE features.  It's slim on features, however, for the sake of being fast and lightweight.
Title: Re: Any Java Programmers here?
Post by: ChrisH on January 25, 2008, 09:28:11 AM
@trekiej who said
Quote
I want to see if the Write Once Run Anywhere Pardigmn is any good.

Critics of Java have often said that Java is a "Write Once, Test Everywhere" language, because each JVM has different bugs (especially outside of the main desktop OSes).
Title: Re: Any Java Programmers here?
Post by: balrogsoft on January 25, 2008, 09:42:43 AM
I used intelliJ and netbeans for mobile games development on my previous work, intelliJ seems to be more powerfull ide, but i found a little confusing for some tasks, at least when i tried two years ago. Netbeans is very clean and easy to work with.
Title: Re: Any Java Programmers here?
Post by: Caius on January 25, 2008, 09:47:11 AM
I'll probably get flamed for this, but the best IDE I've used is M$ Visual C++... That is one product they actually got right.
Title: Re: Any Java Programmers here?
Post by: Piru on January 25, 2008, 10:23:08 AM
@trekiej
Quote
In the end I would like to write software for the Amiga/Aros platform and may do it from another machine

Java is out of question then, unless if you'll only use console. Even then, the amiga java implementatins are quite lacking.
Title: Re: Any Java Programmers here?
Post by: Crumb on January 25, 2008, 11:08:33 AM
@trekiej

Then you'd better check out C/C++ :)
Title: Re: Any Java Programmers here?
Post by: trekiej on January 25, 2008, 01:56:24 PM
I admit I am not completely decided on what to do.
I will do my best to learn both c++ and Java.
I do not guess it will hurt to learn one and then the other.
I have not gotten deep enough into Java to see the complete difference its point of view of OOP is to C++.
I believe it should not be too difficult to use both when the differences are known.  I say not in the same prog. of course. :-D
edit:
check this out.
http://www.opencores.org/projects.cgi/web/jop/overview
it is a java processor.
Title: Re: Any Java Programmers here?
Post by: Speelgoedmannetje on January 25, 2008, 02:26:59 PM
Both C++ as well as Java are OOP.
Title: Re: Any Java Programmers here?
Post by: jj on January 25, 2008, 03:32:05 PM
Quote
I'll probably get flamed for this, but the best IDE I've used is M$ Visual C++... That is one product they actually got right.


I think Visual Studio is a brillaint IDE. only used VB but its all the same
Title: Re: Any Java Programmers here?
Post by: trekiej on January 26, 2008, 12:56:56 AM
Something that interested me in learning Java is a project called YADRA.  It is Yet Another Distributed Render Application.  It uses Java to pass the files around from Master to Slave.

While on the Render subject there is also a project that uses HTTP to do the work.  One difference is that you download a script for master and then a script for client.  It has different requirements and one is it does not need Java.
http://columbiegg.com/httpov/