16
Tips for Beginner Programmers 11

11 Tips for Beginner Programmers

Embed Size (px)

Citation preview

Programming jobs are in high demand, and the trend isn’t likely to slow down anytime soon.

With everyday products continuing to adopt technical knowledge (read: wireless toasters), even

old-school industries are on the hunt for talented programmers to join their ranks.

If you aren’t trying to make a living as a professional programmer, learning how to code can still come in

handy in any technology-related job.

Regardless of how use these skills in the future, be sure to make the most of your limited time and save yourself from future headaches by following a

few simple tips along the way.

You and your teammates should be able to read your code without having to decipher variable names.

Naming conventions

matter.

1

When working with an existing code base you should strive to make it difficult to identify who made the additions or changes.

Be aware of and follow company coding standards.

2

The best way to learn how to do something correctly is hearing how other people solved the problem. The old adage “two minds are better than one” exists for a reason.

Don’t be afraid to collaborate.3

If you say to yourself “I don’t have to program for that case, nobody will ever do that” you’re wrong -they will! Be sure to account for as many use cases as you can think of, after all, if you thought of it, someone else probably did too.

Remember real life users will do anything.

4

There’s a good chance somebody else has already solved it, so don’t be afraid to use their solution (with proper attribution of course).

Most problems aren’t unique.

5

When it seems like there are an infinite number of things to try, it can get in the way of creating something. Don’t let this stop you. In the beginning, stick with what’s essential and then build upon that later.

Don’t be intimidated by limitless possible solutions.

6

Decisions are often made with the data at hand, so it might only be valid for a few seconds. Also keep in mind it probably wasn’t a bad decision at the time, things can change.

Be ready to make adjustments.

7

This is, of course, assuming they both work equally well. You’ll thank yourself in a few months when you have to maintain the code you forgot you wrote.

When choosing between an “elegant” solution and a simple solution, choose the simple solution.

8

It’s okay to copy and paste a small block of code if you need to use it again in a different place. Once you’ve used that block a third time, it’s time to start thinking about refactoring it into a style that can be shared and reused. This concept goes the other way, too: if you’re not sure that a certain block of code will ever be used more than a few times, it might be simpler to just copy and paste it.

Always remember the “Rule of Three”.

9

Don’t be afraid to leave brief comments explaining why choices were made, it can be invaluable in the future. After a few months even the original writer may not remember why a particular solution was used. Avoid leaving comments describing ordinary or obvious behavior - they will quickly become outdated and misleading.

Code is not self documenting.

10

Like most things, the more you do it, the better you get.

Practice, practice, practice.

11

Learning to program is a valuable skill no matter your career path. Collaboration is important.

Be prepared to make changes. Simplicity is your friend.

Experts Exchange is here to help.

TL;DR

Live by Experts Exchange offers an instant connection with skilled programmers to help

with those inevitable headache scenarios.

Collaborate on code, get instant help, improve your skills.