提高编程技巧的十大方法


摘要:本文为开发者总结了提高编程技巧的十大方法,为开发者学习编程加以点拨、指明捷径,有了技巧,在编程时能帮助你事半功倍。

【CSDN编译】本文为开发者总结了提高编程技巧的十大方法,为开发者学习编程加以点拨、指明捷径,有了技巧,在编程时能帮助你事半功倍。

1.学习一门新的编程语言(Learn a new programming language)

学习一门新的编程语言将有助于你开拓新的思维方式,特别是当你使用不熟悉的语言时,你将学习到很多种思维方法应用到语言中。而所学习到的新思维方式,你可以运用在你所熟知的语言中。甚至有时你会使用新学的语言进行你的重要项目。

提供学习经验包含: Lisp (Scheme is good), Forth, PostScript or Factor (stack-oriented programming languages), J (wonderful array programming language), Haskell (strongly typed purely functional programming language), Prolog (logic programming) and Erlang (concurrent programming goodness).

2.阅读好的且具有挑战性的编程书籍(Read a good, challenging programming book)

从书中你将学到很多,虽然实践很重要,但通过阅读好的且具有挑战性编程书籍是你改变思维方式重要的一步。这种具有挑战性的书籍包括The Art of Computer Programming、Structure and Interpretation of Computer Programs (SICP)、A Discipline of Programming or the famous dragon book。

当然,你可以选择一些难度较低的书籍,但要避免选择那些“傻瓜”书籍,即称能够在24小时或是21天内教会一切的书籍,从这些书中无法学习到提高编程技巧的内容。

3.加入一个开源项目中( Join an open source project)

加入一个开源项目的优势是什么呢?你可以和其他人(在私人项目中独自工作过)一起工作,当遇到不熟悉的代码时,你将会去研究,学习理解一个不熟悉的代码库(这应该是很有挑战性的)

4.解决编程难题(Solve programming puzzles)

你总是能够解决编程难题,在Project Euler中出现的数学问题,这或许就是代码难题中最流行的网站。

你应该试图去解决代码问题;程序员在编程过程中总是尝试用最少的步骤来解决遇到的难题,而在这过程中,你可以学到语言的更深奥和更特殊的功能,从而你会不得不思考代码的创造性。

5.计划(Program)

在编程开始之时,制定一个计划,拟定设计框架并实现它。并重复该操作。通过编写代码是学习代码的做好方式。

你将在错误中不断的学习、提升自己,相比于看书完成项目更加有激励性同时也带你带来更多的乐趣。

6.阅读学习代码(Read and study code)

学习著名的软件编程,如Linux kernel。学习教育的一个很好的操作系统是MINIX3。从中你可以学到很多新的语言用法,对软件架构能略知一二。虽然阅读不熟悉的代码比较困难,但你会受益很多。

通过阅读可以使你了解更多的API,或者是一门编程语言。

7.阅读一些编程网站( Hang out at programming sites and read blogs)

阅读不同的编程网站(如论坛和StackOverflow)将有助于你通过其他程序员获取知识。

同时,你应该阅读大量的博客,说起软件行业中博客写的好当属Joel,(尽管他现在不在写博客了,很多有价值的文章依然存在文档里)。Coding Horror and Lambda the Ultimate。

当然,news.ycombinator.com.也不错。

8.书写代码(Write about coding)

在博客上练习书写代码。你也可以在不同的问答网站上回答问题。同时你也可以写一些教程(DreamInCode)。在你编写代码时,你会想着要正确编写,为能够解释其中的问题和技术。编写代码还能够体现你的编程知识,提供你英语语法,这些在编程中都是很重要的。

9.学习基础的编程语言( Learn low-level programming)

学习基础编程语言,它们能够帮助你理解基层架构。比如C语言,或是汇编语言。

学习计算机是如何执行程序,知道操作系统是如何运作的,这是程序员最基本的要求。如果你想好好了解基础语言,你可以阅读有关电脑结构,操作系统,嵌入式系统,驱动程序操作系统开发等等的书籍。

10.有不懂得不要随便上StackOverflow,自己多想想!(Don’t rush to StackOverflow. Think!)

代码出错时,你可能会急于用最少的时间去解决它。你会怎么做呢?上StackOverflow网站吗?别这样做。要认真思考问题,拿出纸和笔,认真想出解决方案。放松大脑保持头脑清晰然后再重新看代码。

如果一小时后还没解决问题,再尝试StackOverflow。但要记得,首先要自己思考解决问题哦。

英文出自:10 ways to improve your programming skills



1. Learn a new programming language

Learning new programming languages will expose you to new ways of thinking; especially if the new language uses a paradigm which you aren’t yet familiar with. Many of the ways of thinking that you will learn can be applied to languages that you already know, and you might even want to start using the new language for serious projects as well.



Good languages providing a great educational experience (but not necessarily limited to that) include any Lisp (Scheme is good), Forth, PostScript or Factor (stack-oriented programming languages), J (wonderful array programming language), Haskell (strongly typed purely functional programming language), Prolog (logic programming) and Erlang (concurrent programming goodness).


2. Read a good, challenging programming book

A lot can be learnt from books. While practice is important, reading one of the really good and challenging programming books can be a great way to challenge your thinking and even move it up by a level. Such challenging books would include The Art of Computer Programming (if you want a real challenge), Structure and Interpretation of Computer Programs (SICP), A Discipline of Programming or the famous dragon book.



You can go with less challenging books as well, but avoid books that are “for Dummies” and will teach you something “in 24 hours” or “in 21 days”; you will get very little out of such books in terms of improving programming skills.


3. Join an open source project

What are the advantages of joining an open source project? You will work with others (good thing in case you have only worked on personal projects before), and you will have to dig into, and learn to understand, an unfamiliar code base (which can be challenging).



You can find different projects on sites such as GitHub, Sourceforge, gitorious, BitBucket or Ohloh.


4. Solve programming puzzles

You can always solve programming puzzles, and many such exist. Math oriented problems can be found at Project Euler, which is, probably, the most popular site for coding puzzles.



You should also try out code golf; a programming puzzle where programmers attempt to solve a given programming problem with the least amount of keystrokes. It can teach you many of the more esoteric and special features of the language, and you will have to think creatively about coding (and it is fun!).



Programming puzzles, mainly code golf, is found at codegolf.stackexchange.com.


5. Program

Start writing a program, from scratch. Design all of the architecture and implement it. Repeat.



Coding is best learned by coding. You will learn from your own mistakes, and finishing a project is motivating and much more fun than reading a book is.


6. Read and study code

Study famous software programs, such as the Linux kernel (be warned, it is huge). A good operating system for educational purposes is MINIX3. You can learn many new language idioms, and a thing or two about software architecture. Reading unfamiliar source code is daunting at first, but rewarding.



You can also increase your understanding of some API you use, or a programming language, by reading its implementation.


7. Hang out at programming sites and read blogs

Hanging out at different programming sites (such as forums and StackOverflow) will expose you to other programmers and at the same time, their knowledge.



Also, read blogs, maybe this (if you want) and preferably more. Good blogs are Joel on Software (although he doesn’t blog any more, jewels exist in the archives), Coding Horror and Lambda the Ultimate.



You should also follow news.ycombinator.com.


8. Write about coding

Start writing about coding on a blog, even if it is just for yourself. You can also write answers on different Q&A sites, forums or you can write tutorials at some sites (e.g. DreamInCode). When you write about coding, you want to make sure that use the correct terminology and know the why in order to explain problems and techniques. It also lets you reflect on your own programming knowledge and improve your English language skills, which is important in programming.


9. Learn low-level programming

Learning low-level programming and such languages is also useful for achieving a better understanding of the underlying machine. Check out C, and maybe even learn some processor’s Assembly language.



Learn how a computer executes a program and how an operating system works (at a high-level, at least). If you really want to go serious about low-level programming, you can read books on computer organization, operating systems, embedded systems, operating system driver development and so on (I’m reading such books at the moment).


10. Don’t rush to StackOverflow. Think!

So you have a problem with your code and you have been trying to solve it for half a minute. What do you (hopefully not) do? Run over to StackOveflow. Don’t. Spend a good deal of time trying to solve the problem on your own, instead. Take a paper and a pencil, start sketching a solution. If that doesn’t work, take a short break to keep your mind fresh and then try again.



If after spending an hour (or some other considerable amount of time, depending on the size of the problem) of trying to solve the problem, then you might go over to StackOverflow, but think on your own first.





Categories: Programming
Tags: learning, self-improvement
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值