Bacona Design

My teaching method

Instructors give students one line examples while teaching a programming language. Those are good for learning syntax, but they do not teach programming skills. My method has you reading examples, using those examples, then I describe each function in detail. When you have run the code, and have read about it, do the assignments where you write code. The more code you write the faster you will learn. Once you have completed a few problems, dig a little deeper by reading the rest of the material in each lesson.

An artist is trained by drawing as much as possible. Simple studies of objects, with various lighting effects. Then the students copy works of great artists. Eventually, they have drawn enough to develop their own style. The same with a carpenter, whether they build houses or cabinetry. They learn the tools and start with simple projects. They copy patterns until they develop their own furniture, or housing, designs. I want you to create tools from those I have given you. Find and read code to see how it is written. Notice the patterns, so you can describe the application in only a few sentences. Learn to construct applications in large chunks then refine the details. Use the examples I have given you as a base. Take them apart then rebuild them to your design. Break them, debug them, fix them, add to them. Keep writing code until you develop your own style. Keep refining, and adding to, your set of tools. Building, using, and rebuilding your own tools is vital. You know how your tools work, so you can construct larger solutions, by putting them together into an application you will use, as well as sell.

Why C? Why a compiled language, when all the rage is scripting code for the web? It is a way of training your mind to think in modules and functions. It lets you know where you are in memory. It also forces you to think about cleaning up memory after you release it. Nothing precludes you from writing C code which accesses the web, via one of those scripted languages. Then you will have the best of both worlds. The absolute control you have on a computer with compiled C/C++ code, and the freedom to roam the web with scripted tools. Interfacing them is not too difficult. While you cannot create a compiled app to run across the web, you will learn much of what you need to know, to do so with Java. Once you have learned the functions and modules of C, working in Java is fairly easy. In fact, many languages are based on the very same forms you will be learning here. I do not think you will waste any time by learning C problem solving techniques. In fact there are many examples available, and a wealth of code on academic web sites covering many esoteric subjects. It is nice to know all that code is available, even if you want to work in some other language.

I wrote these lessons for three types of students. If you are starting from scratch, you will need to read these lessons, and follow the links. Careful reading, working the assignments, and frequent review is best. When you have finished Section one I suggest you repeat the process, to find what you missed. There is a lot of material to learn, and you cannot expect to understand it all completely the first time through it.

The next type of student is one who has taken a class in programming. They understand the language, but do not yet understand how to create working applications, which solve a problem. This course is ideal for those students. Work through Sections one, two, and three at your own pace. Slow down where needed, or skim over lessons you will not use for a while. Sections one and two are fairly basic. Both of them cover tools, one is for command line applications, and the other is for simple, graphics applications under a Windows OS, or by using wine, under Linux or on a Macintosh computer. Section three covers many different algorithms, using command line tools. The algorithms discussed there are used for lessons in Section four. Section three has a few artificial intelligence programs, while sections two and four have applications using genetic operators to solve problems. Section four has a few simulations of physical systems.

The third type of student is one who is already skilled at writing code, but wants to locate working code for a certain algorithm. I am creating an index for those students, so they can find the code they want quickly. Scan the index, and jump to the correct lesson for the chunk of code you need. Rewrite the code then test it as a command line function. When you are ready, move the functions you need to the application you are creating. The code is full of comments so you can easily copy the parts you need, along with the header files they require. The code I provide is as bug free as I can make it. Use it as you see fit. Annotate the code to state where you got it and you are fine. {BSD 2-clause license}

I hope to show the student how exciting it is to control software. To imagine a system, then create it in code. You are in control of what your code does and how it looks, just like designing a house, drawing a blueprint, then building it on site. If I develop an algorithm which I find useful, I keep rewriting it and reusing it. You will start to think about solving problems by picking functions from your toolbox. I want you to be able to use any computer with a compiler to do your work. Write your own code to solve your own problems. Modify code you find to do what you want it to do. Look at open source projects to see if you can write a module, or find a bug. I think of a computer as an extension of my curiosity. It is a tool I modify to do what I think. However, I am constantly reminded that computers only do what you tell them to do, not what you want them to do.