# What should I do ?



## darkshadow (Sep 8, 2012)

Hello,

I feel that every FreeBSD forum member is part of my family, and I have to express my feeling to the family I love and belong to.

My company is trying to develop new project using Java, I try to learn Java but I hate it, I hate it is Object model, I hate the  JVM thing, I hate memory hugs, I hate slow performance.

I experiment and develop   using wide range of languages like c, c++, PHP, lisp, perl, tcl, awk, bash and I didn't hate any one of these, I found each has it is strong and weak points .

Don't get me wrong, I don't hate Object Oriented programing  as concept. I found useful in some area and I even spend a lot of time in the past reading and trying Object Oriented design methodology and patterns as part of my study/work as software engineer.

should I surrender and leave, or what should I do ?


----------



## NewGuy (Sep 8, 2012)

I have a few suggestions and I say these things as someone who has never grown to like Java either.

1. Every language has some good in it. You've already found most of the bad parts of Java, now try to find things you like about it. Safer memory management, for example. A large collection of easy to read object/function names, etc.

2. Assuming this project is a Java application, compile your Java code to run natively, rather than in the JVM. This will do two things for you, one allow you to skip the terrible JVM and (two) it should improve performance.

3. Give it some time. Often the things we dislike a lot at first turn into things we are either OK with or we find they don't matter enough to dislike them. In this case, as I mentioned above, compile your code natively and pretend you're coding in C/C++ (the syntax is almost identical). After a while you'll probably get used to the differences.


----------



## ChalkBored (Sep 9, 2012)

Do you have to use plain Java? 
What about a JVM dialect like Clojure since you've already got some experience with lisp? It doesn't really solve the problem, but it might make things tolerable.


----------



## Pushrod (Sep 9, 2012)

I work with a guy that did nothing but C++/Java for about a decade before being stuck on a project that uses Objective-C (iOS app). He hated it at first, but 3 months later, he is one of our go-to guys for Objective-C and actually really enjoys it.

It'd say step into the Java bubble and try to find some value in it.


----------



## SR_Ind (Sep 9, 2012)

If not for love of the tool, give Java a try for your careers sake.

That's what I did. Thankfully, being in charge of the product line my involvement is limited to solution architect support. I don't need to code. I've got some rookies to code a Web Service layer over our product using Java/J2EE. 

I hate the team discussions whenever J2EE issues come up. But at the end of the day I've a J2EE experience on my resume. In my industry (telecom) it counts.


----------



## plamaiziere (Sep 9, 2012)

darkshadow said:
			
		

> My company is trying to develop new project using Java, I try to learn Java but I hate it, I hate it is Object model, I hate the  JVM thing, I hate memory hugs, I hate slow performance.



I'm not at all a Java fan boy but I disagree. Java is not so bad.

The language is simple without surprises or tricks, it just does the job.
IMHO, the jvm is pretty good (full of optimizations, JIT compiler) and performs well. I don't think python, perl or ruby can perform better.

It has several good points: 
It is portable and you may be able to deploy and execute an application self-contained in a Jar file.

It has tons of ressources/codes available (most of the codes are in a free Apache 2 license (sometimes MIT), not a lot are GPL'd (which is bad)).

IDE are very good and well integrated with Java (I use Netbeans on FreeBSD, don't like Eclipse).

Try it.


----------



## UNIXgod (Sep 9, 2012)

plamaiziere said:
			
		

> I'm not at all a Java fan boy but I disagree. Java is not so bad.
> 
> The language is simple without surprises or tricks, it just does the job.
> IMHO, the jvm is pretty good (full of optimizations, JIT compiler) and performs well. I don't think python, perl or ruby can perform better.
> ...



I don't think anyone had an issue with the jvm. Closure was mentioned. jpython and jruby are used more or less in scale. There seem to a be a resurgence of functional programming languages which use the jvm nowadays. Pure java will become what assembler was to c.

Since you brought up IDE's I did play with Eclipse as my friend recommended it in interest with google's android docs. Ultimately I ended up back using vim and working off of a ssh connection to a server without X.

I did this tutorial which is one of the better ones for beginners:

http://www.greenteapress.com/thinkapjava/html/index.html

The "Think" series is a classic. They have many languages. Check it out.


----------



## Crivens (Sep 10, 2012)

Now for my 2cents.

I have to chirp in with all the rest telling you that java is not the devil incarnate. There are other languages which have more fundamental claims to that. Let me also point out some of the good parts of java/jvm which are not mentioned already: the ability to debug the code without building a new version, the ability to profile in-situo, you do not need to resort to evil hacks like in some other environments.

Also, you can kiss the good old wild pointer goodbye. Getting a core dump from a jvm from simply buggy code is not going to happen. Instead, you will be informed which array was stepped out of, where you did it and that the thing was stopped right there and then. Else you might end up hunting a bad memory reference which may have happend some time ago, seconds/minutes/weeks, whatever.

Also, you might read up on some of the fine details of the jvm and the hotspot features, memory management details for performance enhancements and then try to write something in java that is even faster than the C version. Yes, it can be done, take it as a challenge.

If all fails, take some vacation time to get some distance and check again if you really hate it or if that was the annoyance from something new on your desk. Then you still can ask your supervisor to assign you something else, and if that does not work you still can hand in your resignation. Rumor has it that some new assignment is then suddenly possible.

HTH


----------



## numpad5 (Sep 11, 2012)

I used to hate java and jvm up until about version 6 of the java platform, when I picked up my first programming books on it and also discovered an open source graphics program called Art of Illusion.

After reading up on the basics of java language and becoming a big fan of Art of Illusion I have learned a respect for it.

The main problem is that there are too many "java hobbyist types" kind of like "linux newbies" that give java a bad name or program it improperly.

Also, version 6 and up introduced plenty of improvements over the older versions and that helped gain my respect as well.

For example, in gui apps there are now opengl and directx pipelines for the graphics in some cases.

Sure you probably don't want to try making a huge low level app in java, but I have come across many java gems in the form of free programs that are surprisingly good.  The only problem most have is that they run out of memory too fast because of large data structures or something.

As someone else said, the standard library that comes with the SE version is loaded with more functions than you would ever need or hope to study documentation on.

If your app doesn't need realtime reaction and has gui stuff or can rely on alot of the library functions included in SE then it really isn't a bad way to go.

Even some stuff that uses realtime reaction, more like videogames and less like nuclear reactors, can benefit from its workflow.

Don't let the "java hobbyist" guys I mentioned before who code overly complex just to show off ruin it for you.


----------

