Archive for December, 2006
Java on Multicore: Is definately good!
This is another new discussion topic in Java circle. To get the background for this post you would like this good article. This post has some great comments so don't miss that either. Followed by this and this article. There are different opinions about the topic. I studied Parallel computing & architecture as my graduate studies. So I would like to poke my nose in this topic.
This discussion is circling around GC threads and JavaEE threading model. Although experienced bloggers have already touch length and breadth of the topic, I would like to express my view in this regard. Operating system designers and architects thought a lot about Uniprocessor and Multiprocessor execution methods. There is huge literature present on these topics on public sources. But multicore techniques are relatively new.
Java scales very well on multi-processor servers from long time. Since multi-core is similar to multiprocessor in great sense, there should be increase in performance. Although as Billy mentioned there is GC bottleneck but, that is something can be worked out through JVM only. If JVM can utilize different processor for GC then why not different core?
In addition to that, there are very sophisticated parallel computing algorithms and utilities which may increase the performance by re-writing the existing application or designing new applications to work better on multi-core architectures.
This problem can be worked out and not impossible. If Java is having problem so do all the other monolithic applications which were designed by keeping in mind uniprocessor / unicore architectures.
And there is always option to use libraries like Pervasive Datarush and Javolution to increase application performance without bothering about details of architectures
Most ignored class of Java!
I am working with java for more than 5 years. From college to professional life, Java deserved an important position as a programming language. Recently I came across a conversation in my team. One of junior developer used ArrayList to store bean objects. To avoid duplicate objects in the list, he used a simple loop for comparing state of the beans.
I suggested him to use HashSet instead of ArrayList (but forgot to tell how HashSet works
!) He just changed data structure and came back to me with a complaint of HashSet not working!!! (This is true!
)
Then I suggested him to visit API doc for HashSet and then he realized that he also need to override equals() and hashCode() methods from Object class. But all this didn't stop there, he was not clear about implementing hashCode method despite of extensive API doc. It made me think about our ignorance of fundamentals.
Then I continued my search and conducted a short survey with my friends. There are total 11 methods in Java 1.4.2 version of java.lang.Object class. Most of them were not knowing how to implement hashCode() method. I am sure if they needed it badly, they will do as they are talented developers.
I found that people know complete Java Collection hierarchy, they know details of Vector class and Concurrency utilities. They know socket programming and design patterns but they miss Object class in major portion.
We tend to find other ways to implement the functionality which is provided by equals() & hashCode() by introducing extra loops or else. Now I don't wonder if I found few more highly ignored things from Java!
Do you know any similar ignored classes / interfaces?
Java: Not so stupid series
I always read the "Not so stupid questions" series on Java Today. It was becoming difficult for me to keep the questions list. Sometime, you need the questions list and you don't find it; don't you hate that? First thing came to mind was my blog! After all we are supposed to use these tools to organize our personal information; isn't it? Blogs were invented for that,so I thought to make a list as a post and let others find the entire list in one place.
I googled for stupid questions list but I couldn't find a single page enlisting all of them.
But this problem is not there anymore. You would like to bookmark this page for your reference
(Not So) Stupid Questions series:
Q 01: Should I try to declare more of my methods to be static?
Q 02: Some side-effects of String equality don't make sense
Q 03: Some uses of the private keyword don't make sense.
Q 04: I have no idea when to create a new package and what should go in it.
Q 05: When should I implement an interface, over inheriting from a parent class?
Q 07: There are some weird Java operators I don't understand.
Q 08: What's the deal with serialVersionUID?
Q 09: I'm attending my first JavaOne. What should I plan on?
Q 10: Other than bundling my classes, what good does a JAR do me?
Q 11: I have a question about a Java feature. Who do I ask?
Q 12: Can I use the 'Java' name in an open-source project?
Q 13: Why do constructors have to start with a call to super()?
Q 14: Why is if (true); considered valid Java syntax?
Q 15: How can a constructor be private?
At the time of writing this post, only 15 questions were available. If any additional questions are appeared, I will update the post.
Tagging blogs: Are we missing something?
Everybody is blogging! We get thousands of posts everyday and a wide range of topics and related information. I must admit that I can't even read all the information which I receive on "Technology" tag per day. There is so much to share and so much to read.
I came across Technorati page this morning
The tag "Foto" is in the popular list. What does that mean? I believe this word belongs to a non-English language. I found it very strange to see that tag. To help other people, there is other way, we can tag with "Photo" and "Foto" so the tagging is bilingual and other people also can find that very easily.
Tagging is the only way which make us reachable to post. We should tag nicely. Who would like to give me some guidelines of tagging your posts? Please share your comments.
Need for Speed: Carbon – What’s next?
Need for Speed: Carbon is the latest release from EA. This game is way ahead of its predecessors in physics and modeling. The stunning graphics, great music and nicely arranged plot made my day.
I have been playing NFS since NFS 2. Since then I played every release and my all time favorite is Need For Speed Porsche Unleashed. That game was something really stunning graphics, Porsche theme and way too real than its competitors!
I was wondering, what will be the next version of NFS: Carbon? If we see the trend of games, it can be categorized as follows:
- NFS 2 - Plain racing
- NFS 3 - Pursuit
- NFS 4 - Racing with better physics and realism
- NFS 5 - Theme based game (Porsche lineup)
- NFS 6 - Pursuit (Reloaded version of NFS 3)
- NFS 7 - Underground theme
- NFS 8 - Underground theme reloaded in much better way
- NFS 9 - Mix n' match of pursuit and career mode
- NFS 10 - Underground theme revisited again with strong pursuit and territory based career mode
EA has always tried to put new race modes and latest cars. A constant effort to make NFS more than just racing can be observed in previous games. So what can be the next theme? I think a more realistic betting could be another option. Player earns and bets in racing. If you loose all the money, you are out of the career mode and your cars will be lost.
The customization is the key now. Autosculpt in NFS carbon has done a great job. NFS carbon was having many other things such as crew members and some racing modes. I miss drag racing though!
What you think?

