How to develop better software with best practices

MicroPyramid
3 min readMar 30, 2017

--

Writing good code is a habit that comes from mixing several approaches and changing practices by learning from your own experiences. And mostly its about thinking psemistic. There is no happy programmer because there are infinity ways to break your code, all you need to look for is to cover all the pit falls by following best practices.

Pre-Development

This is th crucial part because you have time to think before starting any real coding and it becomes impossible to change the modules if you start in a wrong direction. So, its always better to think a lot before starting. Think end-to-end implementation no matter how small or bit it is. Here is what I do,

  1. Gather all requirements from client regarding the work you need to do.
  2. Prepare requirement as a story to understand better. Don’t go to next step until you understand the requirement.
  3. Get domain knowledge to understand the requirement and plan development in better way.
  4. Think of development and server platform: Choose the best fit for the task to be done and be biased when coosing one. Never use what you know or you like, that could e a poor choince in the future.
  5. Thnik of software packages or modules: Choose what is needed for the work and choose good ones but not those with questionable future because it will become though to scale up or maintain.
  6. Prepare mitigation plan: Anything from database to payment gateway may go as discontinued or will release new version by making the old one obslete. You need to plan based on the software, modules and packages you choose to develop with.
  7. Refuse to do poorly designed system unless you get freedom to do it right.
  8. Most importantly, Reject unrealistic timelines: Unlealistic timelines will go bad in several ways as you may need to deliver unfinished or untested or buggy code. Finally it will ruin your reputation and relation with client.

Development

  1. First rule of thumb is to never trust what you get as input: Always valiade data you get as much as possible even if it seems useless. Not only data you get as input, even the data user request for is to be validated thoroughly. Most applications gets hacked because of poor validations.
  2. Never use coding techniques you want to learn and show off. Use whats needed and relevant. For example, my friend was writing all application logic in stored procedure and argued with me that it gives excellent performance boost and he had to write all that again in c# when we wanted to log all code changes.
  3. Write code as simple and readable as possible, this makes it easy to revise and review at a later stage. And you may be praised by developers who continue development after you.
  4. Don’t reinvent the wheel, use available software modules, packages.
  5. Always write test cases and those will give you headsup in case of any breaking code changes before your test team identifies.
  6. Last and most important one is to test what you do, test in each and every possible way you can think of to break and hack your app. Trust me this will ake your app rock solid in terms of security.

Post-Development

  1. Review your code for speed, stability, security, and usability.
  2. Monitor application performance.
  3. Monitor Server performance if you have to.
  4. Do rolling releases if you can.
  5. Revisit old code periodically and see what you would’ve done differently.

Let me know how do you achieve quality programming?

The article was originally published at MicroPyramid blog.

--

--

MicroPyramid
MicroPyramid

Written by MicroPyramid

Python, Django, Android and IOS, reactjs, react-native, AWS, Salesforce consulting & development company

No responses yet