So far, we have learned a lot about programming. I have summarized some of this in one picture:
- A program is implemented in code.
- Program code is a sequence of statements, executed by the computer one by one.
- A program has a start. Some code starts immediately when you start the program (e.g. in Scratch), other code starts at an event, e.g. a click on a button or a message from a server (e.g. chat server).
- A program uses variables to keep it's state, e.g. the list of moves in the 5-in-a-row server.
- A program uses functions. Functions can structure the program, by breaking down the code in smaller pieces or by defining objects. Functions can be used from libraries, that is code we didn't write ourself.
- A program can use a database, to store data permanently. Variables in a program are lost when the program ends, data in a database isn't.
- A program can run in one or more threads. The Arduino programs are single threaded, all work is done in one loop. The Scratch programs are multi threaded, all sprites have its own subprogram running, in parallel.
- A program runs in an environment, such as a web browser, a web server or an Arduino board.
- For program development, many tools and methods exist. One tool, we have used is the Arduino IDE to load programs in a board. One method, we have used is incremental design.
If you understand all this, have read the referenced material (like the the w3schools articles) and have experimented yourself with all examples, you know a lot about programming. Well done!
Of course, there is much more to tell about programming:
- There are many different programming languages, all with their own set of statements and standard functions. E.g. Java, C++, Objective-C, COBOL. For a large list of computer languages, see http://www.helloworldexample.net.
- There are many environments, for which you can write programs. E.g. Windows computer, Apple computer, Linux computer, iPad, iPhone, Android phone, Android tablet, Google AppEngine, Amazon Web Services, Arduino.
- If you are working (with many persons) on large programs, you need additional tools and methods. Before you start writing your program, you make a description of how the program (and its sub-programs) should work. You can do this e.g. with Unified Modeling Language (UML) , or Archimate.
- You can do your programming with a text editor, like WordPad. But for programs that are larger then a few hundreds lines of code, you should use an Integrated Development Environment (IDE) like Eclipse or XCode.
- When you (and others as well) update a program regularly with new code, you need a version control system, such as Git.
- In our "software project", we started with a list of requirements. All these requirements are functional requirements, they describe the functions of the program. For complete systems, we will also have non-functional requirements, that describe the qualities of the system. E.g. how secure it is, how fast it is, how many clients it can serve at the same time.
- Etc. etc.
Have fun with programming!