程序员:提高编程效率的技巧
本文写给那些认为在项目上所花时间和效率成正比的程序员。我要说的是,事实并非如此。虽然你需要在电脑前敲键盘输入东西,但这只和编程沾上一点边。那么,程序员该如何利用时间呢? 俗话说,磨刀不误砍柴工,拿出一部分时间提升自己的技能,可以提高工作效率
本文写给那些认为在项目上所花时间和效率成正比的程序员。我要说的是,事实并非如此。虽然你需要在电脑前敲键盘输入东西,但这只和编程沾上一点边。那么,程序员该如何利用时间呢?
俗话说,磨刀不误砍柴工,拿出一部分时间提升自己的技能,可以提高工作效率。你可以参考以下几条建议:
1. 编写单元测试,提高效率(如果你还没有这样做)
这是一个十分基础的工作,但是许多程序员并没这么做。但你应该这么做。这样做不仅能够提高代码质量,还能提高工作效率。你不但能够在发布和修改你的程序时更加自信,而且还节省了相当多的时间。
试想一下,如果你正编写一个大型网络应用程序,其中一个小小的代码出现了差错,要修改它便意味着整个程序的重建、数据的重新配置以及特性的重新检查(而这个错误很可能隐藏很深)。再设想一下,你可能需要一遍又一遍地重复类似的事。现在,借助“单元检测”,就可以让你避免重复以往的修改/检查工作,可以节省很多时间。
2. 训练你的编程能力
这其实很容易。看看其他专业人员。板球队员通过“网上训练”提高技能。音乐家通过练习演奏来提升水平。歌手也需要不断通过练习改进。令人吃惊地是,绝大部分的程序员却不练习。但你需要不断练习。
阅读一些诸如《Effective Java》和《Design Patterns》等类型的书,并每天做些基础训练。从欧拉项目中找出些问题,然后 用你最喜欢的计算机语言解决它。
编者注:欧拉项目,一个知识检测网站,定期发布题目,提交正确答案即可进入关于该问题的讨论,学习题目的不同解法。
和你做的普通项目不同,这些练习没有时间限制。因此,好好安排利用你的时间正确地做事。通过这样的练习,你的工作效率将有很大提高。这是显而易见的,不是吗?
3. 使用并改进开发库
很多编程人员不喜欢用开发库。他们宁愿自己编写代码,也不愿意使用开发库。主要理由如下:
a. 他们不了解开发库;
b. 开发库里有很多他们并不需要的信息;
c. 相比于开发库,他们更容易掌握自己编写的代码;
不妨考虑下以下几个方面:
a. 开发库已经过严格测试,覆盖范围广,可以帮助你节约很多时间。如果你改进了开发库,你可以帮助很多人。
b. 但如果你仅改进你的私有代码,则不可能有那样的影响。
c. 最重要的是,其他同行也在帮忙补充开发库的信息,这可以间接地帮助你。
总而言之,除非开发库与你的要求太不相符,你最好考虑选择使用开发库。
4. 阅读代码和技术资料
阅读代码和修改/编写代码一样困难。在当今开源世界的情况下,可以参阅大量优质代码。选择一个你最喜欢的开发库,然后仔细阅读以充分利用里面的资源。或许你不能很快便理解所有的内容,但是通过不断的训练,你将能够区分其中使用的不同模式,同时把这些模式用到你的代码中。
除了看代码之外,你也可以订阅专业领域内优秀专家的博客,来获取最新趋势信息。
http://www.jobbole.com/entry.php/313

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to remove duplicate values from PHP array using regular expressions: Use regular expression /(.*)(.+)/i to match and replace duplicates. Iterate through the array elements and check for matches using preg_match. If it matches, skip the value; otherwise, add it to a new array with no duplicate values.

1. Programming can be used to develop various software and applications, including websites, mobile applications, games, and data analysis tools. Its application fields are very wide, covering almost all industries, including scientific research, health care, finance, education, entertainment, etc. 2. Learning programming can help us improve our problem-solving skills and logical thinking skills. During programming, we need to analyze and understand problems, find solutions, and translate them into code. This way of thinking can cultivate our analytical and abstract abilities and improve our ability to solve practical problems.

Python is an ideal programming introduction language for beginners through its ease of learning and powerful features. Its basics include: Variables: used to store data (numbers, strings, lists, etc.). Data type: Defines the type of data in the variable (integer, floating point, etc.). Operators: used for mathematical operations and comparisons. Control flow: Control the flow of code execution (conditional statements, loops).

Pythonempowersbeginnersinproblem-solving.Itsuser-friendlysyntax,extensivelibrary,andfeaturessuchasvariables,conditionalstatements,andloopsenableefficientcodedevelopment.Frommanagingdatatocontrollingprogramflowandperformingrepetitivetasks,Pythonprovid

C++ programming puzzles cover algorithm and data structure concepts such as Fibonacci sequence, factorial, Hamming distance, maximum and minimum values of arrays, etc. By solving these puzzles, you can consolidate C++ knowledge and improve algorithm understanding and programming skills.

C is an ideal choice for beginners to learn system programming. It contains the following components: header files, functions and main functions. A simple C program that can print "HelloWorld" needs a header file containing the standard input/output function declaration and uses the printf function in the main function to print. C programs can be compiled and run by using the GCC compiler. After you master the basics, you can move on to topics such as data types, functions, arrays, and file handling to become a proficient C programmer.

Tired of playing ranked? Then come and play ball! Teammates who cooperate tacitly can give opponents a taste of surprise! In the ever-changing battlefield, try to see how you can use your skills to break the situation with one move! "Eternal Tribulation" has launched a new team confrontation mode in the update on April 11. The following is an introduction to the "Eternal Tribulation" hot-blooded fighting ball activity. Overview of how to play the everlasting hot-blooded fighting ball: Use various means to bounce the fighting ball and defeat the enemy. Number of people: 9 people in single row, 6 people in three rows. How to play: Round: 1. The game is divided into multiple rounds. At the beginning of each round, Douqiu will be born in the center of the field and randomly select a player to chase. Players use various means to attack. The ball will speed up the fighting ball, and being hit by the fighting ball will deduct your stamina. 2. Each person in the single row has one point of physical strength each round, and each person in the three rows has one point of physical strength each round.

Error handling in Go includes wrapping errors and unwrapping errors. Wrapping errors allows one error type to be wrapped with another, providing a richer context for the error. Expand errors and traverse the nested error chain to find the lowest-level error for easy debugging. By combining these two technologies, error conditions can be effectively handled, providing richer error context and better debugging capabilities.
