It was only when someone told me that programming is difficult stuff, I thought of passing this piece of my learning to you all. There is a perception about "programming" that it is not everyone's cup of tea. Well, that is far from the truth, all that we may find difficult is - "coding"; all of us can program.
Wait! There is a caution here - Provided we know what we need to do. We need to be clear of the objective.
Programming language is nothing but a language that compilers understand. These compilers then make the processors understand. But for all that to work well, it's "YOU" who would need to understand. The definition of the problem and the desired output are all that it takes to get started.
At times, during your projects, you might feel like coming up with certain programs of your own, maybe to write a script file, a web component or a UI component. No matter what it is, the principle behind programming remains the same.
A few useful pointers that will always hold you in good stead are:
- Take the fear of "not knowing" the programming language out of your mind.
- Given a problem domain, analyze it and draw the tasks to be achieved programmatically.
- Never hit the keyboard and start writing the code right away. Always start writing the steps in your own language. In short, pen down your thoughts.
Write down the steps that would form the basic layout of the program. Don't worry about how to realize the steps into a piece of code. Steps that seem bulkier can be converted into function calls later. Initially, just assume that smaller functions such as calculateInterest(), findArea(), sum(), findAverage(), getConnection(), etc. exist.
Once the layout is ready, it's time to work on each step. People who know some programming language can now start coding in that language; however, others may have to rely on Google or other references to convert the step into programming language constructs.
Advantage: You can save a lot of time. You would know exactly what you are looking for in the vast pool of knowledge available about that language.
At the end of it, you will have the entire program ready in proper steps with bulkier steps present as separate function calls.
Now, it's time to create and work on smaller functions that we have in our layout. This is how one can build reusable smaller chunks of code, while the main body of the program is small, made of function calls, very readable and maintainable.
Advantage: By doing this, you divide your task into 10 smaller tasks. You can then easily concentrate on the smaller part of the problem by not worrying about the whole big task to be achieved.
Keep test cases for your program handy, i.e. sets of input and expected output. One must ensure that the program works fine by evaluating the output to the one desired.
Also, knowing a programming language thoroughly with the help of a standard book first is very essential.
Having said so, the sole intention of this piece of information was to convey that you should not hold yourself back from programming with an excuse that you lack a proper know-how of any programming language.
So, start programming... and you can catch up with coding on the way.