Have you taught, or did you just present to a group of people? Did your audience learn, or did they just read your words? In this issue, you'll explore how to add assessments to your content to nudge learners toward more active participation.
In addition, you'll use a command-line tool to run two background services simultaneously, so you don't have to juggle multiple terminal windows when developing apps.
Thanks to the Internet and a wide array of professional tooling, anyone with an idea to share can create content, publish it, present it, and even get paid for it. However, content alone isn't the whole story if your goal is to teach someone a new skill. Watching someone build an app isn't enough to grasp the complexities that lie within.
Passive learning is where the learner receives and internalizes information from an instructor. That's the experience you provide when you create articles, videos, and presentations that people consume.
Active learning is a learning method where learners are actively involved in the learning process. They participate in discussions and activities before internalizing what they've learned.
There are benefits to passive learning. First, it scales well. You can fill a lecture hall with 300 students and lecture to them for weeks at a time, or you can upload a series of lectures to a video platform and distribute it to the world. Second, students who are shy, have disabilities, or process information more slowly may find passive learning much more accessible.
But there are drawbacks. It's teacher-centered rather than learner-centered, meaning It's too easy to let people rely on your expertise instead of building their own. When learners don't actively participate, connecting what they've read, heard, or seen with real-world situations is more challenging. It's also not great for adult learners, who often prefer to have a more active role in their education.
If you want to make the leap from being a content creator to an educator, you'll want to find a way to incorporate more active learning into your content. Adding assessments is one of the quickest ways to start moving in that direction.
When you hear assessments, you might immediately think of a test or exam. But there are two types of assessments:
Both formative and summative assessments can incorporate elements of authentic assessment, where learners are asked to solve real-world problems, but formative assessments are key to creating interactive learning experiences. Formative assessments aren't about grading learners; they're about guiding them through the learning process. They also give you a chance to assess people's progress and understanding. You can see where they're struggling and adjust accordingly.
Here are a few ways to add formative assessments to your content projects.
If you want to go an extra step, look into building coding exercises where learners can submit their code through platforms like GitHub. Use automated testing tools to run their code against predefined test cases. This lets learners receive immediate feedback on whether their solution meets the required specifications, mimicking real-world software testing processes. It also scales well once you have it configured.
The most effective way to incorporate assessments into your content is to develop the assessments before creating the content. Think of your content as your method for ensuring your learners have everything they need to demonstrate they can do what you taught them. Doing this ensures that you're teaching only what your learners need to know, and it avoids the messy situation where an assessment asks a question you never covered because your assessment ends up being your content's roadmap.
Determine what you want the learning outcomes to be, then create the assessments that check for those outcomes, and then create the content that leads people to those outcomes.
The next time you build a tutorial or a video course, think of how you can add some interactivity through formative assessments. Your reward for the extra effort will be more measurable engagement; you can measure each assessment you create, collect the feedback, and use it to see if you're having the impact you'd hoped for.
If you have to run a database server, a web server, a background job process, or other processes simultaneously, you know managing these processes during development is challenging. Each process needs its own terminal window, which means you're opening a new window, switching to your project folder, and switching to the project directory.
Foreman is a tool that helps you manage multiple processes. Instead of juggling multiple windows, you specify all your services in a small configuration file that lives with your project, and the tool runs the services for you. Foreman was originally implemented in Ruby, but there are implementations available in Node.js, Python, and Go. In this tutorial, you'll use the Node.js version of Foreman, which you can install globally and will let you run services written in any programming language, just like the Ruby implementation.
Installing Foreman globally lets you run it from any directory. You could install Foreman as a developer dependency in your Node.js project, but installing it globally lets you use Foreman on projects in other languages.
Open your terminal and run the following command to install this globally on your system:
$ npm install -g foreman
To see how Foreman works, you'll need a couple of services you can run. For this demonstration, you'll create two services: a tiny web server and a service that periodically prints a message to the console.
Create a new directory to hold the services.
$ mkdir foreman-demo
Switch to the directory:
$ cd foreman-demo
Create a file named web_server.js
and add the following code that defines a basic web server running on port 4000
:
const http = require('http');
const server = http.createServer((req, res) => {
const date = new Date();
console.log(`[${date.toISOString()}] ${req.method} ${req.url}`);
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello, world!');
});
const PORT = 4000
server.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}`);
});
This code creates a web server that responds with "Hello, world!" when you access the root URL. It also logs the time and request method during the request.
Create another file called worker.js
and add the following code to create a service that logs the current time to the console every second:
console.log("Worker started at " + new Date().toLocaleTimeString());
setInterval(() => {
console.log("Worker running at " + new Date().toLocaleTimeString());
}, 10000);
With the two services defined, you can now tell Foreman how to run them. You do this by creating a Procfile, which tells Foreman the commands to run and what to call each command.
Create a file called Procfile
, with no file extension, in the root of your project directory and add the following code:
web: node web_server.js
worker: node worker.js
This file tells Foreman how to start your web server and background worker processes. Each entry in the file has a label, followed by the command to execute. When the processes run, the output for each process is prefixed with these labels.
Now, run both processes with Foreman:
$ nf start
This command starts both the web server and the worker. The terminal will display logs from both processes:
5:03:51 PM web.1 | Server running on http://localhost:4000
5:03:51 PM worker.1 | Worker started at 5:03:51 PM
5:04:01 PM worker.1 | Worker running at 5:04:01 PM
Open your web browser and go to http://localhost:4000
. You'll see "Hello, world!" displayed.
The log in your terminal shows the message from the web server and continues to show the worker's log messages printing every ten seconds.
5:04:41 PM worker.1 | Worker running at 5:04:41 PM
5:04:43 PM web.1 | [2024-04-28T22:04:43.330Z] GET /
5:04:43 PM web.1 | [2024-04-28T22:04:43.549Z] GET /favicon.ico
5:04:51 PM worker.1 | Worker running at 5:04:51 PM
Using Foreman lets you manage multiple processes without running multiple terminal windows. It's particularly useful in development environments to mimic production setups where multiple services need to run simultaneously. This tutorial demonstrated a basic setup, but Foreman can handle much more complex configurations as needed.
You've installed this globally on your system, so you can use it in projects in other languages as well. You can also install a different implementation of Foreman on your system, as it will be compatible with the Profile
you created.
One of the things I mentioned in this issue is adding formative assessments to your content. To model this by approach, I've added one to this newsletter. If you have a moment, fill out this quick, anonymous survey. The survey lets you reflect on what you learned and tell me what you'd like to see in future issues. It's short and should take less than five minutes. I'd appreciate your participation.
Here are a couple of things for you to try over the next month:
brew install goreman
. goreman start
in your project directory. Compare the results.Thanks again for reading.
I'd love to talk with you about this newsletter on Mastodon, Twitter, or LinkedIn. Let's connect!
Please support this newsletter and my work by encouraging others to subscribe or by buying a friend a copy of Exercises for Programmers, Small, Sharp Software Tools, or any of my other books.