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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

How can I learn to program?

93 点作者 rocamboleh大约 14 年前
I am in my early twenties and am seriously considering a career in entrepreneurship. I have a partner and we are in the midst of entering our business idea into numerous entrepreneurship contests. We have met with several business and tech professors and have been thoroughly encouraged to pursue this. The only problem? Neither of us know any code. One of our business coaches, a successful entrepreneur himself, suggested that the programming can be done with little problems -that there is still much utility in two idea boys. However, to be truly successful, it has occurred to me that we will need to know the ins and outs of programming. Perhaps we won't need to be experts, but a successful leader must be well versed in every aspect of his company. Does everyone agree? Can anyone make some recommendations about where I should get started learning code and the strategies to keep in mind while doing so? Help is much appreciated.

40 条评论

espeed大约 14 年前
Set up a Linux computer (Ubuntu Linux is the easiest to set up), and spend the summer learning to program in Python.<p>Here are some of the best online Python tutorials, including a link to videos and course material for MIT's introductory computer science course, which uses Python: <a href="http://www.quora.com/How-can-I-learn-to-program-in-Python/answer/James-Thornton" rel="nofollow">http://www.quora.com/How-can-I-learn-to-program-in-Python/an...</a><p>Build something that you want to use so it will be meaningful to you. Do you have a blog? That's usually a good first exercise. It's easy to do using Flask -- follow the tutorial (<a href="http://flask.pocoo.org/docs/" rel="nofollow">http://flask.pocoo.org/docs/</a>).<p>Here are some tips to get you started:<p>Use Emacs as the text editor to write your code -- it usually comes pre-installed on Ubuntu, and it has a Python mode. Here are some Emacs tutorials (there are some good videos on YouTube too):<p><a href="http://philip.greenspun.com/teaching/manuals/usermanual/emacs.html" rel="nofollow">http://philip.greenspun.com/teaching/manuals/usermanual/emac...</a> <a href="http://www2.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html" rel="nofollow">http://www2.lib.uchicago.edu/keith/tcl-course/emacs-tutorial...</a> <a href="http://www.gnu.org/software/emacs/tour/" rel="nofollow">http://www.gnu.org/software/emacs/tour/</a> <a href="http://cmgm.stanford.edu/classes/unix/emacs.html" rel="nofollow">http://cmgm.stanford.edu/classes/unix/emacs.html</a><p>Use PostgreSQL as your database. To install it on Ubuntu, use this command:<p>$ sudo apt-get install postgresql<p>Use SQLAlchemy (<a href="http://www.sqlalchemy.org/" rel="nofollow">http://www.sqlalchemy.org/</a>) to connect your Python website to PostgreSQL.<p>Here's a good SQL tutorial: <a href="http://philip.greenspun.com/sql/" rel="nofollow">http://philip.greenspun.com/sql/</a><p>When you build a blog, you don't have to worry about building a public authentication and comment system if you use something like Disqus (<a href="http://disqus.com/" rel="nofollow">http://disqus.com/</a>) -- you just include the Disqus JavaScript tag at the bottom of the blog's entry page.<p>Here are some good JavaScript tutorials: <a href="http://www.quora.com/What-are-good-books-preferably-found-online-for-free-like-eloquent-javascript-for-learning-javascript" rel="nofollow">http://www.quora.com/What-are-good-books-preferably-found-on...</a><p>Use StackOverflow to ask programming questions: <a href="http://stackoverflow.com/" rel="nofollow">http://stackoverflow.com/</a>
评论 #2458098 未加载
评论 #2457377 未加载
评论 #2457308 未加载
评论 #2457316 未加载
评论 #2457168 未加载
评论 #2457642 未加载
评论 #2457454 未加载
评论 #2457293 未加载
Todd大约 14 年前
First off, keep things simple. Don't dive into Linux, Emacs/VIM, etc. right away if you don't already know them. Your goal is to learn programming.<p>Next, you probably have an idea about where you want to be with your business. Is it mobile? Is it web? I'll assume the latter, because even if it's the former, you're going to need both eventually.<p>Even though it's not programming, you need to know HTML/CSS. Start there, even though it's not programming. You can get your feet wet editing and you can add programming shortly.<p>Start with a simple but capable editor. If you're on Windows, start with Komodo Edit or Notepad++. On Mac, something like TextMate. You can always 'upgrade' to Emacs/VIM later.<p>Once you're comfortable with basic HTML, you'll probably want to make it do things. You can start with JavaScript. This makes programming exercises simple and quick. Just refresh the page.<p>Once you decide you need a bigger challenge, then a larger world of choices becomes available: what server side language (Python and C# are two options), what server (Linux is pretty standard), what web server (Apache or Nginx are good), what database (Postgres, MySQL, MongoDB, etc...) are some of the many choices to be made.<p>I would first survey the above and decide what you think you might need, then pick the language based on that. Let's say you pick Python. Start playing with it from the command line or with your editor like you did with HTML. Once you understand the basics, then pick a web framework (like Django) and start making it produce the HTML that you now understand.<p>It's a stepwise process. The goal is to pick off small, achievable pieces, and then use them to build something more substantial. The core of it all, though, is programming. Programming is how you make the gears turn the way you want them to. Eventually, everything will start making sense and you'll just add to your repertoire as the needs arise.
makecheck大约 14 年前
If you're starting from the very beginning, learn a good text editor. (Editing is such a huge part of programming and has so many other payoffs that it is a very good first step.)<p>Use a forgiving and simple language like Python, and ideally an operating system where the tools you need are already installed.<p>Learn the documentation systems for your language of choice. For instance, in Python, you can go to <a href="http://www.python.org" rel="nofollow">http://www.python.org</a>, run the command-line "pydoc" tool, and use the "help" function in an interactive session.<p>Use things like StackOverflow and Google (i.e. learn how to find answers and ask questions). These days, help isn't too far away.<p>Choose some programming goal, even that goal is something arbitrary like reading 20 lines of a text file and printing all the words that start with A. Make yourself write programs that achieve arbitrary goals so that you're satisfied with how well you're learning the language. Do this for a few weeks before you attempt anything remotely related to the "real" reason you learned programming.
评论 #2457201 未加载
michaelfairley大约 14 年前
<a href="http://learnpythonthehardway.org/" rel="nofollow">http://learnpythonthehardway.org/</a>
ThomPete大约 14 年前
As someone who started out last summer I can tell you what I did.<p>I am quite a lot older than you and I have a child, a company and a girlfriend to manage, so you can probably pick it up much faster than me. Basically I have been forced to take an hour here and an hour there, sometimes more.<p>I have worked on it a while now but <a href="http://www.blueskycouncil.com" rel="nofollow">http://www.blueskycouncil.com</a> is my idea of a idea generation website. still lot's of little mistakes but again it was actually having a goal in mind that helped me know how far in the process I was.<p>So here is what I have done.<p>1. Sign up for Lynda.com<p>2. Watch php/mysql for beginners twice, just to get an understanding of the scope that I am about to venture into.<p>3. Start programming with an idea in mind.<p>4. Use IRC, StackOverflow and friends<p>That should take you plenty of the way.<p>I can also recommend reading books like Code Complete to get a sense of some of the programming issues and paradigms to think of.
SkyMarshal大约 14 年前
A friend of mine is in the same boat. I forwarded him all the usual suspects, from "Why's Poignant Guide to Ruby", to "Learn Python the Hard Way", to "The Schemer's Guide". But none quite worked for him. He finally found and settled on Harvard's intro CS course, CS50:<p><a href="https://www.cs50.net/" rel="nofollow">https://www.cs50.net/</a>
评论 #2457433 未加载
评论 #2457520 未加载
评论 #2457809 未加载
chromejs10大约 14 年前
Following what other people said.. Python is a great (and powerful) language to get started with. It is what we teach our CS110 class at my University. Honestly, get a Mac or, like espeed said, install linux. Learning bash is invaluable. Also, learn HTML5/CSS. Every business needs a website, and with as powerful as HTM5 is, you could get up a decent one with just those two things (though javascript would be handy).<p>There are a ton of good resources online. Hacker News is awesome, Stack Overflow, etc. Python has a nice and free online book to get you started.<p>Best of luck!<p>Oh, I agree with the need for a good editor. Emacs is great (of course others will argue for VIM of course ;). Unless things have changed in the last release, you'll have to install it yourself which is one of the reasons people choose the lighter weight editor of VIM.<p>If you have a mac, I would suggest TextMate. I recently came across SublimeText 2 which is currently in alpha stages but is really cool too! It is cross platform so it will also work on Linux.
16s大约 14 年前
Solve a specific real-world problem you have by writing a program to do it. Start with Python or Ruby. Start on one platform (Windows, Mac, Linux). Start small and get bigger by solving bigger problems as you progress.<p>Then, write a program that works on all major platforms with little or no modifications. Learn C++ or C. Learn how to use a debugger, how to distribute code to end-users, etc. While doing this, learn data structures, big O notation and why they are important when you need to scale. Learn how to handle threaded data safely and Unicode input too.<p>Just start coding ASAP to solve "real-world" problems (not book exercises), the rest will come as you progress.<p>Edit: Spelling
评论 #2457547 未加载
a_bad_dream大约 14 年前
You could probably get away with not knowing how to code, but even an elementary understanding helps you to know what is and isn't possible. Spend a week or two getting the fundamentals of programming (even if you won't be able to program very well at the end of that time), and you'll be in a much better place.<p>Try Mark Pilgrim's Dive Into Python. It's free online, and python is one of the better introductory languages: <a href="http://diveintopython.org/toc/index.html" rel="nofollow">http://diveintopython.org/toc/index.html</a><p>Aside from that, search stackoverflow for variations of your question - it's been answered lots before!
评论 #2457072 未加载
will_lam大约 14 年前
If you're interested in taking the Ruby on Rails route, you can check out Chris Pine's book "Learn to Program" in Ruby.<p>Also there's HacketyHack, Rails for Zombies, CodeSchool.com.<p>Also there was an old HN thread that is very similar to your situation. <a href="http://news.ycombinator.com/item?id=2280070" rel="nofollow">http://news.ycombinator.com/item?id=2280070</a>
Stormbringer大约 14 年前
On the one hand, I would say don't bother. Just chop up the task into small bits and outsource them. There are programming equivalents of the logo design contests, you can get the programming done very cheaply, and there are business oriented non-programming guys having a lot of success doing this in the mobile app space at the moment.<p>On the other hand, I imagine you building the next big thing as a social webservice. You won't understand security, you won't know why it is important, you won't know why it is hard... this worries me. Even big supposedly tech savvy companies (Google being a prime example) get this wrong (when it comes to <i>my</i> data PRIVATE IS THE DEFAULT dammit, <i>not</i> public!!!)<p>On the gripping hand, you can treat programming like any other kind of artistic talent. You say you need to understand every aspect of the company... well, will you have art? Will you have splash screens and icons? Does that mean you will go to art school as well as learning to be a programmer? Maybe you need some sound, will you spend 10 years trying to become a concert pianist?
dlo大约 14 年前
The below three essays are absolutely invaluable.<p>Peter Norvig: <a href="http://norvig.com/21-days.html" rel="nofollow">http://norvig.com/21-days.html</a><p>Eric Raymond: <a href="http://www.catb.org/~esr/faqs/hacker-howto.html" rel="nofollow">http://www.catb.org/~esr/faqs/hacker-howto.html</a><p>Paul Graham: <a href="http://www.paulgraham.com/pfaq.html" rel="nofollow">http://www.paulgraham.com/pfaq.html</a>
评论 #2457253 未加载
ksmith大约 14 年前
If you'd like to learn basic programming concepts right away, check out Pine's 'Learn to Program' (<a href="http://pine.fm/LearnToProgram/" rel="nofollow">http://pine.fm/LearnToProgram/</a>)<p>If you'd like to learn best practices, check out Hunt &#38; Thomas' 'The Pragmatic Programmer' (<a href="http://www.pragprog.com/the-pragmatic-programmer" rel="nofollow">http://www.pragprog.com/the-pragmatic-programmer</a>).<p>To get up to speed fairly quickly on what's going on under the hood, check out Petzold's 'Code' (<a href="http://www.charlespetzold.com/code/" rel="nofollow">http://www.charlespetzold.com/code/</a>) and Nisan &#38; Schocken's 'The Elements of Computing Systems' (<a href="http://www1.idc.ac.il/tecs/" rel="nofollow">http://www1.idc.ac.il/tecs/</a>).
pnathan大约 14 年前
&#62; One of our business coaches, a successful entrepreneur himself, suggested that the programming can be done with little problems<p>He's sort of a maroon. You can figure it out and be 'functionally illiterate' fairly quickly with some ingenuity and hard work. You'll produce some hardcore drek that will need to be cleaned up by a professional at some point though (maybe you after a few years of programming :)).<p>Python is the current fad language for introductory programming. I am not a huge fan, but there's lots of gentle reference material, which is probably more important.
dr_大约 14 年前
There are numerous online resources most of them have been mentioned here. I agree Python seems like a great way to start, its what I've been working through as well. I'd also suggest to see if there are local classes available in addition to the online stuff. Sometimes paying for a course at a college can get expensive but if you are in a area which is start up friendly and has incubators etc., you can get some cheaper courses there, to supplement your other learning. For example, in my area (NYC) there is General Assembly.<p>Remember though - entrepreneurship is not a career. You have to have a solid idea that you can develop into a product - developing and then taking that product mainstream and running that particular business (or working on selling it)is then your career.<p>Just like non-profit work is not a career - usually people who go into a non-profit work environment have a passion for something in particular, that then becomes their career, which so happens to be for a non-profit entity.
xiaoma大约 14 年前
The best resource I've seen is the Pragmatic Bookshelf <i>Learn to Program</i>, by Chris Pine. A good friend of mine who had no programming background whatsoever went through that book this August, enjoyed it and made great progress. It was enough that he found himself writing small scripts to help organize research at his pysch research job. The fact that he could occasionally save 15 minutes of work by spending 5 minutes to write a small chunk of code, kept it useful and kept him at it. The book uses Ruby, but what it really teaches is programming. My friend has since picked up quite a bit of Python and even a bit of JS with very little difficulty now that he understands functions, classes, iterators, blocks, etc...<p>In fact, what I saw impressed me so much that I've bought a copy to work through, even though I'm already writing basic flash games in AS3.<p><a href="http://pragprog.com/titles/ltp2/learn-to-program" rel="nofollow">http://pragprog.com/titles/ltp2/learn-to-program</a>
Kaizyn大约 14 年前
Hello Rocamboleh, what route you need to take to learn programming skills depends entirely on what kind of business you intend to start. Programming is a big field and has a lot of different technologies in it to pick from.<p>While espeed gave you good advice for how to setup your own server and all the tools needed for a Linux-based web application, this isn't necessarily the best route for you to go. If your software is intended to run in a big corporation, for example, then you should probably consider learning either the Microsoft technologies or the Java Enterprise technologies. If instead you're going to be working on iPhone/iPad or Android devices, then you will need a different tool set. There are a number of other alternatives you could pursue, as well. The answer really depends on what kind of startup software you need/want.<p>If I can help you further, please send me an email (address is in my profile) and I will be happy to try. Good luck with your endeavors.
buckwild大约 14 年前
I've found that I've learned the most about "programming" from working on projects. Imagine something you want to build, design it, and then code it. You'll learn tons, I promise. Plus, you'll have something to show for your trouble at the end of it (which is a great motivator to get you going on your next project). Rinse and repeat.
markkat大约 14 年前
Here's how I am doing it: Grab an open-source program (in a space that interests you), figure out how to get it running, then mess with it. Keep changing it and messing with it.<p>After time, you will begin to understand more, and gain confidence. Just keep at it. Don't stop pursuing your business interests, etc, but just code code code. Best of luck!
ef4大约 14 年前
Learning the basics would be a smart move. Just don't get a big head once you've learned a little, because the gap between "knows enough to be dangerous" and "truly competent" is vast.<p>The strategy is simple. <i>Stay focused on practical problems at all times</i>. Pick some real thing you would like to achieve, and bang away at it, learning as you go. When you get stuck, look for help on places like Stack Overflow.<p>Expect to suck at it, and expect to spend countless hours baffled by things you can't figure out. There's no skipping this process. Most people find it too painful, which is why most people never learn to program.<p>It doesn't really matter what projects you pick, so long as they're relevant to you. If they turn out to be "too difficult" you'll learn just as much, and be able to pick a smarter project next time.
ekanna大约 14 年前
Start Learning JavaScript! In one shot you will learn 3 things 1. Client Side Programming (Browsers) 2. Server Side Programming (NodeJS) 3. Database programming (Using JSON eg. MongoDB and CouchDB) How to start? 1. Install NodeJS 2. Install Chrome Browser Start palying.....
tmachinecharmer大约 14 年前
If you are using Windows: 1. Download Visual Studio Express Edition 2. Google for C# tutorials for beginners 3. Follow it.<p>If you are using Linux: 1. Google for Python tutorial for beginners 2. Follow it.<p>Learn some web programming by following tutorials on w3schools. You should be able to create simple static web page and host it on localhost.<p>Why C# and Python? Well both are widely used and are easy to grasp.<p>Once you grasp basic concepts like 1. if...else.. 2. for 3. while 4. case 5. What are libraries? 7. What is difference between compilation and interpretation? 8. What is the difference between editor, IDE and compiler?<p>the force will guide you.<p>And if at any point you get stuck you can always ask question at StackOverflow.com<p>Then, you can come back and "Ask HN" how do I become better programmer?<p>Best of luck!
gcv大约 14 年前
The best way to learn programming conceptually is to read Structure and Interpretation of Computer Programs, by Abelson and Sussman. The book is available free on-line, along with video lectures.<p>- <a href="http://mitpress.mit.edu/sicp/" rel="nofollow">http://mitpress.mit.edu/sicp/</a> - <a href="http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/" rel="nofollow">http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussma...</a><p>Once you have mastered this material, learning the specialization of web development shouldn't take more than a week or two of intense study.<p>Plus, as a bizdev person, you will earn incredible street cred with programmers. MBAs with backgrounds in Lisp hacking don't come along every day.
评论 #2457477 未加载
评论 #2457635 未加载
tuhin大约 14 年前
Does a Python version of core programming concepts like Algorithms, Abstractions, OS, etc exist? Basically all the major course of Computer Science which need a programming language to grasp the concepts.<p>Every University site I have seen has them in C++ or Java. I was so excited to do MIT 6.0 Intro course for Python and throughly dissapointed that other courses are in C or Java. Do I HAVE to learn 3 languages (even if it just skim through) to just get the basic concepts?<p>I know of books like Learn Python the hard way, Think like a Computer Scientist and like but I guess they do not cover the above topics. Please correct me if I am being ignorant here.
wccrawford大约 14 年前
Either take a class, or do it like most self-taught programmers: Find a need and start looking up how to make it happen. It's going to be VERY painful at first if you teach yourself, but if you stick with it, you'll get there.
评论 #2457156 未加载
kodisha大约 14 年前
When i think about it - one language wont do it. When you learn html/CSS - you will know how browser renders elements on the page, nothing else. If you learn javascript - you wont know anything about server side. If you learn PHP - it will complement your knowledge of html/css nicely, but you still need to know some javascript.<p>So my vote goes to PHP + javascript (+node.js) + HTML + CSS<p>edit: i recommend Ubuntu for development, or if you own a Mac, just install xampp and enjoy.
pepsi_can大约 14 年前
I wonder if my site can help you. It is intended as a online tutor designed for programmers preparing for job interviews but I think you'd find the find the practice problems, in-depth tutorials and the video lectures (coming soon) helpful once you get a bit of programming experience.<p>If you happen to try it out, I can answer any programming questions you may have, give you tips, feedback, etc.<p>Check it out at:<p><a href="http://blueberrytree.ws" rel="nofollow">http://blueberrytree.ws</a>
eru大约 14 年前
Python, as mentioned, is an excellent choice for a first language.<p>However, if you are either mathematically minded or somewhat into chain-and-bondage, then Haskell might also be worth looking into. I'd suggest reading Raymond Smullyan's "To Mock a Mockingbird" if you want to go down that road.<p>It's a popular book about combinatory logic. The kind of logic you need for functional programming.
rblion大约 14 年前
Here is an MIT Course: Introduction To CS and Programming<p><a href="http://www.youtube.com/watch?v=k6U-i4gXkLM&#38;feature=related" rel="nofollow">http://www.youtube.com/watch?v=k6U-i4gXkLM&#38;feature=relat...</a><p>Professor keeps everything simple and direct because this class is designed for beginners with no or little programming experience.
NEPatriot大约 14 年前
I'm going through this myself right now and am using a multi pronged approach.<p>1. Trying to recruit friends who have also said they would be interested<p>2. Watching videos from lynda, killerphp, etc.<p>3. I have an idea of something I want to build and so am learning with a goal in mind<p>4. Hiring a tutor via e-lance to answer quick questions on an hourly basis
MichaelL大约 14 年前
Do you want to be an entrepreneur or a coder?<p><a href="http://www.jamesaltucher.com/2011/04/the-easiest-way-to-succeed-as-an-entrepreneur/" rel="nofollow">http://www.jamesaltucher.com/2011/04/the-easiest-way-to-succ...</a><p>This does not fit everybody, so if it's not for you, what could you take from this?
simon_kun大约 14 年前
<a href="http://pine.fm/LearnToProgram/" rel="nofollow">http://pine.fm/LearnToProgram/</a>
评论 #2457596 未加载
SoftwarePatent大约 14 年前
I posted a similar question a few months ago, there are a lot of great answers in that thread<p><a href="http://news.ycombinator.com/item?id=2069477" rel="nofollow">http://news.ycombinator.com/item?id=2069477</a>
systems大约 14 年前
The best advice I can give you (by which I will also be echoing others), try to apply your knowledge as soon as you can.<p>Don't just learn to learn, because you will forget more than you remember.
thangalin大约 14 年前
1. Google.<p>2. Search for: "start programming"|"learn to program" site:stackoverflow.com<p>3. Read:<p>- <a href="http://stackoverflow.com/questions/4769/what-is-the-easiest-language-to-start-with" rel="nofollow">http://stackoverflow.com/questions/4769/what-is-the-easiest-...</a><p>- <a href="http://stackoverflow.com/questions/1858064/so-my-girlfriend-wants-to-learn-to-program" rel="nofollow">http://stackoverflow.com/questions/1858064/so-my-girlfriend-...</a><p>- <a href="http://stackoverflow.com/questions/335063/whats-the-easiest-way-to-learn-programming" rel="nofollow">http://stackoverflow.com/questions/335063/whats-the-easiest-...</a>
jdefr89大约 14 年前
Don't start programming at all. I am going to be brutally honest, programming is not for everyone. The fact you stated you want to start programming and you're entrepreneur is a flag for 'someone who wants to learn to program in order to become some millionaire'. These sorts of people are not successful in the field. Worse, we have bad enough people in CS already don't poison the pool with even more people who bring nothing to the software table.
评论 #2457909 未加载
ohashi大约 14 年前
<a href="http://www.reddit.com/r/carlhprogramming" rel="nofollow">http://www.reddit.com/r/carlhprogramming</a>
rocamboleh大约 14 年前
Thanks for all the great responses. I'm really excited to get started!
vchien大约 14 年前
MIT open courseware - ocw.mit.edu
jschlesser大约 14 年前
The same way you learn to write a novel in a foreign language.