Let me recollect not very recent past. It was 2008 and recession was at its peak. Back then, I was largely a self-taught developer and had a working knowledge in struts & ejb (the java heavyweights at that time). After unsuccessfully trying to yield a job, I finally decided to pursue my masters in computer applications (out of necessity, or so it seemed back then).
During this frustrating period, I heard about Ruby On Rails, which was touted as the next-gen platform/language. As with other people, I was quite scared of it as the name sounded very unfamiliar. So, I didn't pursue it. However in the summers of 2009, as I was idling across the netbeans.org looking for some interesting activity to do, I came across this '5-minute Weblog' exercise on rails and decided to have a go.
Believe me, it was one of the turning point in my career and I spent more than an hour figuring out exactly how I was able to generate a web application just like that using practically no big tools.
As the things turned out, I was not the only one who leaded this entirely new approach. During a recent magazine interview(http://www.pragprog.com/magazines/2010-12/chad-fowler-on-ruby), Chad Fowler, a prominent figure on Ruby Conference and a ruby authority echoed similar views.
During this interview, it was interesting to observe the maturing of ruby as a language and a platform (performance wise and lightweight for mobile devices).
My current job deals with java, however Ruby & Scala have kept my other side of programming (hacking & open-sourcing) buzzing with activity and with a healthy mix of curiosity and satisfaction.
Musings on computers and software as I continue learning and sharing software development knowledge.
Wednesday, March 2, 2011
Sunday, February 20, 2011
Increasing usage of Functional Programming in driving scalable architecture
One of the most exciting technologies that I've been pursuing lately is nothing new, but as an old wine in a new bottle, provides an alternative method to solve emerging issues for addressing performance. I am referring to Functional Programming, that has been growing in importance during some period in past few years due to various ongoing development in today's huge data processing applications used in enterprise environments. I've been seeing the rise of this otherwise academic language, and is increasingly used/considered to be usable for the past few years due to various ongoing developments.
Features
Functional programming provides various features that separates it as a different paradigm for programming( http://en.wikipedia.org/wiki/Functional_programming ). I'll be explaining various features as per this post's context.
Higher Order Functions : FP revolves around functions! Think of this as a small version of class in OOP. If you've worked with, say anonymous or inner classes in the past. You've unknowingly been doing FP in OOP, and needless to say, it was difficult to learn and maintain. Generics solve the same problem as First Class Functions, but the resultant implementation leaves a lot to be desired.
Recursion : Again a handy feature that provides a lot of bang for small amount of buck, or code! If you know how to use your functions, you can do a lot with your code without having to write boilerplate or plumbing code in your algorithmic implementations.
Immutability : Now this is what I am talking about! We all are familiar with multi-threaded programming, yet the tools for using it are hardly ever used as multi threaded programming involves sharing of resources, which is not a good thing. In all other programming paradigms, we are familiar with the foll construct :
int a = 0; Initialization at this line in the memory
Applicability in meeting the challenges in scaling and performance
Today's applications need to fully utilize the underlying hardware. Moore's law doesn't holds when we consider raw cycle performance, but is still applicable if we consider the overall increase in processing capability through hyper threaded and multi core processor hardware. The information generation and its processing needs has increased too, leading to use of parallel computations. This is where the FP comes in handy. Its true that infrastructure can be abstracted from the application (as with cloud platforms) but if we do that ourselves, we can have greater flexibility and scalability for our solutions.
One feature of many 'newer' breed of FP languages like F# or scala that are hybrid in nature that I haven't discussed before is the ease of use of these languages is the ability to construct Domain Specific Languages; DSLs. From the business' perspectives, DSLs are fast becoming key to map the technology-business divide and keep application agility and re-usability simultaneously.
My exposure these days is with scala, which is a hybrid FP language that runs on JVM, and is interoperable with java. It is attracting the same kind of curiosity for java developers right now which ruby (largely because of Rails) did a few years back. However, this language aims at scalability, which is also its full name (scala stands for scalable architecture) within the JVM itself, making it an ideal candidate for solving middleware performance and scalability related issues. The fact that it replaced Rails in handling message processing in Twitter speaks for itself. I am also working on a research paper that explains the use of scala (and FP in general) to process massive amounts of data in distributed/cloud environment. Will post some more information here as it gets finalized.
Features
Functional programming provides various features that separates it as a different paradigm for programming( http://en.wikipedia.org/wiki/Functional_programming ). I'll be explaining various features as per this post's context.
Higher Order Functions : FP revolves around functions! Think of this as a small version of class in OOP. If you've worked with, say anonymous or inner classes in the past. You've unknowingly been doing FP in OOP, and needless to say, it was difficult to learn and maintain. Generics solve the same problem as First Class Functions, but the resultant implementation leaves a lot to be desired.
Recursion : Again a handy feature that provides a lot of bang for small amount of buck, or code! If you know how to use your functions, you can do a lot with your code without having to write boilerplate or plumbing code in your algorithmic implementations.
Immutability : Now this is what I am talking about! We all are familiar with multi-threaded programming, yet the tools for using it are hardly ever used as multi threaded programming involves sharing of resources, which is not a good thing. In all other programming paradigms, we are familiar with the foll construct :
int a = 0; Initialization at this line in the memory
a = 1; Memory address pointed by a gets 'Updated'
The problem lies with the second statement as we don't know when and more importantly which thread is going to invoke it. But if you recall from your Mathematics, we used to have following notations there: let a=0 Initialize a
a=5 Assign a something new, and ignore previous state
As the value of a is immutable, we can safely have as many threads to it as we need. This means, as our applications are thread safe, we can have concurrent / parallel executions of the same code by 2 or 200000 invocations without adverse effects.Applicability in meeting the challenges in scaling and performance
Today's applications need to fully utilize the underlying hardware. Moore's law doesn't holds when we consider raw cycle performance, but is still applicable if we consider the overall increase in processing capability through hyper threaded and multi core processor hardware. The information generation and its processing needs has increased too, leading to use of parallel computations. This is where the FP comes in handy. Its true that infrastructure can be abstracted from the application (as with cloud platforms) but if we do that ourselves, we can have greater flexibility and scalability for our solutions.
One feature of many 'newer' breed of FP languages like F# or scala that are hybrid in nature that I haven't discussed before is the ease of use of these languages is the ability to construct Domain Specific Languages; DSLs. From the business' perspectives, DSLs are fast becoming key to map the technology-business divide and keep application agility and re-usability simultaneously.
My exposure these days is with scala, which is a hybrid FP language that runs on JVM, and is interoperable with java. It is attracting the same kind of curiosity for java developers right now which ruby (largely because of Rails) did a few years back. However, this language aims at scalability, which is also its full name (scala stands for scalable architecture) within the JVM itself, making it an ideal candidate for solving middleware performance and scalability related issues. The fact that it replaced Rails in handling message processing in Twitter speaks for itself. I am also working on a research paper that explains the use of scala (and FP in general) to process massive amounts of data in distributed/cloud environment. Will post some more information here as it gets finalized.
Saturday, January 29, 2011
My initial foray into professional software development – Experiences as a Developer
Its been a fortnight since I've started working full time in a professional software development firm and through this post, I am sharing my experiences. During this period, there have been a lot of revelations for me and many of my fears about work in an IT company have, needless to say, been allayed.
I started working with a small sized local software company that performs all the development activities for a UK based firm that sells products for converting mainframe legacy systems(IBM's i-Series) into modern ones(JavaEE based). Since this is solely focused business on software development, I was able to obtain various advantages that could've not been possible otherwise. Some of which are :-
No managerial bullshit about communication, teamwork & motivation (and what else the HR people can put in).
Simple product oriented workflow with flexible time lines.
A quiet workplace in the outskirts of the city (which is indeed a quaint place).
My only grouse so far (If I really need to proclaim one) has been long work hours (almost 10 hrs) which leave me with no time for outings and socialization on weekdays, but is fine by me as I am growing as a developer in leaps and bounds, and also because I am not much of a social fellow and all the other developers too are busy with themselves during work.
The technologies that I am working on are also my favorite and involve Enterprise Java (JSF, Hibernate, Spring and JPA). However, due to non proficiency in JSF, finally I am learning this framework. In the past, I've blogged against this framework and ever since 2007, have refrained until now in using this technology. The workplace requirements, however enforced this change and this is not as bad as I was imagining it to be.
The first day in the job was a huge eye-opener for me as I was handled a finished application to explore and document my findings. Upon seeing this massive piece of JEE mastery, despair set in quickly an I was beginning to feel panicked. Fortunately, I had done some open source development during my college years that proved to be quite handy for me (Just build the whole thing and unit tested it). By the end of the first day, I had some rough idea about that enterprise application that housed more than 100 JSF beans (that were integrated into similar number of service classes, DAOs, and other layers coupled with a complete in-house API that was stretching back to more than 10 years). To add my misery, the database was a DB2 instance running on AS400 platform remotely and was sluggish at the very best of the performance with no user manipulative tool at my disposal.
The subsequent days, surprisingly, eased this initial pain as I was informed by my boss that the application in fact was auto-generated by a in-house tool based on freemaker/velocity. Also, what was seemingly impossible one day, became reasonable the other and was accomplished on the third. For this success, I'll attribute to the long hours that I am putting at my workstation there instead of shying away from the problem, as the case was earlier.
However, before ending this, I'll sum up an excellent blog entry that I received quite earlier as a tweet:
Ingredients for a perfect technology workplace (read as IT)
Excellent people (Your boss & co-workers)
Excellent projects (That really stimulate you)
Excellent workplace (Or something similar, I can't recollect)
I started working with a small sized local software company that performs all the development activities for a UK based firm that sells products for converting mainframe legacy systems(IBM's i-Series) into modern ones(JavaEE based). Since this is solely focused business on software development, I was able to obtain various advantages that could've not been possible otherwise. Some of which are :-
No managerial bullshit about communication, teamwork & motivation (and what else the HR people can put in).
Simple product oriented workflow with flexible time lines.
A quiet workplace in the outskirts of the city (which is indeed a quaint place).
My only grouse so far (If I really need to proclaim one) has been long work hours (almost 10 hrs) which leave me with no time for outings and socialization on weekdays, but is fine by me as I am growing as a developer in leaps and bounds, and also because I am not much of a social fellow and all the other developers too are busy with themselves during work.
The technologies that I am working on are also my favorite and involve Enterprise Java (JSF, Hibernate, Spring and JPA). However, due to non proficiency in JSF, finally I am learning this framework. In the past, I've blogged against this framework and ever since 2007, have refrained until now in using this technology. The workplace requirements, however enforced this change and this is not as bad as I was imagining it to be.
The first day in the job was a huge eye-opener for me as I was handled a finished application to explore and document my findings. Upon seeing this massive piece of JEE mastery, despair set in quickly an I was beginning to feel panicked. Fortunately, I had done some open source development during my college years that proved to be quite handy for me (Just build the whole thing and unit tested it). By the end of the first day, I had some rough idea about that enterprise application that housed more than 100 JSF beans (that were integrated into similar number of service classes, DAOs, and other layers coupled with a complete in-house API that was stretching back to more than 10 years). To add my misery, the database was a DB2 instance running on AS400 platform remotely and was sluggish at the very best of the performance with no user manipulative tool at my disposal.
The subsequent days, surprisingly, eased this initial pain as I was informed by my boss that the application in fact was auto-generated by a in-house tool based on freemaker/velocity. Also, what was seemingly impossible one day, became reasonable the other and was accomplished on the third. For this success, I'll attribute to the long hours that I am putting at my workstation there instead of shying away from the problem, as the case was earlier.
However, before ending this, I'll sum up an excellent blog entry that I received quite earlier as a tweet:
Ingredients for a perfect technology workplace (read as IT)
Excellent people (Your boss & co-workers)
Excellent projects (That really stimulate you)
Excellent workplace (Or something similar, I can't recollect)
Friday, December 31, 2010
A paradigm mismatch ?
Here are my comment on an often repeating topic of conversation about 6th semester projects in Masters Of Computer Applications course. A lot of people are considering programming for web based applications aka websites for their last semester projects in MCA. Since this involves a whole stack of technologies, one can observe that it in turn, helps a person or more importantly, his mentor to hide a poor design behind this complexity.
Coming back to the topic, a lot of my friends and people from various coaching centers have certainly got preconceived notions regarding different technologies to code with as their server side programming language. However, one can observe the faint rumblings of faint but still existent religious fervor of 'my language is better than yours'.
To start off with, students try and then ignore Java as an alternative because it is too complex (It is a big pain, but then has its benefits) and huge for their web applications. However, this fear can be allayed by the fact that one can choose from a wide variety of frameworks(MVC like Struts & SpringMVC or component based like Tapestry or JSF) and technologies (a plethora of middleware tech.) within the java ecosystem itself. PHP is touted as a compelling alternative, but for me, the scripting approach only works for demonstrative purposes. Anything larger either needs a huge patience, or frameworks, which are immature so far in this platform. I really am not impressed by frameworks like Zend here to name a few. Microsoft .NET deserves a special mention because it is already baked in (with IDE & app server ready, for instance) as well as has a meaningful architecture(through code behind). However the very strength of this framework becomes its nemesis as students are not encouraged to question/hack into the innards of any tool used. The upcoming framework like asp.net MVC too represents a copied and chaotic exercise to perform something that is coming too late.
My personal outlook about the whole situation is that no single technology rules the roost. If you ask me, it is java for building middleware (business intensive) & expandable (one where you can fit in a lot of components/features) websites. Php is really cute as you get the time to play around with css & javascript based functionality around your site (After all, the data is the king and your site functions as its glorified frontend). If I require a lot of versatility as well as ease of development, I'll go for .NET as it really hits that sweet spot when you are willing to work inside the confines of the framework.
I had this discussion with myself a few days back in a moment of clarity as I was contemplating mine and others' 6th semester project for my MCA course. I specifically ignored Rails (and frameworks based on it) as one generally threads a safe line in our course. Researching and hacking into a shiny new technology and writing a perfect but undocumented & incomplete project would only lead towards its cancellation.
BTW, I had time to write all this stuff on new year's eve as tomorrow is my 5th semester ERP examination. So good luck for me and a very happy new year 2011 AD for my readers!
Coming back to the topic, a lot of my friends and people from various coaching centers have certainly got preconceived notions regarding different technologies to code with as their server side programming language. However, one can observe the faint rumblings of faint but still existent religious fervor of 'my language is better than yours'.
To start off with, students try and then ignore Java as an alternative because it is too complex (It is a big pain, but then has its benefits) and huge for their web applications. However, this fear can be allayed by the fact that one can choose from a wide variety of frameworks(MVC like Struts & SpringMVC or component based like Tapestry or JSF) and technologies (a plethora of middleware tech.) within the java ecosystem itself. PHP is touted as a compelling alternative, but for me, the scripting approach only works for demonstrative purposes. Anything larger either needs a huge patience, or frameworks, which are immature so far in this platform. I really am not impressed by frameworks like Zend here to name a few. Microsoft .NET deserves a special mention because it is already baked in (with IDE & app server ready, for instance) as well as has a meaningful architecture(through code behind). However the very strength of this framework becomes its nemesis as students are not encouraged to question/hack into the innards of any tool used. The upcoming framework like asp.net MVC too represents a copied and chaotic exercise to perform something that is coming too late.
My personal outlook about the whole situation is that no single technology rules the roost. If you ask me, it is java for building middleware (business intensive) & expandable (one where you can fit in a lot of components/features) websites. Php is really cute as you get the time to play around with css & javascript based functionality around your site (After all, the data is the king and your site functions as its glorified frontend). If I require a lot of versatility as well as ease of development, I'll go for .NET as it really hits that sweet spot when you are willing to work inside the confines of the framework.
I had this discussion with myself a few days back in a moment of clarity as I was contemplating mine and others' 6th semester project for my MCA course. I specifically ignored Rails (and frameworks based on it) as one generally threads a safe line in our course. Researching and hacking into a shiny new technology and writing a perfect but undocumented & incomplete project would only lead towards its cancellation.
BTW, I had time to write all this stuff on new year's eve as tomorrow is my 5th semester ERP examination. So good luck for me and a very happy new year 2011 AD for my readers!
Monday, December 6, 2010
The stuff behind the fluff – Is Green IT an exercise in vain?
Cloud computing is generally thought to be efficient, but this study changes it all. According to the recent UK study as published by DW World, cloud computing study reveals higher environmental impact than was previously thought. The quantity of the data centers as well as the consumers would collectively create this problem, which would be further intensified by the use of richer digital media. What this study surprised me was the analysis that it would be casual home users who would lead the excessive usage through rich media sharing/duplication.
In the past, Information Storage and Management used to focus solely on the enterprise specific needs. For handling the binary media format, technologies like CAS(Content Addressing Systems) are already in place. But according to this study, there would be a demand of 3200 Mega Bytes per person per day in just few years time. Given the pace of Internet proliferation and advancement, this is not a vague guess but a worrisome one.
The article pointed out the following courses of actions :
Creation of better/faster computers – This is really not possible as stated due to the lag between demands and Moore's Law
Green data centers – Again, here too the politics play an important role, BRIC nations in particular do have a cavalier attitude towards implementing clean sources.
What was missing here in my option was the point that the research was addressing the solution of the problem rather than its cause. So, instead of addressing the data storage issues, we need to rigorously safeguard against the redundancy in such data. Semantic web is one such approach. Other approaches such as tagging the digital media and having a single copy for identical media (different locations with same signature) could solve this problem. Also, instead of consolidization, the work on distributed computing should also be promoted.
The distributed computing can easily be done using map/reduce algorithms or through application development platforms like Apache Hadoop. The issue of data can be addressed using peer-to-peer data exchange as in bit-torrent. These wouldn't create problems themselves because of the ever decreasing costs of online bandwidth and its performance.
In the past, Information Storage and Management used to focus solely on the enterprise specific needs. For handling the binary media format, technologies like CAS(Content Addressing Systems) are already in place. But according to this study, there would be a demand of 3200 Mega Bytes per person per day in just few years time. Given the pace of Internet proliferation and advancement, this is not a vague guess but a worrisome one.
The article pointed out the following courses of actions :
Creation of better/faster computers – This is really not possible as stated due to the lag between demands and Moore's Law
Green data centers – Again, here too the politics play an important role, BRIC nations in particular do have a cavalier attitude towards implementing clean sources.
What was missing here in my option was the point that the research was addressing the solution of the problem rather than its cause. So, instead of addressing the data storage issues, we need to rigorously safeguard against the redundancy in such data. Semantic web is one such approach. Other approaches such as tagging the digital media and having a single copy for identical media (different locations with same signature) could solve this problem. Also, instead of consolidization, the work on distributed computing should also be promoted.
The distributed computing can easily be done using map/reduce algorithms or through application development platforms like Apache Hadoop. The issue of data can be addressed using peer-to-peer data exchange as in bit-torrent. These wouldn't create problems themselves because of the ever decreasing costs of online bandwidth and its performance.
Subscribe to:
Posts (Atom)