TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

DHH: How do I learn to program?

145 点作者 pietrofmaggi超过 14 年前

23 条评论

jrockway超过 14 年前
This is more a description of "how to type in code that appears to solve today's problem". But that's not programming, that's code monkeying.<p>To learn how to write real programs, you need to read real programs. Is Emacs bugging you? Open the source and see how it works. Web server crashed? Read the source and fix the bug. Not sure how to configure cron? Take a look at its config parser!<p>Many "programmers" spend their entire life treating everything as a black box. Take a look inside the box! That's how you really learn to program.
评论 #1716529 未加载
评论 #1716786 未加载
评论 #1716484 未加载
评论 #1717369 未加载
评论 #1717272 未加载
评论 #1716517 未加载
评论 #1716475 未加载
tnorthcutt超过 14 年前
Speaking as a non-programmer, this is spot-on, for me. I've tried to go through various tutorials and start learning to code over the past few years (all the while wishing I'd gotten a CS degree rather than finance), but could never force myself to get through a whole book and really start to understand what's going on. Recently, though, there's been a need within my business for a small, (theoretically) simple application to handle part of our workflow. I finally have a concrete end goal in mind, and have been flying through a PHP book (Head First PHP and MySQL, which I quite like so far), because I actually want to learn enough as quickly as I can to put together a working version of this application. Granted, I'm still following the tutorials in the book and going through the admittedly hokey examples, but now I can see how each of the different elements I'm learning will actually help me build something useful. It's a whole different experience for me, learning to code when I actually know what I want to build.
评论 #1716474 未加载
评论 #1716342 未加载
atldev超过 14 年前
Disaster can also be a great teacher: Long ago, I started work at Oracle with 2 cohorts. We were asked to install the product locally as a sandbox to work in and learn. The install went flawlessly for my 2 buddies. My install was a disaster, and it was the best possible thing that could have happened. I learned more over the next 2 days of frantic troubleshooting than most learned over the course of 6 months. My cohorts laughed at the time, but they never caught up.
GBKS超过 14 年前
Two things come to mind for me.<p>Flash 6 was how I learned programming. I realized I could create visual patterns and animations through code that I could never do by hand. The visuals were my goal, coding was what I had to learn on the way.<p>Copying and stealing is the best way to learn for me. Whatever I need to do, somebody has done something similar. So before I start, I find a code example or tutorial. First thing is to get it to run, then I make small changes until it does what I need it to.<p>This second approach works great for other things than coding, too. Taking apart and imitating successful designs, for example, is a great learning experience.
edw519超过 14 年前
<i>What made it click for me was programming in anger. Programming because I needed to. Programming because I gave a damn about what I was writing and I wanted it done sooner rather than later.</i><p>What made it click for me was programming in fear. Programming because I needed to. Programming because I gave a damn about my customer being satisfied and I wanted to get paid sooner rather than later.
评论 #1716559 未加载
jgrahamc超过 14 年前
This doesn't just apply to programming. You need to have a concrete goal when learning anything. That's what'll motivate you to actually spend the time learning.<p>That's how I learnt to speak French. It wasn't because I wanted to speak French, it was because I needed to. And you can only learn something by doing it. That applies to coding and speaking a foreign language.
评论 #1716612 未加载
ojbyrne超过 14 年前
From 2000-2004 I was kind of a dabbler in the web dev world. Built crappy sites for many clients that really didn't go anywhere, and so I concentrated on doing things as cheaply and as fast as possible. Then the whole Digg thing happened. I learned about scaling "in anger." And keeping up with programmers that were smarter than me at the task at hand. I probably learned more in 2 years than I had in the 20 years before that. Now I find myself dealing regularly with programmers that didn't go through that experience (and managers who embrace that "cheap and fast" ethic). I try to control my disdain.
fohlin超过 14 年前
I've just left a workshop at our CS department, where we discussed new and old issues with teaching programming. Tutorials and assignment, based on completely made up cases and requirements, are still very much at the core of introductory programming courses. This is in sharp contrast to what DHH says in the post, as well as comments here and elsewhere.<p>May I be slightly selfish, and ask a question to all of you who have a CS degree? Did you learn programming as part of your CS education? Regardless, what's you opinion about the way programming was taught?
评论 #1718021 未加载
评论 #1716756 未加载
评论 #1716828 未加载
评论 #1716542 未加载
评论 #1716495 未加载
ptn超过 14 年前
"Programming in anger" is a very odd way to put it. I think it's best to say "programming because you need it".
zwetan超过 14 年前
let me add a little something<p>programming is about languages and tools, whatever is your anger or need, some are more approachable than others<p>my dark beast for 10 years have been C and by extension C++, got this kind of stupid idea that to be a "real" developer you have to know how to program in C<p>and true for 10 years I tried to learn C/C++, just learning it for fun or curiosity, and for 10 years it went nowhere, could not wrap my head around it<p>I was just giving up after a couple of weekends, losing interest, and that was to blame on the fact I was just trying to learn it for the sake of knowing it, I didn't really needed it<p>and then on a somewhat big open source C++ project I found a little bug (really a shit of bug that can be fixed in 2sec), I could compile the project but not really write C/C++, but still could fix that bug<p>that's what I would call "anger", knowing that this stupid little bug can be fixed in no-time by someone like me (being a total noob)<p>but from this "anger" came a very unexpected thing<p>on my day to day work, wether it's ActionScript, Java, PHP, Python, etc. I can code it in my sleep, sure there are still some bugs and complexities, but still nothing that I can consider impossible<p>because trying to add features to that big C++ code base, was something very hard to do for me and to some extend "impossible" or "how the hell I gonna do that", it ended up being extremely rewarding and a kind of an obsession<p>so my little contribution would be to add: it's not only about the anger and the need, it is also about how hard it is for you to do it<p>yep, hard is fun<p>the harder the better ;)
sahillavingia超过 14 年前
Exactly. You can't program by "ok, let's learn the syntax, now let's move onto strings, now objects..." you need a project, and then it's 100x easier to learn what you need to know. You'll never know everything, but that wouldn't have happened if you went the other way anyways.<p>Even after a year of iOS programming, I still consider myself a beginner, and I probably always will be. There's nothing wrong with that. :)
wccrawford超过 14 年前
I guess I took that for granted. I never read things expecting it to teach me to program. I read things to figure out how to do what I currently wanted to do.<p>Now, I read things to see what new ideas and libraries are out there... But it when it comes time to learn them, I use them.
omnigoat超过 14 年前
My first, my <i>very first</i> C++ project, started in Year 9 - coming from VB6 - was a 3D graphics engine. Yeah, that failed. It failed 5 times (fun fact - the fourth rewrite occurred moments after exclaiming "oh <i>those</i> are references!"). But the 6th one was pretty neat! I'd written a file-loader for 3D Studio Max, an event system, input, etc. The seventh rewrite would have gotten rid of the hardware T&#38;L and used shaders instead. I was in Year 12 by then. Then I went to uni, studying CS, and afterwards got a job at a video games company, implementing a 3D graphics engine.<p>Honestly, sometimes you just have to do it, even without any training. Maybe do it six times.
orblivion超过 14 年前
I feel the same way. Though I wouldn't call it angry. I really wish I could learn out of intellectual curiosity (I'm trying to do so with Haskell at the moment) but I can't help feeling like it's a waste of time. I'd rather do something <i>useful</i>. Or at least interesting, <i>as an end</i>. I love reading about new languages, I just can't seem to take enough interest to learn them. I'm going to try to do my next non-critical project in Haskell, see if that works.
Locke1689超过 14 年前
<i>Intellectually curious for the sake of it. I envy you.</i><p>Is this really that rare? I think I've always been that way.
meric超过 14 年前
Powerpoint was how I got into programming. I tried to make an adventure game out of powerpoint slides and hyperlinks, see, but when I hit the limit of powerpoint "programming" I started on BASIC, which worked much better.
ziadbc超过 14 年前
Learning to program is a function of interest, need and willpower.<p>It is fun to dabble and be curious, but curiosity will not get you through some of the minutia that it takes to build a real app, and thats when need and willpower get you through to learning.<p>One breakthrough for me was realizing that programming is now a social activity. You have to meld with the hivemind to really get anything done, and while its good to have a mental framework of whats under the hood (I recommend the book 'code' by charles petzold for those without formal engineering training) it's more important to realize how to model all the abstractions that are part of modern software.<p>As paradoxial as it sounds, understanding abstractions is often works out to be alot like 'code monkeying' than theoretical computer science.
bl4k超过 14 年前
He might want to adjust the grammer of the title so that it is past-tense<p>Or he could leave it and I am sure a screenshot of it will pop during a flame war about rails :) (or somebody will respond 'Try PHP, David')
mironathetin超过 14 年前
Well, sound a lot like Peter Norvigs "Teach Yourself Programming in Ten Years". Enjoy: <a href="http://www.norvig.com/21-days.html" rel="nofollow">http://www.norvig.com/21-days.html</a>
jarin超过 14 年前
That is exactly what I tell everyone who asks me that question!
city41超过 14 年前
Why is this post receiving so much attention, just because DHH wrote it? It has basically no content and is extremely fluffy. I find the 37signals blog in general is often like this.<p>Sometimes I wish HN stories could be downvoted.
评论 #1718265 未加载
zackattack超过 14 年前
I learned to program to solve problems or create things. I don't enjoy learning a new language for its own sake; I might invest some time doing proactive learning because it will help me solve problems down the road, but that's it.
aneth超过 14 年前
I think this is generally true of anything not involving mortal danger. If you want to learn how to do something, just do it. You will always fail at first, but you will learn.