News for hackers. Stuff that matters.
Re:Ask HN: I want to learn how to code. Can anyone tell me h... by espeed on Monday June 27, 2011 @12:40AM (#2700142)
Set up a Linux computer (Ubuntu Linux is the easiest to set up), and spend the summer learning to program in Python.

Python is easy to learn (not much syntax), easy to read (explicit vs implicit), has a big ecosystem (more packages/libraries), is taught at universities so it's easy to find good programmers to help, and is used by many large websites/companies so it's a good language to know.

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: http://www.quora.com/How-can-I-learn-to-program-in-Python/an...

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 (http://flask.pocoo.org/docs/).

Here are some tips to get you started:

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):

http://philip.greenspun.com/teaching/manuals/usermanual/emac... http://www2.lib.uchicago.edu/keith/tcl-course/emacs-tutorial... http://www.gnu.org/software/emacs/tour/ http://cmgm.stanford.edu/classes/unix/emacs.html

Use PostgreSQL as your database. To install it on Ubuntu, use this command:

  $ sudo apt-get install postgresql
Use SQLAlchemy (http://www.sqlalchemy.org/) to connect your Python website to PostgreSQL.

Here's a good SQL tutorial: http://philip.greenspun.com/sql/

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 (http://disqus.com/) -- you just include the Disqus JavaScript tag at the bottom of the blog's entry page.

Here are some good JavaScript tutorials: http://www.quora.com/What-are-good-books-preferably-found-on...

Use StackOverflow to ask programming questions: http://stackoverflow.com/

UPDATE: Here are links to some commonly-used scientific Python packages (http://www.drewconway.com/zia/?p=204).

Re:Ask HN: I want to learn how to code. Can anyone tell me h... by wisty on Monday June 27, 2011 @01:37AM (#2700278)
The Python Tutorial (http://docs.python.org/tutorial/) is really pretty good.

Now, if you are doing more researchy work, then a lot of the web stuff is peripheral.

My advice would be to use scipy (the swiss army knife of scientific programming with python), matplotlib (for 2D plots), something for 3D (maybe Mayavi2?), NetworkX for networks, PyTables for storing read-only data, the inbuilt csv library, ctypes or weave for performance ... and domain specific libraries here: http://www.scipy.org/Topical_Software

But don't worry about all that yet. You can hack together a good demo with nothing but scipy and matplotlib.

Re:Ask HN: I want to learn how to code. Can anyone tell me h... by AlexMcP on Monday June 27, 2011 @01:11AM (#2700215)
I like all of this advice. The key threads running through it at which I nodded my head in agreement were:

1) Free software/languages 2) Cut corners (disqus) 3) StackOverflow. This was a super life saver as I never had someone next to me while learning to just ask a quick question. The response time on it is often incredible.

Focus less on your 'platform choice' or whatever, as that can actually be quite fluid. Programming is programming, so spend more time writing code in the beginning I'd say.

Re:Ask HN: I want to learn how to code. Can anyone tell me h... by espeed on Monday June 27, 2011 @01:14AM (#2700227)
Focus less on your 'platform choice' or whatever, as that can actually be quite fluid

Yeah, but programming on Windows is a PITA so I found its simpler to just eliminate that from the equation :)

Re:Ask HN: I want to learn how to code. Can anyone tell me h... by mattmanser on Monday June 27, 2011 @04:23AM (#2700584)
And this is why your advice is actually bad, op said nothing about his platform choice and you're recommending he should go run a marathon when he's never even jogged.

Windows programming is not a PITA, that's a flat out lie from you. It's total and utter nonsense, especially as Windows has arguably the best IDE of all the platforms.

In the end it's exactly the same as linux programming. And iPhone programming. And BBC Micro Programming. And Spectrum programming. It's just that you have some personal preferences.

Programming is just programming and that's what he wants to learn, not your dogmatic preferences.

Re:Ask HN: I want to learn how to code. Can anyone tell me h... by espeed on Monday June 27, 2011 @05:07AM (#2700660)
There's much more to a productive programming environment than IDEs, and most Python programmers don't use IDEs anyway.

The OP says he wants to do a startup and plans to go to grad school for physics, but in terms of programming, he doesn't really know what he wants.

That's why he is asking for advice on what path to take -- he is asking for "preferences," recommendations, and guidance. How many startups do you know that run Windows? How many high-performance physics labs?

When people were asking for faster horses, they didn't know to ask for automobiles because they didn't know that was something to consider. The had no perspective. Helping someone onto a more productive path from the start can help them get to where they want to go faster in the long run.

How long does it take to run a marathon? The OP has a timeline of 6 months.

Re:Ask HN: I want to learn how to code. Can anyone tell me h... by Entaroadun on Monday June 27, 2011 @05:00AM (#2700649)
Why do you feel Windows a PITA to program in?
Re:Ask HN: I want to learn how to code. Can anyone tell me h... by espeed on Monday June 27, 2011 @05:10AM (#2700669)
The windows command line and setting up the environment primarily. And most of the tutorials online are from a Linux perspective so it's usually easier for new programmers not to have translate the tutorials into a different environment.
Re:Ask HN: I want to learn how to code. Can anyone tell me h... by glassx on Monday June 27, 2011 @01:29AM (#2700260)
Bonus points for recommending a Linux environment.

Everyone should learn sysadmin basics. It's not hard, and in the long run it can be handy, especially in startups with small teams.