Programming
Sections in this page
Free guides to JavaScript language and techniques
Click on the images.
-
For beginners: how to start creating graphical games to run in browsers. This introduces the basic syntax of the JavaScript language and how it works in browsers using canvas elements. It also covers some techniques for developing programs, not just understanding syntax.
-
At the next level this guide concentrates on how to develop a card game, using object-oriented techniques to make a maintainable structure for a largish project.
-
Then here is a more general introduction to the JavaScript language. It does not include recent additions to the language but once you are fluent in these basics you can more easily go on to add more recent syntax from there.
A very different language: Java
There is also a Java course on this site. It was last revised in 2010 but nevertheless it is still a valid introduction to the language.
Java is totally different from JavaScript, which thoroughly confuses many people. A major difference is that it is much stricter about object types. That is a good thing because it helps to eliminate mistakes.
My course is still valid but a few things should be noted:
- The first thing is which version of the JDK (Java Development Kit) to use. I recommend version 8. Although Java is now up to version 24, as I understand it the later versions are aimed at commercial users paying Oracle a fee for support. Java 8 is the version that enables everyone to get a JRE (Java Runtime Environment) for free from java.com. Java 8 is still updated from time to time.
- Java 6 introduced a new package for handling files: java.nio. I still use the original java.io package myself because I had already written a lot using that. But new developers should really use java.nio.
- Java 7 introduced a better way of structuring try/catch/finally to ensure that resources such as files are properly released regardless of whether an exception occurred or not (look for try-with-resources).
- My course covers Java applets but they can be ignored because browsers no longer support Java (which I think is a tragedy).