Showing posts with label quality. Show all posts
Showing posts with label quality. Show all posts

Sunday, January 14, 2018

How to write high quality code?


Prohibited in coding(Haram Programming). Check if you are doing any of these.

•Writing a large function with even larger classes: Keep you functions below 30 line and you class below 200 lines. •Storing password in plain text in database: Always hash with a salt. Don't use MD5, it's compromised. •Returning a list from the server without paging: Use a page number and page size parameter. •Sorting or searching on the client side: Otherwise its sorts the current page only. •Querying more columns than needed: Slows down the query and increase data transfer to the client. •Not Indexing the Database: Makes your query super slow. •Not logging on Server side code: Without log when you code is deployed you will have no way to know what went wrong. Use a logging framework. •Not using dependency injection: Ensures decoupled maintainable architecture. •Not using source control: You cannot collaborate, leaves you at the mercy of your HDD. •Not localizing UI text: Makes your life hell when the customer says he needs it in German.

Collected from Linkedin post of Topu Newaz Sir: