Opinions

7 bad programming practices every programmer needs to be aware of in order to avoid them

1. Speed kills. 

Write your code carefully, debug it, integrate it, refactor, optimize and repeat.  The challenge is quality, not quantity.  Software engineering requires skilled craftsmanship.  There is too much crappy code being written daily in the world.

2. The lack of self-criticism. 

Being satisfied and contented with one’s code is a dangerous habit.  Take a major piece of code you wrote a few years back and if you cannot see how to improve it, you are not progressing forward technically.  Be willing to learn from others.   Learn to recognize, acknowledge and learn from your mistakes.

3. Contentment. 

Getting code to work is the lowest acceptable outcome.  One should always strive for clarity, simplicity, extensibility, modularity, predictable runtime behavior and scalability.   Code that has these highly desirable attributes is more stable, testable and maintainable.  If you’re any good, some future engineer will have the task of reusing your code.  Make sure this engineer has kind thoughts for you.

4. Using the first proposed design. 

There are many possible designs for software modules.  Solve the task at hand N different ways conceptually on the whiteboard.  Then critique each design in terms of pros and cons.  Then choose the optimal design with the best trade offs.  If you can only come up with one design you are not thinking hard enough.  Implement the chosen design.  Do not be lazy.

5. Cut & pasting code.  

This is a dangerous habit.  Crappy code propagates  with slight modifications like a horrible virus with deadly mutations. When the code has to be forklifted to retrofit the latest API some poor sap has to fruitlessly track down N random obscure hidden inline locations as opposed to one clean API interface (use an interface, function or class please).  IDE code refactoring tools should be used instead.  Less is more.  Create less code by refactoring, not more code. Adding more code by cut & pasting code is very evil creating an unmaintainable codebase.

6. Lack of attention to detail.  

Although coding requires high-level design and conceptualization, skills, it also requires extreme attention to detail as it is unforgiving. Code that is 99% correct is as nonfunctional as code that is 50% functional.  Code either works or it does not, approximate incomplete  solutions have no value.

7. Lack of ownership. 

Coding is a refined craft which requires pride of ownership.  If one is the original author of a software module, one should always being willing to improve it, maintain it and support it indefinitely.  Disowning code breaks the positive feedback loop for improving your skills using the complete software lifecycle.  Your code should have an infinite lifetime warranty honored by your sincere personal commitment.  Great code does not have an expiration or a use by date.

The answer appeared here first by Jeff Ronne in response to a question at Quora.

Sponsored
Quora User

Share
Published by
Quora User

Recent Posts

WhatsApp-Inspired Updates Under Testing in Google Messages

Google is exploring a revamped image-sharing interface in its Messages app, taking cues from WhatsApp…

10 mins ago

Create AI Video Backgrounds with YouTube Shorts’ Dream Screen

When it comes to online video streaming, YouTube is among the most well-known options. Every…

17 mins ago

Telecom Operators to Automatically Restore SIMs for Tax Filers

The Federal Board of Revenue (FBR) has introduced a comprehensive mechanism for blocking and unblocking…

2 hours ago

Trump’s Influence Fuels Bitcoin to Cross $100,000

Bitcoin broke the $100,000 mark for the first time on Thursday, driven by Trump's crypto-friendly…

2 hours ago

PSX Hits New Heights, Surges by 1,800 Points to Cross 97,000

On Thursday, the Pakistan Stock Exchange (PSX) 100 Index surged by 1,781.94 points, or 1.86%,…

3 hours ago

Pakistan’s IT Minister Defends Internet Restrictions: Here’s All We Know!

Shaza Fatima Khawaja, Minister of State for IT and Telecom, made it clear on Thursday…

4 hours ago