贊助網站
2002年10月01日

1. Learn how to program.


This, of course, is the fundamental hacking skill. If you don't know any computer languages, I recommend starting with Python. It is cleanly designed, well documented, and relatively kind to beginners. Despite being a good first language, it is not just a toy; it is very powerful and flexible and well suited for large projects. I have written a more detailed evaluation of Python. Good tutorials are available at the Python web site.

Java is also a good language for learning to program in. It is more difficult than Python, but produces faster code than Python. I think it makes an excellent second language.

But be aware that you won't reach the skill level of a hacker or even merely a programmer if you only know one or two languages -- you need to learn how to think about programming problems in a general way, independent of any one language. To be a real hacker, you need to get to the point where you can learn a new language in days by relating what's in the manual to what you already know. This means you should learn several very different languages.

If you get into serious programming, you will have to learn C, the core language of Unix. C++ is very closely related to C; if you know one, learning the other will not be difficult. Neither language is a good one to try learning as your first, however. And, actually, the more you can avoid programming in C the more productive you will be.

C is very efficient, and very sparing of your machine's resources. Unfortunately, C gets that efficiency by requiring you to do a lot of low-level management of resources (like memory) by hand. All that low-level code is complex and bug-prone, and will soak up huge amounts of your time on debugging. With today's machines as powerful as they are, this is usually a bad tradeoff -- it's smarter to use a language that uses the machine's time less efficiently, but your time much more efficiently. Thus, Python.

Other languages of particular importance to hackers include Perl and LISP. Perl is worth learning for practical reasons; it's very widely used for active web pages and system administration, so that even if you never write Perl you should learn to read it. Many people use Perl in the way I suggest you should use Python, to avoid C programming on jobs that don't require C's machine efficiency. You will need to be able to understand their code.

LISP is worth learning for a different reason — the profound enlightenment experience you will have when you finally get it. That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot. (You can get some beginning experience with LISP fairly easily by writing and modifying editing modes for the Emacs text editor.)

It's best, actually, to learn all five of these (Python, Java, C/C++, Perl, and LISP). Besides being the most important hacking languages, they represent very different approaches to programming, and each will educate you in valuable ways.

I can't give complete instructions on how to learn to program here -- it's a complex skill. But I can tell you that books and courses won't do it (many, maybe most of the best hackers are self-taught). You can learn language features -- bits of knowledge -- from books, but the mind-set that makes that knowledge into living skill can be learned only by practice and apprenticeship. What will do it is (a) reading code and (b) writing code.

Learning to program is like learning to write good natural language. The best way to do it is to read some stuff written by masters of the form, write some things yourself, read a lot more, write a little more, read a lot more, write some more ... and repeat until your writing begins to develop the kind of strength and economy you see in your models.

Finding good code to read used to be hard, because there were few large programs available in source for fledgeling hackers to read and tinker with. This has changed dramatically; open-source software, programming tools, and operating systems (all built by hackers) are now widely available. Which brings me neatly to our next topic...


於02年10月發佈



其他文章共 108 篇

短篇故事:8篇, 隨筆:84篇, 詩:1篇, 公開書信:15篇

最新公開文章 :     23-12-2002 與鴿有緣 (03年3月)
    11-3-2003 喜歡你的人才重要 (03年3月)
    12-3-2003 幼人之幼 (03年3月)
    12-3-2003 學校淪亡 (03年3月)
    12-3-2003 我果然唔正常 (03年3月)
    25-3-2003 幫人的真義 (03年3月)
    17-3-2003 冇貢獻有何意思 (03年3月)
    24-3-2003 重新開始 (03年3月)
    28-3-2003 怎可以袖手旁觀 (03年3月)
    29-3-2003 不去阻止等同同謀 (03年3月)
    29-3-2003 男女真的平等 (03年3月)
    29-3-2003 可悲的並不是... (03年3月)
    29-3-2003 雙肩是給人用的 (03年3月)
    #000 天才的秘密 1 (03年3月)
    #436 幫人的道理 (02年12月)
    #434 她很特別 (02年12月)
    二十一世紀重大課題 <01> (02年11月)
    #198 <911> (02年11月)
    #316 你叫我偷懶? (02年11月)
    #294 智慧的生命 (02年11月)



livealone 只跟部份人分享這資訊。


Pixel Cafe
包場開生日派對? 搞謝師宴? 公司活動? 舊同學聚會? 聖誕派對?