15 Programming Tips for Nepali Programmers
I just completed my college classes and through all these years of studying I always wanted some tips how to make my projects even better and how to make programming easier. I went through lots of books and blogs searching for tips and tricks. And finally learned many good tips that really helped me complete my project. Now I want to summarize some of those tips which I explored were actually good enough to make my project a hit on final. So, this is me.
Let me tell you something. Why do you think we people want to be best in stuff of our interest? Obviously it is because of other people seeking our activities. These days who would want to do normal stuffs and be a normal guy. We all want to be a popular one, don’t we? So, what in good knowledge could be more fun than letting others to go through your findings?
Yeah, if you are planning to release closed source programs, then why make it better as you would be only one to view your code. But when times come for coding for open sourceprograms, you must have to follow better coding habits. You must probably know why I am telling this, don’t you?
Sooner or later, you will find yourself ready to invest some time to learn more about good programming practices, not only to please those who take a look at your code but also make it easier for you to read and understand even after some months have elapsed after your last editing.
Lots of extra talking, now let’s explore what might be the 15 best programming tips for Nepali Programmer.
#1. Be a good listener and at same time a good analyst:
Listen to your instructor, supervisor or the one who have worked on similar projects for a long time. Gather as much as resources available for what project you are going to do. Ask questions and show your instructor you’re interested but don’t annoy the rest of the class with constant questions and meaningless comments. If you are to supervise your own group then be a good analyst and prepare yourself to guide your peers and work well with them.
#2. Make a good plan of what you are about to do:
Planning the development of an application should be much more intensive than actually writing the code if you are familiar with the language you are using. It is best to decide all of the components and libraries that you will be using before you start writing code so that you can be as efficient as possible by focusing on proper interoperability and reducing redundancy. This will definitely save you lots of time and money if you choose the right resources to leverage.
#3. Take references and resources (widely):
There are more than thousands of references and resources (I say it RR) online as well offline to help you work through your problems. At projects, you can take reference to your senior developers’ code, or ask them about your problems. You can often take reference from open source projects, it’s not that they always follow good coding habits, so don’t just blindly imitate them; choose only the good habits.
A part from that you can go through online tutorials, forums, where you would be able to find the help you need. Just remember it can take more than a few minutes for someone to help solve your problem so don’t wait till the last minute.
Google is there to help solve your queries, big time.
#4. Divide and conquer:
Best habit of programming which makes it easier in defining processes on system is dividing the system by the functions, classes and objects that are supposed to take part on the system. It can help to share ideas and knowledge among the group according to the expertise you hold. But don’t abuse idea of object-oriented programming architecture. I said it because, many beginners read some information about OO and suddenly the class diagrams to their simple applications look like the Dharahara (Tower).
#5. Validate and Sanitize Input:
Validate input from all untrusted data sources. Proper input validation can eliminate the vast majority of software vulnerabilities. Be suspicious of most external data sources, including command line arguments, network interfaces, environmental variables and user controlled files.
User input is one of the most cunning problems you would have to take care of. The PHP programmers among you are the ones that handle this problem all the time (hopefully). Remember that a user can be a security knowledgeable person who can compromise the security of your application. Escape variables, predict and most importantly limit possible user input in your programs.
#6. Comment your codes:
Probably every one of us Computer Students must have heard this more times than we have heard our own name. Unluckily, it is true. Making a habit of commenting your code will definitely help saving your day and even your partners who will have to read your code. There will come a day when you need to reuse old codes for a new purpose. Bet me! Without proper commenting you could not do that easy.
#7. Work hard to make it simple:
Keep the design as simple and small as possible. Complex designs increase the likelihood that errors will be made in their implementation, configuration and use. Additionally, the effort required to achieve an appropriate level of assurance increases dramatically as security mechanisms become more complex. Add as much user interfacing components as possible, use programming Languages such as Visual basic, VB.Net which supports visual interfacing.
#8. Make use of Pen and Papers:
While going through large projects, don’t just start like eating noodles from bowl or you are going to make it harsh. Use pen and paper to make models for process and data flows. You must have additional knowledge of Data flow diagrams, ER diagram and similar process models. You can also use some computer tools to make these models.
#9. Use Unicode characters:
Unicode standardizes the characters for the world’s writing systems to a uniform model that promotes transferring and sharing data. Programs developed using such a schema maintain their accuracy because each character has a single definition (i.e. a is always U+0061, % is always U+0025). This enables corporations to manage the high demands of international markets by processing different writing systems at the same time. Also, all characters can be managed in an identical manner, thus avoiding any confusion caused by different character-code architectures. Moreover, managing data in a consistent manner eliminates data corruption, because data can be sorted, searched and manipulated via a consistent process.
Another advantage of the Unicode Standard is portability (i.e., the ability to execute software on disparate computers or with disparate operating systems). Most operating systems, databases, programming languages and Web browsers currently support Unicode. Additionally, Unicode includes more characters than any other character set.
#10. Practice defense in depth:
Manage risk with multiple defensive strategies, so that if one layer of defense turns out to be inadequate, another layer of defense can prevent a security flaw from becoming an exploitable vulnerability and/or limit the consequences of a successful exploit. For example, combining secure programming techniques with secure run-time environments should reduce the likelihood that vulnerabilities remaining in the code at deployment time can be exploited in the operational environment.
#11. Learn Good habits of testing:
A good test has a high probability of finding an error. To achieve this goal, the tester must understand the software and attempt to develop a mental picture of how the software might fail. Ideally the classes of failure are probed. For example, one class of potential failure in a GUI (Graphical User Interface) is a failure to recognize proper mouse position. A set of test would be designed to exercise the mousse in an attempt to demonstrate an error in mouse position recognition.
#12. Handling errors:
It would be annoying if you or the users have to go through a return value from a function that is actually handled as a correct one through it is an error. You have to make a note about variables and their data types to be used, as it is the main reason behind usual errors. Beside that you may have to bind some variables with data store capacity and make proper use of Library functions. If errors need to be handled, you can write error handling codes.
#13. Learn how to Debug:
As a part of being good programmer you should have proper knowledge of debugging your programs (many don’t). It’s easy, when something weird happens, the only solution is to go through the execution of you program and analyze the state in which an error gets produced. Knowledge of assembly will be plus here, but side by side you have to understand important of data structure elements like the heap and stack.
#14. Be all-rounder programmer:
Programming is more than just C++ or Java. If you plan on programming for a living, you’ll need to learn the business side of programming. This includes things like systems analysis, databases, security, and documentation. Also realize that C++ isn’t the only language out there, you should be able to jump fairly quickly from language to language. Don’t get stuck in one language. Learn the basics of other languages including web based. In addition to code, focus on your humanities. Nobody wants to interact with a dull uncultured nerd. Take classes that interest you and will provide you with a good non-technical education as well.
#15. What else! Help others and practice more:
Teaching others is invariably one of the best ways to learn anything. It is understandable to think that you don’t have much to offer because you are relatively new to the development field. That’s nonsense. Remember, everything you know you learned from someone or somewhere; so try being the someone that another person learns from.
Last but not least, practice. The more you write, the better a programmer you become.
So, how often do you practice? I want to know some opinions of you programmers about your coding life.