Teaching the Basics of Programming to Domain Experts
We always tell potential domain-expert users of DSLs that we don’t want to make them programmers. But we do want them to use DSLs. While those are of course tailored to the domain (abstractions, notations, analyses, tooling), using these languages does require to be able to think, to some extent, like a programmer. This is crucial to make the DSL approach a success. It’s not really a revelation: in almost all domains, computers are getting more prevalent. And there is an increased requirement for professionals in all domains to communicate with computers. They don’t have to become professional programmers, but they have to understand some of the same ideas and concepts as programmers.
So how do we teach them to think a little bit more like a programmer?
The draft of a tutorial
To address this issue, I
started writing a tutorial that
explains the basics of (so far) functional programming, because functional
programming is at the heart of almost all of our DSLs. Things like values,
expressions, collections, decision tables or records, in some shape or another,
are found in every non-trivial DSL.
This tutorial is quite different from a regular introductory programming course: first, it does not try to teach you a particular programming language. The language used in the tutorial, KernelF, is not widely used (outside the DSLs we build for our customers). But it embodies many ideas and concepts you will find in essentially all programming languages used in the real world. So I want to teach these ideas, not the particular language.
I don’t want to teach sophisticated algorithms. I don’t expect domain experts to become a “performance optimizer”. or to think about scalability or throughput; the language design and runtime must ensure these properties. I don’t even expect them to be able to build their own sophisticated abstractions and reusable libraries. I do want domain experts to become a competent user of high-level languages, possibly languages.
The tutorial ignores many of the typical programmer tools, and in particular, compilers. Everything is executed in an interactive, live environment, with as little hassle as possible.
Finally, the tutorial start with something everybody is familiar with: Spreadsheets. I assume that everybody knows Excel and its brethren.
Who exactly should read it?
Honestly, I think in today’s world, literally everybody should understand these concepts. It makes you more competent in almost every case where you have to use a computer. More specifically:
· You are a professional in domains such as finance, healthcare or government, and you want to be able to create executable representations of business rules.
· You are a domain expert in essentially any domain, and you want to productively communicate with software engineers
· You are an engineer and you are “forced” to effectively become a programmer, because your tools of the trade are essentially software tools
· You are a student in probably any field except the humanities
Where can I find it?
You can find it at https://markusvoelter.github.io/ProgrammingBasics/ and the associated Github repo.
What is the status, what is missing?
I wrote the first eight chapters, covering what I think are the basics that everybody should understand. The text is raw, there will be bugs.
All the examples are implemented with the KernelF language inside the the Jetbrains MPS language workbench, but I have not yet made the code easily accessible (I will, of course). This also means that the little src links next to the code examples will not work on your machine.
What is also missing is a set of exercises, and perhaps even VMs in the cloud users can launch to play with the examples. I am thinking about a part three that looks at things like modularization, contracts, inheritance, separation of concerns and the like.
I need your help!
I need feedback on whether you think the idea works. I would like concrete suggestions of what to change, or reports about bugs in the tutorial. I am looking for volunteers who might want to help with the exercises and the setup of VMs and stuff. And if you know of members of the target audience who might want to try this out on themselves (once we have polished things and have exercises) I’d love to hear suggestions. I would love to make this a community effort.
If you want to join the project, write an email or reply in the comments here.