03. Flow of logic

So, before we just dive into programming there’s an important concept we need to know first. You might recall back here I mentioned that the choice of language really doesn’t matter. This is because programming involves logically approaching problems. Every computer language ever written (and let me assure you there are hundreds) must follow the same basic rules of logic. So while each language might use different words and achieve outcomes in different ways they all follow the same rules of logic.

Because of this, all programs can be represented in a flow of logic. There are a few ways to show this but one of the most common is a flowchart. You’ve probably seen a flowchart before, here’s a really simple one:

A simple flowchart

An amusing flowchart that solves all problems

The flow of logic starts at the top and works it’s way down until you reach the end. Every time you hit a diamond, you answer the question within and continue along the path.

Learning how to structure a problem into some sort of flow of logic like this means that we can understand the solution before writing a single line of source code. This separates the problem from the implementation and is a very useful starting point for any computer program (particularly large ones!)

There’s a good chance you’ll be required to make your own flowcharts at some point and so I suggest you grab a copy of yEd. It’s a free graph editor that can do all sorts of graphs, including solid flowcharts. I’ve used it with all my examples in this tutorial and I can assure you, you’ll find it easier to use than any Office program!

Leave a Comment

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>