Coding the right way!
- You always feel difficulty understanding what doctors write, right?
- Ever found a code on the internet but found it difficult to understand?
- Exception Handling : Code in a defensive manner. Always consider the worst case scenario. Think about input failures, event handling exceptions. This would help keep a track of possible bugs and catch the exceptions.
- Enhance code readability : Writing highly optimized code and creating complex libraries is easy but consider junior developer trying to understand 300 lines of code. Which more of a challenge than learning. Code which is clean and modular reflects maturity, competency and professionalism of the developer. A code logically structured into modules and functions is always more readable, effecient and reusable.
- Minimize the memory footprint : Simple yet significant coding habits can change the performance of your final product. Memory management involves ways programmer / developer dynamically allocates memory to code when requested and frees it for reuse when not needed. Here are a few good blogs I came accross:
- Refactor your code : Restructuring your existing code without changing it's functionality. Aggregate groups of functions doing similar tasks into a single function, use of abstraction, deduplication of code and polymorphism.
-
Version Control : Tracking all changes and synchronization of codes, bug-resolve, managing changes to source codeover time. Basic, niche practice every developer should master. Git, GitHub, Gitlab, Mercurial are tools used for version control.
Code Testing : Isn't it nice when someone praises us after we dress up with a good outfit? Testing practices act just like that validation we need when code the functionalities of any software. It guides and shapes the development process of the software. Unit tests, code coverage and other testing techniques help maintain modular structure and good quality end-product.
-
KISS-DRY-YAGNI :
- “Keep It Simple, Silly” - keep your code as concise as possible
- "Don’t Repeat Yourself" - reducing repetition and redundancies
- "You aren't gonna need it" - Don't try to think far ahead in future and add complex bits of code features. You don't need it, you ain't gonna need it!
Top comments (0)