What programming language are coding examples written in?
There are huge management advantages to using a language that has a compiler behind it so that you can test your code. A major problem with pseudocode is that there is no way to test if you got it right, either syntactically or semantically.
Nick Parlante's CodingBat (http://codingbat.com) allows students to do editing in the web browser, and then execute and test their answer, for many coding exercises in Java and Python.
The ideal language would have the following features:
- Simple to understand
- Complete enough to cover what we need
- Translatable to a real programming language so that we can compile our code examples or student solutions to verify their correctness.
- Usable by students to write the answers to simple programming questions (with in-the-browser runtime support)
Even better than a coding language is support within the system for a variety of coding languages. Currently, the OpenDSA infrastructure is attempting to be language neutral. We do this by creating a separate directory for code snippets to be embedded into a module. It is easy to set up separate sub-directories to contain the snippets for each desired language. Our configuration scripts explicitly support changing the embedded code source directories. In this way, if the text of the modules is written in a language-neutral way, changing the language of the examples is as simple as changing a line in the configuration script (assuming that you have the code snippets you need in the new language).
Of course, modules are unlikely to be language neutral. For example, that would mean not being able to refer directly to any code syntax. So we are likely to need to have some mechanism to support such alternate versions of the prose. Something like LaTeX conditionals is possible (that is how I maintain C++ and Java versions of my textbook now).