Getting Started
So you've decided you want to learn to code. That's wonderful! A great place to start is to complete some of the code.org activities. Choose ones that look fun and interesting to you. The ones marked "Blocks" are the simplest to start with. I loved doing the minecraft activities.
Once you are feeling like you would like more control over what you are making, it's time to start learning some proper programming languages. I will introduce some below.
Scratch (Games & Animations)
Instead of text, the Scratch language uses blocks of code you can click together. This makes it simple to use, but you can still make almost anything you can imagine.
- Go to the main page and play some of the projects other people have made.
- Next, go to the ideas section and go through some of the lessons to help you get started.
- Finally, you should be ready to make your own games and animations.
If you are not sure how to do something in Scratch, the Scratch wiki is really useful. Also, you can get some help in the forums. Good luck and have fun!
HTML & CSS (Making Websites)
These two languages let you write your own webistes in code! I created this website using them.
- Look at the code in the first box below. That's called HTML. It sets out the basic structure of the page. Click on 'Result' to see what this website looks like when the code is run. It looks OK, but it's a bit boring, right?
- Look at the next box. This has the same HTML, but click on 'CSS' to see the added CSS code. This gives the style of the page such as colour and font. Click on 'Result' to see what this page looks like. Better?
- On the second box, click on 'Edit in JSFiddle' and mess around with the code yourself. Maybe you could change the color? Or something else?
Let's look at three versions of another website... one with just html, one with CSS added, and one with a bit of JavaScript (see next section).
If you would like to learn how to do all of this, w3schools.com have great tutorials. They also have examples to look up if you want to do something specific to your site. You can mess around making things with what you've learnt using code playgrounds like JSFiddle or Codepen.
JavaScript (Web Games and More!)
Learning JavaScript is a bit harder than Scratch, because it uses text instead of blocks. However, you can make even more complex programs, and you can run JavaScript code in any web browser (e.g. Chrome or Firefox).
Check out the JavaScript code in the box. It might look scary, but don't panic! Click on 'result' to see what it does. Did you notice the code had a few Math.random() commands? Click on 'result' a few more times and see what happens!
Want to try out some JavaScript coding for yourself? WoofJS is a wonderful website designed to help Scratch users transition to JavaScript. Crunchzilla lets you learn the basics of actual JavaScript code you can run in any browser.
Python (Almost Anything)
Python is one of the most widely-used programming languages. It is text-based (like JavaScript), but is still set out in a simple and clear way. The box below has some Python code. Why don't you hit 'play' (top left) and see what happens? Try changing 'draw_circle' to 'draw_triangle', 'draw_square' or 'draw_star'.
Want to make a random story generator in Python (with lots of help)? Click here!