Become a Better Programmer: 5 Essential Methods at a Glance
Tags: webdev, productivity, programming, testing
Published: 2021-01-27 08:35:21

## 1. Unit Testing
__Why?__ Every programmer has experienced something like this: you change a bit of code in one corner, and in a (seemingly) unrelated corner, something breaks! The bitter truth is: both new and changed code will inevitably contain bugs. Use automated tests that help you keep old code stable.

__Keep in mind:__ You can also go one step further and write tests _before_ your actual code. This can give you a whole new perspective on how to approach problems!

__Read more:__ XP on [Unit Tests](http://www.extremeprogramming.org/rules/unittests.html) and [Test-Driven Development](http://www.extremeprogramming.org/rules/testfirst.html)

## 2. Code Review
__Why?__ Code that is ever only seen by a single programmer in your team is dangerous code: if that person gets sick or leaves your team, no one knows how this piece of your software really works. Additionally, no matter how great and experienced that developer is: it might be that he overlooked something, implementing only the second best solution.

These problems can easily be avoided by always having team members approve each other's code. It's both a quality control as well as a means to create collective ownership of your project's code.

__Keep in mind:__ If pair programming (see below) is already an integral part of your workflow, you might not need additional code reviews!

__Read more:__ Code Review on the blogs of [IBM](https://www.ibm.com/developerworks/rational/library/11-proven-practices-for-peer-review/) and [Jeff Atwood](http://www.codinghorror.com/blog/2006/01/code-reviews-just-do-it.html).

## 3. Pair Programming
__Why?__ Pair programming is an ideal tool to share knowledge in a team. Having a junior and a senior developer sitting side-by-side is the best way for the junior to learn. And since teaching is a great way to sharpen your own skills, even the senior can benefit.

__Keep in mind:__ Make sure that each person gets in front of the keyboard on a rotating basis. It shouldn't become a "I teach, you listen" event.

__Read more:__ XP about [Pair Programming](http://www.extremeprogramming.org/rules/pair.html), Martin Fowler on [Pair Programming Misconceptions](http://martinfowler.com/bliki/PairProgrammingMisconceptions.html), WikiHow on [Pair Programming](http://www.wikihow.com/Pair-Program)


## 4. Keep it Simple
__Why?__ Planning for the unlikely makes code unnecessarily complex. Don't try to foresee your project's requirements in two years from now - too many things can (and __will__) change! You would waste time on an overly complex solution for a problem that proves to be different than you thought.

__Keep in mind:__ Keeping it simple shouldn't be confused with "quick and dirty". You still have to work thoroughly and carefully!

__Read more:__ [KISS](http://people.apache.org/~fhanik/kiss.html) on apache.org


## 5. Design Patterns
__Why?__ At its core, most programming problems belong to one of only a few general categories. These general problems have already been solved thousands of times - and are well-documented in a couple of "design patterns". Step back from the problem in front of you. And you'll be able to apply a proven best practice instead of reinventing the wheel.

__Keep in mind:__ Applying design patterns shouldn't become a religion. Sometimes, all that's really necessary are a few lines of simple code...

__Read more:__ A classic [design patterns book](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612), [A beginner's guide to design patterns](http://net.tutsplus.com/articles/general/a-beginners-guide-to-design-patterns/) on net.tutsplus.com


## (Bonus) 6. Version Control with Git
__Why?__ Git and version control are often underestimated: being proficient with Git has the power to make you a better programmer - and help you build a better code base!

__Keep in mind:__ Git is about more than just "commit, push, pull". Take its many "undo" features and you'll quickly understand how helpful it can be!

__Read more:__ A completely free online book on [Learning version control with Git](https://git-tower.com/learn/git/ebook/?utm_source=devto&utm_medium=guestpost&utm_campaign=become-a-better-programmer) and the [First Aid Kit](https://git-tower.com/learn/git/first-aid-kit/?utm_source=devto&utm_medium=guestpost&utm_campaign=become-a-better-programmer), a series of short videos on how to undo mistakes in Git.

[![wv1tlckw577joxxkemdw](https://dev-to-uploads.s3.amazonaws.com/i/4kxu1socpgz8h1aqdsln.png)](https://git-tower.com/learn/git/ebook/?utm_source=devto&utm_medium=guestpost&utm_campaign=become-a-better-programmer)