Friday, July 25, 2008

How Ruby made me into a better Java developer

Like most programmers, I have had the pleasure of being exposed to multiple programming languages and frameworks. In some way all of these experiences have influenced the way I think about testing and challenging my beliefs about "good" design. After reading the Pragmatic Programmer for the second time, it occurred to me that this is happening because I...
Invest Regularly in Your Knowledge Portfolio
Make learning a habit. [Thomas and Hunt]
I started my career as an ASP classic VB 6 developer. Learning Java taught me that I should really think more like an OO programmer. It also exposed me to design patterns and forced me to realize that the code I was produced was actually a big mess. Java changed the way I was doing things. I started to use patterns like; proxies; late binding; interfaces; and factories. This greatly improved my ability to test production code and helped me reduce the outrages scriptlet code found in the web pages I was working on.
Then came C#. The transition from Java was not so difficult but I did learn more about delegates, data binding, event driven programming, as well as presentation patterns that were not MVC. It did not seem to make quite as much of an impact on the way I wrote Java apps. I did however find myself asking questions about how useful EJBs where and whether or not a DTO made any sense! I also longed for a "using(closableResource)" so that I would not have to write so many try/catch statements. MbUnit also really impacted the way I thought about testing and how refactoring test code was just as important as production code.
Then there are more complex things like SOA based applications using SOAP/WSDL and how it made me think about designing reusable components using better interfaces. I also learned a lot about how really useful adapters, bridges, and facades mitigate integration nightmares.
Now I find myself reflecting on how Rails influenced the way I approach Java Web applications and how it changed the way I think! So much so that the next few posts are going to be about:
  • Component/Integration Testing
  • Unit/Micro Testing
  • Test Driving UI
  • Using conventions in my configuration
  • Simplifying the way I use Hibernate
  • Using composite views with partials
  • Meta programming and annotations
  • Action mappings
  • Simplifying Models
I hope that you find the topics interesting and please do not be put off because I am writing about RoR. I am not one of those people who now hates Java and believes that Ruby is better, I am just a believer in learning and growing.

No comments: