Translation: Xiao Feng

Why is everyone in such a hurry?

Walk into any bookstore and you’ll see a book like Teach Yourself Java in 24 Hours. Java in the title will probably change to C, SQL, Ruby, Algorithms, etc. Then 24 hours will change to N days or N hours. Advanced Search on Amazon [Title: Teach, Yourself, hours, since: In 2000, you’ll find 512 books, nine of the top 10 are programming books (and one is on financial accounting), and there are variations, such as “study” instead of “self-study” and “day” instead of “hour.”

Bottom line: Either everyone is in a great hurry to learn programming, or programming is in some incredible way easier to learn than anything else. Felleisen et al. endorsed this trend in their book How to Design Programs — “It’s easy to write bad Programs. A fool can learn to program in 21 days. Even if they have no foundation.”


image

Let’s analyze what a book like 24 hours C++ means:

  • Teach yourself: During those 24 hours, you won’t have time to write meaningful programs, so you won’t be able to draw lessons from your successes or failures. You won’t have the time to work with experienced programmers, so you won’t know what it’s like to live in a C ++ environment. In short, you won’t have time to learn much. This book will only scratch the surface without giving you a deep understanding. As Alexander Pope said, shallow learning is deceptive.

  • C ++ : In 24 hours, you might learn some C ++ grammar (if you’ve learned another language), but you won’t learn how to use the language. In short, if you were a Basic programmer, you would probably write C ++ syntax programs in the Basic style, which means you wouldn’t really understand the true strengths (and weaknesses) of C ++. So, what’s the point? Alan Perlis once said, “If a programming language doesn’t affect your programming mind, it’s not worth learning.” One possibility is that you’ll have to learn a little C++ (or, more likely, JavaScript or process processing) because you’ll need it to work with existing tools for specific tasks. But you’re not learning how to program: you’re learning how to get things done.

  • 24 hours: Unfortunately, this is not enough, for reasons discussed below.

10 years of self-taught programming

Researchers (Bloom (1985), Bryan & Harter (1899), Hayes (1989), Simmon & Chase (1973)) have shown that it takes us about 10 years to develop expertise in any broad field, such as chess, Music composition, telegraph operation, painting, piano, swimming, tennis, and neuropsychology and topology. Reflective practice is key: don’t just do it over and over again, but challenge yourself with tasks that exceed your current capabilities, try it, analyze your performance as you do it and after, and correct mistakes. And then repeat, and repeat. There are no real shortcuts: even Mozart, already a prodigy at the age of four, took 13 years to start making world-class music.

Malcolm Gladwell popularized this idea, although he focused on programming for 10,000 hours, not 10 years. Henri Cartier-Bresson (1908-2004) had another metric: “Your first 10,000 photos are your worst work.” (He didn’t factor in digital cameras, which make it possible to reach that standard in a week.) True specialization may take a lifetime: Samuel Johnson (1709-1784) said, “Excellence in a discipline can only be achieved through a lifetime of effort: a discounted school cannot go home.” And Chaucer (1340-1400) complained, “If life is limited, learning is infinite.” Hippocrates (C. 400BC) is known for his motto “Life is short, art is long.” Therefore, it is unreasonable to assume that all skills (such as programming, chess, checkers, music) can be mastered in the same amount of time, and that the time required will not be exactly the same for everyone. As Professor K. Anders Ericsson puts it, “In most fields, statements about how much time it takes even the most talented people to reach the highest performance levels are of interest. 10,000 hours is just to give you an idea, because everyone has different learning abilities. “

So, do you want to be a programmer?

Here are my secrets to programming success:

  • Get interested in programming, and then write programs because it’s fun. Make sure you keep it fun enough to willingly spend 10 years / 10,000 hours programming.

  • Programming. The best way to learn is by doing. In more technical terms, “For individuals, the highest level of performance in a given field is not automatically achieved with increased experience, but the level of performance can be increased by the conscious efforts of experienced individuals to improve. “(P 366)” And, “The most effective learning requires specific tasks, appropriate levels of difficulty for the particular individual, feedback on information, and opportunities to repeat and correct mistakes.” (P 20-21). For this argument, see the book Cognition in Practice: Mind, Mathematics, and Culture in Everyday Life.

  • Talk to other programmers; Read about other programs. This is more important than any book or training course.

  • Spend four years in college (or more in graduate school) if you want to. Going to college gives you access to jobs that require a degree and a deeper understanding of the field, but if you don’t like school, you can get similar work experience (with some contribution). In any case, book knowledge alone is far from enough. “Computer education does not make programmers any more expert than learning, just as paint does not make people experts in painting.” Says Eric Raymond, author of The New Hacker’s Dictionary. One of the best programmers I ever hired had only a high school degree — he made a lot of great software, had his own newsgroup, and made enough money on stock options to buy his own bar.

  • Work on projects with other programmers. Be the best programmer on some projects; He was the worst programmer on some other projects. When you’re the best programmer, you need to test your ability to lead projects and inspire others with your ideas. When you’re the worst programmer, you need to learn from the masters and learn to do things they don’t like (because they’ll make you do it for them).

  • Take over the project after other programmers. Understand other people’s programs. Know how to understand and fix the program when the original programmer is not around. Think about how to design your program to make it easier to maintain after you.

  • Learn at least half a dozen programming languages. Including a language that focuses on class abstraction (such as Java or C ++), a language that focuses on functional abstraction (such as Lisp or ML or Haskell), a language that supports syntactic abstraction (such as Lisp), a language that supports declarative specifications (such as Prolog or C ++ templates), And a language that focuses on parallelism (like Clojure or Go).

  • Remember, “Computer science” includes “computer”. Know how long it takes your computer to execute an instruction, read a word from memory (with and without cache misses), read consecutive words from disk, and search for new locations on disk. (The answer is here.)

  • Dabble in the standardization of a language. This can be ANSI C ++, or you can decide whether your team’s coding style should have two or four Spaces of indentation. Either way, you’ll learn what other people like in a particular language, how much they like it, and even a little bit about why they feel that way.

  • Have the good sense to get out of the language standardization work as quickly as possible.

With all this in mind, you may wonder how far book learning can take us. Before my first child was born, I read all how to… “But still felt like a helpless novice. 30 months later, when my second child was born, did I go back to revising? No, instead, I rely on my personal experience, which is far more useful and reassuring than thousands of pages written by experts.

Fred Brooks, in his essay No Silver Bullet, lays out a three-step plan for finding good software designers:

  1. Systematically identify top designers early on.

  2. Assign career mentors to be responsible for future growth and carefully maintain their career documentation.

  3. Provide opportunities for designers to interact and grow together.

This assumes that some people already have what it takes to be a great designer; Work is just guiding them along. Alan Perlis puts it more succinctly: “We can teach everyone to sculpt: Michelangelo was taught not to. So are great programmers.” What Perlis meant was that there were some intrinsic qualities that great men possessed that went beyond training. But where do these qualities come from? Is it something you’re born with? Or is it developed through diligence? As Auguste Gusteau (the fictional chef in Ratatouille) said, “Anyone can cook, but only the fearless can achieve greatness.” I think the fearlessness here is more like the willingness to devote a large part of one’s life to thinking about what it means to practice. Perhaps fearlessness sums it up. Or, as Gusteau’s critic Anton Ego puts it: “Not everyone can be a great artist, but a great artist can come from anywhere.”

So go ahead and buy those Java/Ruby/Javascript/PHP books; You’ll probably get some use out of it. But they won’t change your life, and you won’t grow into a fully fledged professional programmer in 24 hours or 21 days. A journey of a thousand miles begins with a single step. From now on, work hard…