编程新手常犯的十个错误

来源:互联网 发布:仓木麻衣知乎 编辑:程序博客网 时间:2024/04/26 22:20

http://efytimes.com/e1/fullnews.asp?edid=128604

10 Common Mistakes Beginner Programmers Make   Beginner programmers can easily fall prey to traps that are always laid for them. If you have just started, then watch out for these mistakes and be on your guard.   

Rate this news:   (0 Votes)
Friday, January 31, 2014:  When you start out with programming, it can be a daunting task. It requires a lot of practice and diligence and many often fail at it. What's worse is making the same mistakes over and over again. Here are a few mistakes that beginner programmers often make.
 1. Doubt: No, it is all right to have doubts about the language you’re working on. What is not all right is to doubt yourself and think that you’re not up to the task. A lot of programming languages can be daunting at first, but keep at it and you will get better soon. Codes often seem like something in a foreign language. Well, it is, until you keep practicing and make it your own.

2. Formatting: A very common mistake among beginner programmers is screwed up formatting. In fact, this is one of the easiest ways to differentiate a rookie from the experienced programmers. While some languages emphasise on the formatting, others, like JavaScript, do not. As a result, beginners often screw up the formatting of their codes, making them harder to understand by reading. 

3. Upper case and lower case: A rookie programmer often mixes up the upper case and lower case letter in their codes. For example, they could define a variable as Abc and then try to reference it using abc. Also, the weird use of upper case and lower case letters could make your programs look odd.

4. Function of variable names: It is important to understand that the names of variables and functions should always describe what they do. This makes it easier to understand the code. If you ever look at a Java programmer’s code, you will see that they use long and descriptive names for their classes and functions. 

Moreover, make sure writing the spelling of the variable name you choose are correct. 

5. Comments: Comments are good, they make your code easier to comprehend. But over-commenting is bad. When you’re starting out as a programmer, you are encouraged to comment as much as possible, but don’t make it a habit.

6. Knowing your language: This is not a mistake. You get to know a language only with experience. Knowing a language means recognising the full extent of its power by knowing the various operators and commands that can allow you to perform wondrous activities.

7. Frameworks, platforms, languages and IDEs: You must know how to differentiate between these. This is a very common problem amongst beginner web programmers. 

8. Debugging tools: This is actually a controversial topic. While some say that as a beginner you should lay off debugging tools, others say they are useful. Still, you must know what they are and how to use them. A debugger helps you spot bugs in the code that you have written.

9. Back up your work: When you’re worked for hours on end only to have all of it disappear because of some hardware or other issue, it makes you want to kill yourself. Why take the stress? Have a back-up tool handy whenever you’re coding.

10. Being a know it all: Very experienced programmers still admit that they learn something new every day. As a beginner you should be ready to learn, rather than being overconfident about your skills. 

0 0