

How can a high school student learn to code? - gschiller

I&#x27;m a rising high school senior. I&#x27;ve studied some Python before on my own, but I want to take my skills to the next level. What should I do to practice? Any advice for an aspiring programmer?
======
jasonkester
Same thing you'd do if you were just out of college and you wanted to learn
programming. Or if you were 41 years old and wanted to learn programming. Or
if you were 13 with your first computer.

Build something.

Scrape together seven dollars and register a domain name, then sign up for
AWS' Free Tier and figure out how to get a simple website up and running on an
EC2 instance. At that point, you're officially just as capable of building a
software product as anybody here.

Figure out what you want to build (starting with a small idea would make
things go a lot smoother), then learn the things you need to build it. Django
would seem a logical choice since you already know Python. But Ruby is pretty
much the same language, so you won't have any more trouble getting up to speed
in Rails. It doesn't really matter, since the real skill you're learning is
"building things".

While you're at it, you should probably Derek Sivers' "No Speed Limit" piece
([http://sivers.org/kimo](http://sivers.org/kimo)) to make sure you realize
that there's no requirement to crawl along at the same pace as the terrible
comp-sci classes you'll have available over the next half dozen years. If
you're determined, you might find you're really really good at this stuff by
the time you graduate high school.

Good luck!

------
mindcrime
I kinda think that everyone learns differently to some extent, and that there
isn't one universal "best way". So what worked for me, or anybody else, might
not be right for you... so take this with a grain of salt.

My preference is to just pick a project and start hacking, and force yourself
to learn what you need to know to complete the next step of the project. I
think it works better if you are actually enthusiastic about the project, but
just picking something "at large" to have a focal point is fine.

It doesn't have to be something big and elaborate, especially in the
beginning. You don't need to say "I'm going to write a Facebook clone" right
away. Start small, but grow it as you learn.

Maybe you just want a program to randomly generate D&D characters or
something. Fine. Write that as a command line program. Then come back and slap
a UI on it using wxPython.

Later, port it to being web based using Pylons/Pyramid, Turbogears or
whatever. Once you have a web based version, add login/logout, multi-user
capability, user profiles, an activity stream, a REST API for external users,
XMPP notifications, etc., etc., etc.

Then build an Android app version that uses the REST API.

Anyway, you get the picture. Just starting building and "jump in over your
head" and force yourself to learn as you go. Go to the reference material,
Google, Stack Overflow, mailing lists, whatever, if and when you get stuck,
then build some more. Lather, rinse, repeat.

That's more or less how I've learned most of what I know about programming,
other than a few times when I just decided "I want to learn X" and picked up a
book on it and ran through the example code and read the book... but
inevitable I get to a point where I need to actually take that and try to turn
it into _something_ tangible.

Like I said, this approach may or may not work for you, but maybe give it a
shot and see how it goes.

------
seryl
Hey gschiller!

I'd suggest learning a little software engineering, it'll be invaluable to you
later on. Organizing the way you develop your code is pretty damn essential to
tackling real-world projects.

If you're already building simple tools and apps there are a couple of things
you should really master.

    
    
      * Version Control [1][2]
      * Packaging python eggs [3]
      * Command line parsing [4]
      * Configuration [5]
      * Documentation generation [6]
      * Unit Testing [7]
    

If you can get comfortable with the above concepts and tools before you're
deep into school, you're going to be head and shoulders above most of your
peers.

First, setup a github account if you don't already have one. Make sure you're
committing your code, keep a history of small, succint changes. Learn
branching and merging!

As the others have suggested, pick up a project! Whatever you want to build
(this keeps it interesting) and integrate in the above tools. Set it up as a
package, give it cli options, have it load a default config file if it exists,
or use sane defaults. Document your functions; you'll be spending a majority
of your time reading code, so make it useful for others.

Most importantly, get yourself some unit tests. Build your application one
function at a time. Test it with nose. After it's doing what you want, commit
the changes in git, push to your github branch, and onto the next one.

If you're having issues with python in particular, pickup an irc client and
join #python on freenode. The community there is pretty excellent and if
you're at a difficult point, it's likely someone can point you in the right
direction.

Lastly put together a blog. While you're going through all of this, document
what you're doing. Put together a couple things you learned when you tackle a
difficult problem. Write about what things you had the most trouble with. This
will pay back for you two fold; you'll reflect on the material which will help
your understanding, and you'll also be setting yourself up for success when
you're ready to either start your first internships or jobs.

[1] [http://git-scm.com](http://git-scm.com)

[2] [https://github.com](https://github.com)

[3] [http://www.pip-installer.org/en/latest](http://www.pip-
installer.org/en/latest)

[4] [https://github.com/docopt/docopt](https://github.com/docopt/docopt)

[5]
[http://docs.python.org/dev/library/configparser.html](http://docs.python.org/dev/library/configparser.html)

[6] [http://sphinx-doc.org](http://sphinx-doc.org)

[7]
[https://nose.readthedocs.org/en/latest](https://nose.readthedocs.org/en/latest)

------
WestCoastJustin
I think it depends on what you want to learn. If you wanted to learn Ruby on
Rails, then I would highly recommend the Ruby on Rails Tutorial [1]. It is
about 15 hours of hands on videos and labs, which will help you create a
working application. You can also check out RailsCasts [2], which has many
hands on videos. Or get a subscription to Safari Books Online [3], where you
can get digital copies of the latest technical books on many many topics. You
can use these to teach yourself pretty much anything technical. I cannot
stress this enough. Get used to reading a book and teaching yourself the
topic. Over your career you will need to be continually learning, the sooner
you understand this the better!

Zed Shaw has a site called _Learn Code The Hard Way -- Books And Courses To
Learn To Code_ [4] which look pretty good. I have never downloaded them, but
from what I've read they are hands on labs which teach you Python, Ruby, C,
SQL, and Regex. Worth checking out.

I would also highly recommend learning Linux and/or Mac. Just download
virtualbox and play around with linux (ubuntu is pretty friendly). Most
programming jobs will be simplified if you at least understand Linux and you
know how to get around the command line via ssh.

[1] [http://ruby.railstutorial.org/](http://ruby.railstutorial.org/)

[2] [http://railscasts.com/](http://railscasts.com/)

[3] [http://my.safaribooksonline.com/](http://my.safaribooksonline.com/)

[4] [http://learncodethehardway.org/](http://learncodethehardway.org/)

------
drygh
I have been programming for about a year and a half. I am now in college and
am developing a web application for my start up. I think "getting to the next
level" is often a big problem for those teaching themselves programming. There
seems to be a plethora of resources available to beginners, but not as many
"intermediate" lessons.

My suggestion is to pick a category - whether it is games, web development,
mobile, etc - and start a project there. As others have said, dive in over
your head. Take it one step at a time, it will be slow at first. No matter
what you are doing, utilize search engines and Stack Overflow. They are your
best friends. Don't worry if you use a framework and feel completely
overwhelmed at first - it's normal. Also, learn Linux. It will make your life
easier, and give you a better understanding of how operating systems work.

Lastly – just some general advice about something I have learned. You will hit
some rough patches where you spends hours or even days on something trivial.
This is part of the learning process. Becoming a better programmer means you
organize your projects differently, and you learn how to debug more
efficiently. Something cool about this though – sometimes you have an error
and try 10 different fixes. None of them work. This is not wasted time – you
just learned 10 new things, and chances are next time you will be able to
debug a little bit more quickly.

------
csense
> What should I do to practice [programming]?

Write programs.

> Any advice for an aspiring programmer?

Debugging programs is a big part of how you learn. Don't be afraid to put
print statements in your program to see what the values of variables are at
various points in time. Don't be discouraged when something doesn't work --
any good programmer has spent hours or even days finding and fixing a bug
that's turned out to be trivial.

Don't be afraid to throw out a project and start over. Your second attempt is
often much better than the first.

Learn version control. Git is the de facto standard, and if you master it, it
will improve your productivity greatly as your projects get larger.

If possible, find someone online or in real life who's also interested in
programming, you can bounce ideas off each other and work together on
projects. It's sometimes easier to get and stay enthusiastic about a project
if someone else is relying on you to make progress on it.

------
zachlatta
Hey! I'm a high school student myself. I'd love it if you could shoot me an
email at zchlatta (at) gmail.com. It's always nice to meet others who share my
interests.

It really depends on your current skill level. I'd recommend setting a goal
for yourself to reach. Say you're interested in game development. You could
set the goal of learning pygame[0] before the next Ludum Dare[1]. If you're
not comfortable with Python itself, you may want to check out Learn Python The
Hard Way[2].

[0] pygame -
[http://www.pygame.org/news.html](http://www.pygame.org/news.html) [1] Ludum
Dare - [http://www.ludumdare.com/compo/](http://www.ludumdare.com/compo/) [2]
Learn Python The Hard Way -
[http://learnpythonthehardway.org/](http://learnpythonthehardway.org/)

------
mathattack
All great advice here. I would toss in that you should make sure that your
topic is fun, and interests you. (There's plenty of time for boring work later
in life!) If you like games, create a game. If you like Math, visit
projecteuler.net.

If you are interested in potentially majoring in Computer Science in college,
take Udacity, or look up Harvard's CS50 for an idea of what you'll be getting
yourself into. It's tough to major in CS without having some comfort with
programming and (more important!) patience with debugging when you arrive on
campus.

------
crimezone20xx
Scour code that you find interesting and write a piece of software.

The best advice I was ever given was to think small and in terms of "pieces"
or "parts" of a program as a whole. Write something that doesn't do anything,
well...for lack of a better term..."useful".

Don't think too grand when you're just getting started, though. That's not to
say don't dive right in, but take it simply at first. A few lines at a time.

------
wturner
If you are into audio stuff you can do what I did and learn Javascript within
the context of building little sound generators and audio file sample trigger
players. I now understand a good amount of DOM manipulation,CSS,semantic HTML
and Javascript patterns as a result.

------
future_grad
Create.

It takes knowledge to build correctly. By creating you will end up pushing
yourself into a cycle of learning and production.

Your willpower will fuel your creation; harness it.

Never be ashamed to ask, be ashamed for not having the courage.

------
tekknolagi
Definitely check out Codecademy, read the Learn Code the Hard Way series for
languages you want to learn, try and make some tiny utilities for things you
need (example: python Twitter client from the command line), etc.

------
lorenzopicoli
Yes, create is the most important part. I learned most of what I know taking
online courses from Stanford or Coursera or lynda.com

