Archive for the ‘learning’ Category

7 Steps To Write Code in Any Technology

Warning: This is a long read so bookmark it if you have less time.

More often than not, we are in dilemma of whether we write a long winded code in a familiar language or write a short crisp code in a new language. Time is limited and we have to decide as quickly as possible. On most occasions, we go with the known as the risk is lesser and you know you can slog it out to get to the finish line. But hey, you are missing big time on something. You lose an opportunity to learn. You lose an opportunity to display your flexibility and versatility to switch over to a new technology and finally you are categorized into an expert of one arcane technology and loser in any other field. In the tough times, we are in this becomes one factor which decides on whom the axe should fall. So keeping this in mind, I am writing a few steps that helps me in changing technology as quickly as I want to.


Step 1: Make one technology your mother tongue.

Learn everything that is there in the technology. As part of engineering this baptism generally happens in C / C++. Preferably, learning C and C++ together has its benefits. You are introduced to C first which is structured oriented language and thus learn the flow of logic and simple snippets of code. When you move to C++, there is paradigm shift happens and suddenly you face with more powerful object oriented programming model which is essentially a bottom-up approach. As you master C++ and its fundamental concepts, the primary tenets of technology gets ingrained in your mind. I have given example of C/C++; however mastering any technology would make your path easier in learning other technologies.

Step 2: Learn the concepts of technology you need to write a code in.

After mastering the first technology, you are faced with a challenge to write code in another technology. The first thing to do is learn the fundamentals of the technology. Find out whether it is object oriented programming model, or simple scripting language, the reasons why it is powerful in its own areas, what was the primary reason of its existence and so on. This will align your thoughts in finding ways to tame this new beast. This is the part where lot of reading is required.

Step 3: Write a “Hello World” program.

Yes. No matter, what you do, when learning a new technology, learn to write a hello world program. There are specific reasons for it. One you will learn basic printing statements, the beginning and end of the programs, syntax and how to run the main program. It also gives insights into the types of ide available, common errors that you make, and how are going to view the results. Also it is advisable to hand-code the hello-world program rather than a simple copy-paste. The compile time errors resulting in this will give you sufficient practice in resolving simple issues that come with writing code for the first time.

Step 4: Find a way to validate your output as quickly as possible.

We human beings want instant results. Unless we see that we are progressing we soon lose interest.  So write incrementing piece of code with little print statements thrown about. This will give you an idea whether you are progressing or not. It is extremely disheartening when you have written some 100-200 lines of code and suddenly seeing nothing happening. You then miss your mother tongue badly. You start bad-mouthing the new technology and you boss and co-workers who are making you do this. So learn to validate incremental progress. This process is slow but the constant feedback and little wins will give you the necessary feedback to stay at it.

Step 5: Use Google appropriately.

Googling for solutions is the best way to keep progressing. It also gives you different solutions to similar problems. Sometimes certain solutions might not be needed in your case but at a later point of time you will see the need of that solution. Moreover, the more you spend time on Google; you will find right keywords to use to get to your solution faster. As you go through the solutions, you will also learn different concepts presented in different solutions. This will improve your understanding of the new technology as you code more, your grasping of the technology increases.

Step 6: Learn to test your code.

Most of the code we write are copy-pastes from Google at least when you are writing it the first time. However, when you have written the code, learn to test your code as much as possible. Some of the solutions on Google might not be as robust as your application needs. So there is a good chance of it breaking in production.  Additionally, the more rigorous your testing is the more issue it uncovers and the more you fix issues, you start getting firm understanding of the technology.

Step 7: Finally solve other business problems with your new prowess in technology.

Try solving smaller problems which might take a day or two to write. As they say, you can become an expert of anything if you do it 10,000 hours. But you will learn in a fraction of that time. So go ahead, write as much code as possible and suddenly you find people coming to you for solutions in the just learned technology.

PS: Do chip in with your quick tip in the comments box. Personally, I have learnt Java, Perl, Groovy, Javascript,PL/SQL using these techniques apart from the host of tools that I have learnt as part of my different projects. So do have bit of experience using this technique and it has evolved over a period of time. 🙂

%d bloggers like this: