When I learned to program, I learned in Java. When I started studying my second language, C++, I found myself struggling to understand the subtle differences in syntax, the significant differences in how memory management works, and even the differences in the meaning of some terms between Java and C++. This blog post lays out three things I wish had realized right off the bat when I started learning C++.
ChatGPT Fails an Introductory Computability Question
Using generative AI, like ChatGPT, comes with a significant risk: the AI can be very confident in its answers, while also being very wrong. In this blog post, we’ll examine a finite state machine (FSM) question about even and odd numbers. ChatGPT will attempt to solve it, then we’ll discuss where and how it went wrong. We’ll also lay the groundwork for a correct solution to the problem.
Breaking Down Java’s “Hello World”
The first piece of code most Java students see is the “Hello World” application. Despite the simplicity of what the program does, the code itself has a lot going on. There are words like class, public, static, void, and String[]. Why is all of this code here, and what does it do? In this blog post, we’ll break down Java’s “Hello World” program, and explain what all of the component pieces actually mean.
Rewinding Time with Git
“It was working ten minutes ago”. I remember saying that numerous times as a student, and now many of my students say something similar. If only there were a way to rewind our code by ten minutes, or to see what’s changed about our code in the last ten minutes. This blog post demonstrates how we can do both of these things with Git.
Constant Pointers in C: Reading Right to Left
The “const” keyword in the C programming language, when applied to pointers, can be quite confusing to read. How do you read a variable declaration like “const char *const *const p”? This blog post explains how to read these declarations, and demonstrates the technique of reading them from right to left.