69 points · by theprotagonist · 15y ago · 57 comments
I am a recent college graduate (as of this past May) and I studied chemistry and physics. I have plans to go to graduate school within a year for theoretical and computational chemical physics - that's basically fancy talk for predicting physical interactions between molecules using high performance computing. I have some experience in the field from working as a research assistant as an undergrad and while I never had any problems with the physics, I struggled a little bit with the coding aspect because of lack of previous exposure.
I also read this post "To founders who can't code"
http://news.ycombinator.com/item?id=1761530
It really hit home. I have had two failed ventures thus far which likely would have taken off better if I had the coding abilities to make my own demo. Instead I took the seed funding I received and hired people to do it for me - long story short things didn't work out; I lost money and disappointed people.
The author of the aforementioned post recommends that noncoder founders should: "Take 6 months off and go learn how to code (day and night, weekends including)." This is what I would like to do but I am unsure as to how to begin. Sure, there is a wealth of sources but I am unsure of which ones are quality sources and also what languages to learn first. I am not trying to be a coder or hacker overnight and my approach is methodical: I will devote 8-10 hours per week to learning. I generally pick up things fast; the key though, is having interesting problems to solve which increase in order of difficulty.
If anyone can give me a few pointers on how I can start learning (what resources are good, what language to begin with, a good program of studies) that would be much appreciated as it would help me develop my future ideas on my own and would probably also help with my research. I thought a cool initial project would be an applet which queries each line of a word document with book titles (I keep a running list of all the books I’ve read, one per line in a doc) and searches the net for a picture of a book cover and imports it into the app. Apologies for my ignorance but would this be a realistic project within 6 months?
Lastly, I did run a search on this but didn’t find any related threads; I apologize if this Q has come up before.
Thanks for your advice, AKD
http://learnpythonthehardway.org/book/
It's free. Do this:
1. Use your current computer. It doesn't matter if you have Linux, OSX, or Windows. What matters is that, right now, you want to learn to code, so you should go learn to code, not learn to setup a new OS.
2. Just use gedit. Don't use vim, vi, emacs, or any "hardcore" editor. On a Mac if you're using a non-English keyboard, use Textwrangler. Learning a new editor is not learning to code.
3. Start now, do what I tell you in the book. Type code in, do not copy-paste, make it run, fix it until it does, do the extra credit, then go on to the next one.
4. Other programmers will tell you to use their favorite tools, just ignore them. Just use gedit, Terminal (cmd on Windows), and python. That is all. Nothing else. Everything else is a distraction.
5. Finally, do it every night, for 2 hours a night, and take a break on one day. You'll be surprised how quick you can get through the book, and you'll get stuck sometimes, but keep doing it.
After that, move on to other more advanced topics and try to learn more stuff, but for now, just do this.
I have heard that when done with the book, I still won't be able to program in Python. Can you elaborate on that?
Also, what do you recommend after completing your book? I'm interested in building web apps.
When you're done with the book, I say you can't really code yet because you lack experience actually using Python. You have all the syntax and tools, you just don't really know how to apply them. What I recommend now is you go through the Django Book 2.0 and do all the code in that book. Once you do that you'll have enough to start building your own stuff.
I'd also say, whatever you make will probably suck for a while, but that's alright. Just keep making stuff, put it out there, get feedback from good coders, and improve.
Be careful about whose advice you take. There are a lot of programmers out there who are so far down the road to perfecting their craft that they can't see where they started.
For a mature programmer, using powerful tools will aid them in expressing their complex ideas quickly. As a beginner, you'll experience a ton of "ah ha!" moments where an idea will come to you in code, rather than in abstract. It will start simple with data structures like dicts and will progress toward object-oriented structures.
To say you won't be able to program when you finish LPTHW is to say that a 5th grader can't write. They're not going to write "The Great Gatsby", but they can write.
As per the Windows vs Linux debate - I have found most physics labs use either various Linux distros (Red Hat is super popular) or OSX. I myself have a MacBook Pro running OSX and so I just downloaded and will be using TextWranger as an editor to complete the lessons.
Why waste time messing with it? In the time you spend fucking around with Windows, you could have set up a Linux system. And Linux is the OS more commonly used by startups and physics labs (which is why the OP wants to learn how to program).
Try Google App Engine to get started so you don't have to worry about dealing with a server. Start here http://learnpythonthehardway.org/
Find a copy of http://oreilly.com/catalog/9780596801601#toc for understanding basic ideas with HTML, CSS, JS and Python/GAE.
In the meantime, start a blog and write about your stuggles and the things you learn. Initially it won't really be about coding - but the main thing is showing momentum to the outside world. (Trolls will hate just ignore). By getting your name out there, people will be more interested in helping you.
Start there. If you have questions, my email is emile (at)
Break it up into steps. First write a program that opens a file, reads the book titles and displays them on the terminal. Then write a program that makes some sort of network connection; maybe download the HTML contents of a website. Etc., etc., until you've learned how to do the various subtasks involved with your project, and then assemble it all together.
I'd suggest that Python would be a good language to start with. I personally like the O'Reilly book Learning Python, though there are many options.
plug: It's the tack that I took when writing Quick and Easy Python (http://manning.com/briggs/) - small bits, building on each other.
So: code as much as possible. As soon as you can possibly stand it, look into MPI4py and start parallelizing your code. Chances are you won't be working with python in HPC contexts, but learning parallel programming at the same time as C or fortran would be needlessly difficult. I would also try to get time on a cluster as soon as you're in a position to use it respectably. Most universities with HPC facilities have an online application for an account, and some sysadmin might take pity on you :) Otherwise, maybe Amazon has some kind of deal?
In the interim, become _very_ comfortable with bash and general command line fu, and a serious text editor. Good luck!
* assignment/sequence
* recursion
* concurrency.
Most students never master the first, and most of those never master the second, and so on. In that spirit, I would recommend that the OP firmly grasp the first two with both hands before reaching for the third. Of the languages the OP could study that treat concurrency or parallelism as a kind of conceptual primitive (e.g. Scala or Erlang), none are likely to appear as working languages in an HPC milieu. Almost always, the libraries are bolted on as an afterthought to traditionally popular languages for scientific computing.
I think this is a regrettable pattern, but a pattern which will shape the OP's daily work if they wish to begin (and remain in) a program in computational chemistry.
All I meant to suggest is that when the OP begins to learn parallel computing, they want to be thinking about parallel algorithms, not segfaults or pointer purgatory or the finer points of scp or vi. The sooner the former can be mentally sublimed, the better the OP will feel about HPC.
If your ventures are web apps, my recommendation would be to learn Ruby on Rails. You will be able to build demo apps within a few months of 8-10 hours per week.
I started with RailsTutorial.org, which is a free book that will take you from installing Ruby to building a twitter clone. From there, get a few books, I recommend Agile development with rails and The Rails 3 Way, and continue to work on some smaller apps. There are also great screencasts you can find by searching for "railscasts."
If you are using windows computers, install Ubuntu Linux which is really easy with Wubi. I have found it makes things easier. If you have a mac, stick with it.
For text editor, I use Sublime Text 2, and if you're on mac, just go with Textmate.
Sign up for Github and learn about version control. Also, go through projects on Github and learn by reading other people's code.
After you have a semi-grasp of the basics, start building something substantial.
Search Stack Overflow when you have questions, and if you've been trying to figure something out for over six hours, ask a question on Stack Overflow.
For html and css questions, I generally just google any issues I have and fool around in firebug, which is a firefox extension that lets you edit html or css and see the changes on your screen.
Best of luck!
I started with MIT OpenCourseWare. I was very fortunate to find this lecture series: http://www.youtube.com/edu?edu_search_query=intro+computer+p... because it is class taught at MIT for students entering the CS or engineering programs that have little or no background in Programming Languages.
Hint: Pay attention in the first and second videos close enough and you'll learn how to locate online resources that are provided to the enrolled students.
That may come across like a smart-ass answer, but it's not. I'm in the same boat, and I'm learning the same way. I've got a Mac dev environment, and Linux dev environment. I'm using a book by Stephen Kochan, and another by Dave Mark.
We're surrounded by a plethora of materials to help us learn.
Just do it! Pick one up and read, and write some code. Stumble through. You will make mistakes.
See emilepetrone and @housefed for a good example of this. He posts on here all the time. He's only been coding for a year, and has a functional website.
If you're used to and good at learning in a school format, MIT OpenCourseWare is excellent. My friends also liked the videos better than learning by book.
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
I would go in this general order for beginners. Do all the assignments, and don't cheat. Ask for help on explaining the solution. These courses help in building good fundamentals, then apply what you learn to a personal project.
1. 6.00 - Introduction to CS and Programming (Python)
2. One of: 6.087, 6.092, or 6.096&6.088, (C, Java, C++) respectively.
For scientific computing, pick C and/or C++.
3. 6.046J - Introduction to Algorithms
From there, 6.001, and perhaps the database course (I think experiencing databases is much easier that a taught course)Doing #1 already goes a long way to your proposed project.
That's not to say the tutorial/source would be completely unrelated, but it sounds like from your post, that coding isn't something that comes easily which means that in order to make the leap to something that you actually want to do, you'll need more than a book to guide your way.
The great thing about a mentor is that they (should) will have a real life problem for you to solve and they can help you work through some of the subtleties of the problem.
I used to think that anyone can learn to code (this was when I was 18). I find, now, that there are people that are more naturally inclined to it and some people that will never be able to, because their brains don't work that way. I would gently encourage you to be open to discovering where you lie on that spectrum and not to be too disappointed if you've tried but still find yourself swimming in molasses.
As for specific languages to learn: startups in particular seem to love Ruby, but honestly, they all work the same way, fundamentally. I crashed through the basics of Ruby in a week, started learning JavaScript, and stopped shortly after realizing that the majority of it was the same code just written differently.
++ to keeping a journal. It keeps you in check, because even though you say will will devote so much time a week to it, you won't. I had to start setting personal goals on a daily basis. That drive alone is helping. Keeping a blog is great for peer support too. I don't get many comments on mine, but it definitely feels good when someone stops by to say, "Hey, this is cool stuff."
Hope that helps, and good luck!
When I was trying to decide what to learn I narrowed the search down by just heading to the book store and flipping through some books on various languages. Ultimately, I ended up with a choice between Ruby and Python. I couldn't tell what the major differences were, so I just decided to pick Ruby. I figured that there was no real way of recognizing the nuances of ANY language until I actually had one under my belt and could better understand what makes each one tick.
I'm fully aware that this was a somewhat cavalier method of choosing the pal I'd be spending the majority of my waking hours with, but I think that starting anywhere is better than stalling because you can't decide.
So far I'm satisfied with my choice. I think I would have been satisfied with Python too.
A lot depends on which language is going to be helpful in your computational physics class: you should find out which language they'll expect you to work in.
So I guess from my experience: - Find a single good source or book for tutorials and learning. Its best for the coding style and teaching style to be consistent. I used a fantastic series of free video tutorials produced by the Walker Brothers, which included 3 entry exams, and a series of lab assignments after each tutorial set. I had to submit the work in order to get access to the next set.
- Find a good Q&A source like Stackoverflow, forums, or a site more specific to what you're coding in. When you get stuck or don't understand something, go and ask (search first). +1 if you have programming friends to ask too.
- Keep a journal (really!) on Google docs. At the end of the night, you can quickly re-hash what you learned (cs concepts, or cool functions you learned), or often write out the things you don't understand. That way, when you start up again, you can do a quick review on where you left off and get back to figuring out things you previously were stuck on.
- Try not to skip past things you don't understand. If you don't understand them, take the time to practice out the code, or look up documentation. A big key point: its always worth it to invest the time to figure little problems out. I once spent 3 hours trying to get some timer controllers working just perfectly the way I wanted. They were actually OKAY to begin with and I was considering skipping past it for the sake of productivity, but in hammering out the problem, I gained confidence and had the satisfaction of solving a problem.
- Get your things WORKING! As beginner programmers, our first concern is making what we want happen. Not pretty code, not computer science theory. Just results. Getting results fast gives you the confidence to try harder things, which will naturally take you into the world of organized code and computer science.
Good luck!
I don't think I have any further questions - I got loads more helpful advice than I thought I would ever get and again, I'm very grateful. The only couple things I feel are worth mentioning is that I am using a Mac and I have actually written a couple subroutine packages for HPC in FORTRAN but they are nothing too special as FORTRAN syntax is very simplistic.
Since you say you have dabbled with physics, you may find this sort of method useful.
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).
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.
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.
Yeah, but programming on Windows is a PITA so I found its simpler to just eliminate that from the equation :)
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.
Everyone should learn sysadmin basics. It's not hard, and in the long run it can be handy, especially in startups with small teams.
1. Learning C-like syntax provides a basis for reading a lot of other code.
2. Javascript examples can be seen on any webpage simply by switching to developer mode.
3. The javascript console allows experimenting with code while you read about programming on a webpage without leaving your browser.
4. It is perhaps the most widely used programming language currently.
5. Even if you are not interested in the DOM and webpages, there are still interesting exercises you can do in Javascript - I recommend project euler.
As an experienced programmer with math background using a language I knew, a problem took me 15-60 minutes. Not knowing a language or how to program, it might take several hours, but not weeks.
https://secure.wikimedia.org/wikipedia/en/wiki/Apache_Subversion
https://secure.wikimedia.org/wikipedia/en/wiki/Debugger
https://secure.wikimedia.org/wikipedia/en/wiki/Profiling_%28computer_programming%29
and I believe http://perldoc.perl.org/index-tutorials.html is easy to learn for a novicehttp://www.codeschool.com/courses/rails-for-zombies
Nom nom nom...
Did you hire people with the intent of having them build a demo for you?
And for other readers... Do either of these things happen much? Does it work?
so before starting with a small project, try to implement a one person tron / snake game in processing - it helps you to start "codethink".
after that i would recommend reading a shitload of books. if you are into mobile apps, try http://ofps.oreilly.com/titles/9780596805784/ it's basically a tutorial for making a simple web app in HTML, css, js with no prior knowledge required.
Now for a language recommendation. I am a Ruby programmer, so I've got a pretty heavy lean towards that.
Ruby is an exceptionally easy language to learn. There's a book called Learn to Program written by Chris Pine (http://pine.fm/LearnToProgram/) which is an amazing beginning to getting into Ruby.
Past that, there's the Well-Grounded Rubyist by David A. Black (http://manning.com/black2) which covers all the things from basic Ruby up to medium-advanced levels of Ruby). There's also Programming Ruby 1.9 by the Pragmatic Programmers (http://pragprog.com/titles/ruby3/programming-ruby-1-9)
If you want to brush up your Ruby skills, the Ruby Koans (http://rubykoans.com/) are also pretty good.
If you're looking to get into web development (well, you ARE on the internet!) then I would recommend learning HTML and CSS with a book such as HTML 5 and CSS 3 by Brian Hogan (http://pragprog.com/titles/bhh5/html5-and-css3). Then a good JavaScript book, perhaps something like JavaScript: The good parts (http://oreilly.com/catalog/9780596517748).
After learning as much of those as you can, familarize yourself with Git by reading the Pro Git book by Scott Chacon (http://progit.org/), or if you choose another version control piece of software (Mercurial, Bazaar are good, SVN isn't and CVS is (I'm pretty sure) the work of demons).
Ah and before I forget, I've got The Developers Code (http://www.thedeveloperscode.com/) bookmarked for late-night reading and I'm quite enjoying it so far. Quite a lot of lessons in there that I have learned over my brief career, but ones I knew from the beginning.
One more final thing: you are new here and people will treat you like that. Be nice to them and they will be plenty nice back. Respect the fact that they have limited patience and may not wish to answer your questions eternally. They may also have other people asking them questions at the same time you are, or have other things they would like to be doing.
You will get better with practice. You show a keen want to learn, which is a great start. Never give it up. Nothing is "too hard" forever. Persist, and for the love of god, practice.
I spent a year working in high performance computing at a university and so much ugly and inefficient code was written in matlab. Had they written it in python, it would have been much easier to optimize and their research would have been much more productive.
However, I would suggest that Python is probably a better beginner/learning language than Ruby. There are many odd ends in the Ruby language that might easily trip an inexperienced coder up.
I've been opening Miami Ruby Brigade meetings with these, recommending them to non-pro-Rubyist friends, and did them myself last week. They're a really great exercise.
A fairly good resource is Google Code University; http://code.google.com/edu/
In particular you may want to start with Python basics; http://code.google.com/edu/languages/google-python-class/ind...
Project Euler. Though the difficulty tends to sort of spike all over.