• Post Reply Bookmark Topic Watch Topic
  • New Topic

What was the Most Difficult Part of the Java Language for You?  RSS feed

 
Jordan D. Williams
Ranch Hand
Posts: 51
Android Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone...

I am going through the Java Tutorials and I was reading about Generics and I felt like my brain was going to melt! ... It seems like one of the most complicated things I have seen in Java. For all the seasoned developers out there, what was the most difficult part of Java for you to master? Why was it challenging? Do you have any tips for people on how to learn it better/easier?

Thanks for all you comments!
 
Paul Clapham
Sheriff
Posts: 22832
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the switch-case statement. Every time I want to use it (which is really not very often) I have to go and look it up to find the right syntax for it.
 
Steve Fahlbusch
Bartender
Posts: 612
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for me there were 2 difficult parts.

first i was shocked by how much i had to code (i.e.: how many lines of code i had to write to get what wanted.

that part was bad.

The other thing i found difficult was just how much i wanted to do was in the standard classes. this is what really
makes java special, the standard classes. we have them in c we have then in c++, we have them in c#, but
the java library is great.

this part was trying but wonderful.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generics are definitely one of the more difficult parts of the Java language to understand. I'm still puzzling to get all the generics right sometimes. Using classes or methods with type parameters is not that hard, but writing your own classes or methods with type parameters can become quite a puzzle.

One of the best resources if you want to know all the details about generics is Angelika Langer's Java Generics FAQ.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jordan D. Williams wrote:I am going through the Java Tutorials and I was reading about Generics and I felt like my brain was going to melt!

For me: GUI stuff (Swing/AWT), without a doubt.

First off: Don't like it; never have.
Second: The sheer amount of crap you have to write just to get a simple screen.
Third: The lack of basic useful widgets, like a labeled field.
Fourth: The Layout managers. Sheesh. When I started mucking about with GridBag layouts, I had exactly the same brain meltdown as you; and yet they still don't seem to cover basic useful stuff. Another GUI tool I worked with (a long time ago ) had a really useful feature called "colon alignment", where fields were aligned by the colons in their labels. Very nice for creating "form"-style GUIs. In Java? I could probably be faffing around until doomsday.
Fifth: There just seems to be an awful lot to know about in order to get nice flicker-free graphics, even in tough situations.
Sixth: Cut-and-paste. Aaargh. Who'd have thought that something that seems so simple could be so damn complicated?

Hopefully, it's better now than it was when I was ploughing through it. That BoxLayout seems to be a big improvement.

GUI rant over.

Winston
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The notion that you can create an object, call it obj, write obj.something(..) and something useful will happen.
 
Stephan van Hulst
Saloon Keeper
Posts: 7991
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the beginning, generics as well, but now I'm pretty familiar with what I can and can't do with it.

For me, multithreading and native interface are most difficult. Multithreading because I keep forgetting what changed between Java's old and new memory models, so I have to look up what assumptions I can make about concurrent execution.

Native interface is difficult simply because I don't have much experience with it. I should just practice.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:Generics are definitely one of the more difficult parts of the Java language to understand. I'm still puzzling to get all the generics right sometimes. Using classes or methods with type parameters is not that hard, but writing your own classes or methods with type parameters can become quite a puzzle.

For me too.
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Fourth: The Layout managers. Sheesh. When I started mucking about with GridBag layouts, I had exactly the same brain meltdown as you

Ah, that's where you were going wrong . For me, GridBagLayout is the last resort, to the extent that I'll sometimes write my own layout manager to avoid using it.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What’s wrong with GridBag? You only need to follow a decent tutorial about it.
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I first learned Java (ages ago) I remember streams really throwing me - the way you often wrapped multiple streams around each other. It seemed so much more complicated than the IO in other languages I'd used. Of course, I was only thinking of reading/writing simple text files - the breakthrough came when I realised that reading things other than text, and reading from things other than a file, were done in almost exactly the same way. So it was making the hard things simpler.

(It would probably have been generics if they'd been around when I learned Java).
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect they were running out of time, money, or both when they were developing Java, and had to omit generics, assertions, for‑each loops, etc, from their plans for the first release. Then you see how awkward it is to reintroduce generics later on.
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I come from Visual C++ world. So, generics don't confuse me conceptually. But, I always have problems keeping the syntax straight in my mind, and I have to look up samples. One day I'm going to break down and make a cheat sheet

The most difficult part of working in Java for me has always been the sheer amount of technologies available and having to choose between them. I came from Microsoft world, where there is just one way of doing something, and you just did it. The documentation was non-existent; the error messages were crappy, but once you learnt how to do something, you continue doing it unless Microsoft decides to make a major change. Java, OTH, has so many open source libraries, that keeping up with all of them is maddening. And, being able to choose between them is crazy. Usually, you go by something that your developers already know, unless you see something that makes things a lot more easier.
 
Rahul M Mishra
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I transitioned from C/C++ so it was kind-of different for me. I realize how easy it was for me to code and run program in Java, specially due to excellent IDE (I used Netbeans 3 to begin with and then moved to Eclipse), lots of API (life saver!) and every new version of JDK bringing more and better features for develpers. But what caused more problem was I/O probably because i didn't read enough to understand it at first. Generics and Threading was a breeze for me as I used C++ STL and PThreads extensively. I never used AWD / Swing and I am thankful that i didn't have to else that would be at top of my list. Second was using Collection API - I understood it but when it comes to implementating and practically selecting which one to use when - was the difficult part. I still remember mistakes of not properly implementing equals / hashCode and trying to figure what went wrong with my HashMap!

My only tip is to create "Hello World" programs for things that you are most worried about. Example: I created seperate application to test each File I/O API as well as Collection. Once you understand basics and little google to understand concept - rest will be fun. Most important is to attack the problem rather than trying to go away or ignore it. Do things that worry you most when you are learning
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:What’s wrong with GridBag? You only need to follow a decent tutorial about it.

Yes, I'm quite sure it's mostly me; I'm just not "wired" for GUI programming. Most other stuff: Streams, Collections, Threads...no probs (well, not too many); and as far as I'm concerned, Generics is great.

Winston
 
Jan Hoppmann
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to agree with Jesper here; using generics was pretty simple and straight forward for me, but writing my own generic classes isn't.
Besides that, I still have a hard time using Swing / AWT, or doing anything that results in anything graphical. Most of the tools I only wrote for myself use the command line for input and output.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayesh A Lalwani wrote:I come from Visual C++ world. So, generics don't confuse me conceptually.

Before I was using Java, I was a C++ guru, so I knew about templates in C++. With templates in C++ you can really do incredible mind-bending things, a hundred times more crazy than what you can do with generics in Java. The book C++ Template Metaprogramming is an interesting book about that subject.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!