Some thoughts on what I learnt about programming this week. First when I started programming in rails, the challenge was to understand the syntax and semantics and how to use them in the problem. But now that I am fairly decent in working on Rails, the next challenge that I encounter is how to code better. There are different definitions of better code. Have you ever seen the source code of some of the popular gems in rails? When the documentation of a particular gem is not available and you have to search through the source code to look for the methods that help you solve your problem, the first thing that is easily noticeable is the comments that lie above every method describing the use of the function along with the one or two examples that help understand the description better. Also the comments are so succinct and concise that you look at them and you know how to use them. 



Secondly comes modularization and naming. The names give the impression that they are easy to incorporate in your code but my experience says that they are one of the challenging aspects of programming. In OOP, modularization strategies are available in bulk but the challenge is to know each strategy when need arises and how to choose one over the other. Firstly it is indispensable to know the programming concepts to its smallest detail. Then only one make sound decisions on which to use where. Secondly, if your code is too big, divide into segments in such a way that you, along with any programmer can just look at the code and understand its functions in and out. Also the method names should give an idea of the underlying operations performed. Every functions written should be as independent as possible. By independent, I mean that they can be used anywhere in the module without thinking on what dependences should be taken care of along with it and what side changes should be done to the structure to incorporate that function.