2

It is not YOU, it is Your Code

 2 years ago
source link: https://hackernoon.com/it-is-not-you-it-is-your-code
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

It is not YOU, it is Your Code

Software developers tend to play by the rules more often than not. But sometimes a code can be sloppy and disorganized and that doesn’t make anyone’s life easier. The root of all your problems lies in only a few bad coding practices. The Pareto principle states that 80% of consequences come from 20% of the causes, and 80% come from the causes of these causes. You can avoid a tangled web of programming source code by leveraging lightweight frameworks, implementing layers and giving unit testing some traction.
newsletters

Official account for all of the HackerNoon newsletters. www.hackernoon.com/u/newsletters

Photo by Nick Fewings on Unsplash

Coding practices may vary.

As a general principle, things work better when they’re done right.

This also applies to code. Software developers tend to play by the rules more often than not. However, sometimes a code can be sloppy and disorganized and that doesn’t make anyone’s life any easier.

According to the ubiquitous Pareto principle, 80% of consequences come from 20% of the causes. This means that the root of all your problems lies in only a few bad coding practices.

Below are 4 deadly sins of programming:

dFW9aLMnLpgfjylixlaQdWQLp2C3-lv13ouj.gif

Typos in Your Code

Spelling and grammar deficiencies can impact your overall programming skills.

There’s nothing more infuriating than showing off your work to your boss and seeing a spelling error.

It’s like waving a red flag at a bull.

One solution to this is to work on a decent integrated development environment (IDE) that has syntax coloring. Furthermore, you may pick easy-to-spell variables and function names just to be on the safe side.

Too Many Cooks

Let’s say, a team of developers works on a project over a few months or years. During this time everyone continues to ‘twist and turn’ the code and software design scope.

This, in turn, creates incomprehensive coding structures and GOTO statements that contradict with the code’s scopes and models.

You can avoid a tangled web of programming source code by leveraging lightweight frameworks, implementing layers, as well as giving unit testing some added traction.

Not Commenting on Your Code

Should a good code speak for itself? Only if you include comments.

We feel your pain. Nobody has the time and aspiration to narrate their code after hours of debugging or problem-solving.

Nevertheless, you shouldn’t leave your code without a translation.

Sometimes, what looks simple to you might look like a Klingon to other developers.

dFW9aLMnLpgfjylixlaQdWQLp2C3-o023osa.gif

Always write at least a one-liner to comment on classes, methods, and other parts of your work. You’re already testing the limits of your brainpower, so don’t make it any harder by not leaving reminders for later.

V123456

When you make a mistake in the original code and need to revert the changes, version control becomes a true godsend. Furthermore, let’s not forget the fact that the log history shows you exactly who else has played in the sandbox.

Have you ever:

  • Lost code or had an antiquated backup?

  • Had to keep up multiple versions of a product?

  • Wanted to see the difference between your code versions?

  • Needed to provide global access to your team?

Version control will get you covered any time you need recovery, coherent collaboration, or improved visibility. It’s an elegant tool for a civilized world.

Feature Flagging

Trust us, not using feature flagging when rolling out new functionalities to your users is the deadliest sin of them all.

With feature flagging, new features can be deployed without making them visible to users. Likewise, if you need data migration (for example), feature toggles will prevent your work from impacting the rest of the team or destabilizing the codebase.

dFW9aLMnLpgfjylixlaQdWQLp2C3-io33opy.png

Credit for the above piece goes to Tatsiana Isakova, Ellen Stevens, and Hang Ngo.

Subscribe to HackerNoon’s thematic newsletters via our subscribe form in the footer.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK