Thursday, April 27, 2006

Young Heap [Info Blog]

The Java HopSpot VM uses a modified form of generational algorithms for garbage collection. Generational algorithms are based on two assumptions:
  1. Most program objects exist for a short period of time
  2. There are a few objects that exist for very long periods of time
Generational algorithms divide the heap into subsections, each of which represents a generation of objects. The young heap (or the subsection containing the youngest generation of objects) gets garbage collected most frequently. Objects from the young heap that survive a few rounds of garbage collection are promoted to an older subsection.

This algorithm is efficient because objects with the least probability for eing garbage collected are tested for their elligibility the least number of times. Also since some garbage collection algorithms involve moving objects (regardless of whether they will be garbage collected), this approach is faster because it moves fewer objects.

Tuesday, April 18, 2006

Continuous Learning

Learning continuously is imperative. Software professionals are in a field that is constantly changing. In order to provide effective solutions for clients we must keep up with changes in technology. Our learning must continue beyond university education.

However, due to work and personal commitments, many professionals may not be able to attend formal classes once they start working. We are fortunate to have the Internet at our disposal. It is a wonderful medium for sharing and gaining knowledge. Educational material on the Internet allows people to learn at a time and pace that is convinient to them. It enables people to adopt a principle of "continuous education".

Because a teacher is not present in front of us when we use the Internet as a learning medium, it is easy to stray away from the main topic. At times grasping a concept may be difficult because we cannot ask doubts to a teacher in real time. However these minor disadvantages are not very difficult to overcome. All that is needed is some discipline and lots of motivation.

These tips will help you become a better self learner:

  1. Make time for learning everyday. Even if you are extremely busy, make sure you dedicate at least 10 minutes of your day to learn something new. Ten minutes will not hurt, even in a very busy schedule, but they will go a long way in maintaining a continuous learning schedule.
  2. Do not get distracted by work or coworkers when learning.
  3. Adopt the practice of active learning. Do not simply read or listen to the material. Think about what the author is saying. Question the content and the assumptions. Make a note of your questions and first try to answer them yourself. This will promote analytical thinking. If you cannot answer the question, try to search for an answer on the Internet. If you still do not find a satisfactory answer, then post your question on an appropriate bulletin board.
  4. Answer other people's questions. Answering questions is also a very good way of learning. When you answer a question, you revise the concepts that you already know. The process of answering makes you think about a concept from a different perspective, increasing the depth of your knowledge.
  5. Write regularly. Writing is a very effective way of learning. You will be surprised at the results you achieve by devoting just 5 minutes to writing, everyday.
  6. Teach. Teaching is also a great way of learning. When you teach you again revise your knowledge. When students ask questions, very often you will think about things that had not occured to you earlier. Sometimes you may not know the answer to a particular question, in which case you might have to do reasearch to find the right answer. This process will increase the depth and clarity of your knowledge.
The Internet is replete with free learning resources. In fact there are resources to suit individual learning styles. For people who prefer reading there are articles, newsletters, and blogs. For those who prefer listening or a visual experience, there are podcasts, and vidcasts. Many people have also created excellent learning experiences with animations.

For discussing concepts and answering queries, there are mailing lists and bulletin boards. If you still miss real time interaction, you can start a study group with friends and colleagues.

I hope this post has prompted you to start the journey of conituous learning. I will post relevant resources in a future post.

Thursday, April 13, 2006

Is Java Too Bloated

Even though I have been programming in Java for several years, I am a bit displeased with the way Java and the J2EE platform has evolved. It seems like carrying a huge burden while programming, a burden that does not add much value.
Think of the amount of things we have to know while developing J2EE applications. For building a small application developers must be familiar with:

The Java language
The core Java API
JDBC
Servlets
JSP + Tags, EL
Struts (or another MVC framework)
Hibernate (or another OR tool or EJB's)

Learning these technologies takes a long time, but after learning one also has to keep himself updated on these technologies, and we know the rapid rate at which stuff changes in the Java world.

When we make a simple web based application, beyond the source code we deal at least with 3 configuration files; web.xml, struts-config.xml, and hbm.xml, not to mention the developer needs to know about packaging a J2EE application using jar, war, ear, ... files.

All this seems like way too much work to make small to mid sized applications. Sure the technologies have value, but the effort is disproportionate to the value recieved in terms of 'programmer productivity'.

Maybe we do need all these formalisms and specifications for large distributed applications, or maybe not. I am not sure, but I am sure that we do not need them for small to mid sized applications.

If anyone has had experience developing large distributed applications in a language other than Java, like PHP, Python, or Ruby, then please share your experience with us.