I think Java taught us two important lessons in the IT landscape and was thus very helpful to bring forward the state of art in programming.
The lessons come from both a success and a failure of Java. Now, while most people will agree on the positive lesson learned many people might not have realized yet the negative one which is equally (or even more) important though.
Without doubt, Java was the language which established Garbage Collection in the mainstream. Before Java, Garbage Collection (GC) was not taken seriously by most programmers and languages with GC were brand-marked as academic niche languages unsuitable for real world applications.
This has changed radically. Today, no new language without GC would be able to succeed anymore, so this positive lesson of Java was learned quite quickly.
The negative lesson learned from Java - at least for me - is that making multithreading too easy is not a good thing to do. At my first contact with Java (in the mid 90s) I was fascinated how easy it was to create new threads and that the language offered keywords to create monitors - i.e. synchronized objects.
But this initial fascination quickly turned into deep objection as I gradually found myself thinking more about possible side effects done by concurrent threads than the business logic itself. What Garbage Collection has achieved - relief the programmer from thinking about memory management issues so that he can concentrate on the real problems again - was counter-achieved by multithreading.
With more insight on concurrency problems I found that most - if not all - of my own Java programs were flawed with respect to concurrency in one way or another. And maybe worse - most of any Java program I looked at are unsound too from a multithreading point of view.
The temptation to use multiple threads is increasing further with the advent of multi-core CPUs. But we humans are not especially good in thinking about the countless implications concurrency can have on our code.
To bring back productivity to programming we have to accept the lesson Java has taught us and prevent the easy creation of threads in future languages. How to utilize the power of multiple core CPUs in this case will be on of the hottest topics in the coming years.
Cheers
Subscribe to:
Post Comments (Atom)
2 comments:
Hi marc,
I would like to get the continuations code, but i can't find your email on the website.
thanks,
michael
Hi Marc,
I think you have missed the whole point. Multiple threads, vector processing, systolic arrays and transistors on a chip help make things parallel and thus run faster than they would with a single threaded sequential program or circuit. Programming for such devices is hard and this is why Sun and Intel are working on frameworks or laguage constructs (like in Java) to make it easier. Without these things, most bozo developers wouldn't be able to create fast, efficient, multi-threaded / parallel code. - The Fake Steve Jobs has spoken!
Post a Comment