Ask HN: How did you learn to program?
So currently i'm interested in learning how to program and what resources are the best for a beginner.
Some info : 23 years old, doing tech support for hosting company mainly having customers using *nix.
How did you learn to program and what resources did you use ?
12 comments
[ 2.8 ms ] story [ 31.3 ms ] threadLater on I was struggling through college, switching majors every semester and was running out of time to pick a career. I had no partcuarly strong interest, but I knew I wanted a challenge, so I went into a computer related degree. I am now happily employed 5 years into a career in SWE.
To summarize I taught myself to program through whatever resources I had available to me in response to problems that programming could solve. The internet is vast, if you want to learn you will. Don't just rely on the information, reach out to the people for advice, ie find mini-mentors.
After that I started editing perl cgi scripts. Then I started making my own web apps with perl.
Then I started using CSS with HTML and then Javascript to write my app code.
But... if I were to start now I would buy a Raspberry Pi computer (or two or three) and start taking advantage of all the resources available to learn using it because most of what you'll learn can be used across platforms and the resources are amazing.
https://www.raspberrypi.org
You don't need to go to college to learn how to program though. Programming is just feeding a computer instructions. Since you are working with customers on *nix, that is a place to start. Start small with things like looping over a directory of files and outputting the name. This could be done in Bash. You could pick nearly any programming language and it will have File/IO libraries that allow you to traverse a directory. Sure you could just use "ls -l" on a command line and you should to compare your results. Start small, learn different ways to loop over things. Read docs.
Its much easier to learn when you have some knowledge of the context you are learning in. Tech Support leads somewhat naturally into more of System Administration, which can have a fair amount of programming, mostly for automating things.
My earliest motivation wasn't to write games, it was to hack games instead, for infinite lives, etc!
For people today, if they're going to be more self-taught than going to school for programming, I often recommend Python. It's very straightforward, usually does what you expect, and the documentation on the main site is fantastic.
Use it to scratch your own itches and python is on nearly every OS outside Windows by default.
If you're interested in web stuffs learn Javascript. I'm not a fan of it, I have my reasons, but it is available on every computer today and has a huge ecosystem of libraries for you to use.
My parents got me a Commodore 64 when it first came out. I had a tape deck to save stuff onto. When you turned on the machine you were at a BASIC prompt. It came with a manual that had some simple programs in it. One of the programs drew a piano keyboard on the screen and mapped keys to keyboard keys to let you play. I remember going through the code and changing values just to see what it did. That kind of got me started on programming.
We subscribed to a few magazines (Family Computing, BYTE, etc) that would have program listings in them, which I would sit down and type in. I would then go through the same process. What happens if I change this peek or poke command? What is GOSUB doing? What are all these numbers in the DATA section?
I got to the point where I could write my own programs, including a couple simple games using sprites and joystick controls.
I enjoyed it enough that I'm still a developer now at the age of 46 and plan on doing it for as long as I can.
My suggestion would be to examine what you know about yourself. How do you personally learn best? Is it in a formal classroom setting? Is it by watching videos? Reading books? By picking up a project you want to accomplish and then progressively figuring out what you need to know to finish it?
That can help you determine whether to self-teach, join a bootcamp or MOOC, etc, and what type of resources to look for.
Advice: Start with a high level programming language like Python or Ruby. Google to your heart's content.
Everything can be learned in a course or on a book, but creating something that you really need and care about is the easiest way to get exposed to the details that matter.
As for the question, I learned programming in Pascal at 12 so way over 20y ago. At the time I was playing a lot of role-play games and I wanted to automate "battles": rolling dies, looking up tables related to the damage inflicted, etc. I didn't have Internet, I learned from help and a manual.