dark mode light mode Search Menu
Search

Programming Mistakes Beginners Make

Oakley Originals on Flickr

For beginning programmers, the shift from what you learn and do in a classroom to what you do programming an application outside of school is an adjustment. Here are some ways to tell if you’ve made the shift from school to real life programming.

Do you read code? When we’re little, we learn to read before we learn to write. The same applies to programming. Reading code is as important as actual coding. Reading code lets you see how other people think about a programming problem and how they solve that problem. Reading also lets you understand how your code fits in. You might re-use a function, object, or library instead of wasting time reinventing the wheel.

Do you copy/paste code from search results? It is acceptable to use internet search engines to find code. However, if the code works, beginners move on. If the code fails, they search again. In both cases, new programmers won’t stop to understand how the code works, or the reasons the code didn’t work.

Are you up on the latest trends? Programming has fads like any human activity. A steady consistent style of writing and documenting your code is more important than using the latest style. If you work in a group, you will learn the style everyone uses. Or set a common style if you’re the only one working on your project (which is rare). Whoever reads your code and maintains it in three years will thank you for your consistency.

Does too much code bother you? Less code is not always ideal. Readability, performance, and other factors might require more lines of code. The perfect three lines of code might use excessive computer resources. Or be unreadable and difficult to maintain. Look up ‘nesting ternary syntax’ online sometime.

Are you too eager to get coding? Edge cases are uncommon situations where your code might or might not work. Think of your code as a stereo speaker: what happens when you turn up the volume all the way? A speaker might vibrate and shake then fall apart. Code often works the same way. Beginning programmers might not think of edge cases when they sit down to read and write code. However, edge cases can reveal insights into the best way to organize a software solution. Identifying as many useful edge cases (and corner cases, boundary cases, and base cases) as possible gives you confidence your code can survive.

Do you hate to write lousy code? Perfection is useful but wildly overrated. Perfection is a goal you strive towards but never reach. Readable code that works and doesn’t overuse computer resources is superior to spending weeks in search of the simplest cleanest code. The flip side also is true. Writing a dozen lousy versions of code to find the most workable solution is not time wasted. It might be hard to write lousy code that partly works. But it can be worthwhile if the result is good readable code.

Do you know everything? In any profession, beginners almost always feel they know vast amounts about their profession. Programmers with years of experience know how little they know. The joy in programming is found in learning what you don’t know then filling in the gaps of your knowledge as you work on projects.

Other programming behaviors that beginners tend to avoid (or adapt to) include use of odd variable names, too many if/else statements instead of other solutions, a fear of arrays and other useful language constructs, the need to test thoroughly, and the many joys and techniques of debugging code.

Programming is a journey. It’s a mix of reading, coding, and talking with peers. Your first coded solution might work but only address some of the requirements. The second or third try likely will be more effective if you reread the requirements each time you circle back to find the ideal code and talk with others on your team to get their ideas. Each attempt gets you closer to a more thorough solution. Each attempt gets you farther away from what you learned in school and closer to what makes programming interesting and fun.

Learn More

How do you spot a beginner programmer?

https://www.quora.com/Programming-how-do-you-spot-a-beginner-programmer

What are the programming mistakes most inexperienced programmers make?

https://www.quora.com/What-are-the-programming-mistakes-most-inexperienced-programmers-make

The Ternary Operator: Usage and Examples

http://www.dnawebagency.com/ternary-operator/

Edge Case, Corner Case, Boundary Case, Base Case

https://en.wikipedia.org/wiki/Edge_case
https://en.wikipedia.org/wiki/Corner_case
http://programmers.stackexchange.com/questions/125587/what-are-the-difference-between-an-edge-case-a-corner-case-a-base-case-and-a-b


Related Posts