Programming tasks: design principles |
Top Previous Next |
This seems like a good point to summarize the three main ways of designing a multi-chamber control system.
1. General-purpose language with hardware-specific extensions
Example: Arachnid.
Pros:
Cons:
2. Custom language designed for operant chamber control; software runs user tasks 'inside' the server
Example: Med-PC®.
Pros:
Cons:
3. Server and clients are independent programs
Example: Whisker.
Pros:
Cons:
Comparison
Options 1 and 3 may entail a choice of programming language (though some examples, such as Arachnid, limit you to just one language). In this situation, there are three considerations: how easy the language is to learn, the merits of the language itself, (including whether it is interpreted or compiled), and how useful the language is applications outside operant chamber control.
One of the main dangers of using an interpreted language like BBC BASIC for operant chamber control is that typing and syntax errors may not be discovered until the task crashes with a rat in the box. Compiled languages find all those kinds of bugs before you ever run the program. I strongly recommend the use of compiled languages for all but the most trivial programming tasks when it is very important that the program does not crash.
(My [RNC] favourite is C++, the language the Whisker server was written in. C++ is one of the most popular languages world-wide, and for good reason. If you choose to learn and use C++, a fringe benefit is that you will become skilled in a general-purpose programming language, and computers everywhere will become your slave.)
The principle 'con' of Whisker's approach is that the user must develop some minimal programming ability in the chosen language. I have attempted to reduce the programming burden by providing libraries of code for different programming languages, so writing a task becomes a more a matter of filling in blanks.
|