Category Archives: Languages

Optional Values in Rust

Let’s say we are writing some code to retrieve data from a database. If the data we are looking for is there, we can obviously return it. If there is no data that matches our search, we need to signal that we did not find it. In many languages, we use a nil, null, or… Read More »

Rust Error Handling, Part Two

In the previous post, I covered a quick overview of error handling approaches in different languages. Then, I introduced Rust’s error handling using the Result<T, E> enum. This time we’ll look at how Rust’s approach improves on other techniques. Compared to Error Returns Returning a Result<T, E> from a function is very much like the… Read More »

Rust Error Handling, Part One

For the last couple of years, I’ve been learning Rust in my free time (ha!) by working on side projects. Since I don’t really have a deadline, I can focus on seeing how Rust changes the way I think about programming. A language that doesn’t affect the way you think about programming is not worth… Read More »

Sturgeon’s Revelation of Code

One problem with comparing different programming languages is finding a valid comparison. It’s pretty hard to really compare two different languages. On the other hand, it’s pretty easy to compare example code from the two languages. Unfortunately, comparing code examples is likely to run into Sturgeon’s Revelation, or Sturgeon’s Law: 90% of everything is crap.… Read More »

The Literals of Functional Programming

I was listening to an older episode of Software Engineering Radio where they interviewed Martin Odersky on Scala (Episode 62). In the interview, Odersky made a comment about closures being the literals of functional programming. This statement struck me as surprising. The more I thought about it, the more interesting and subtle the concept became.… Read More »

Programming for/by Kids

My son has talked several times about learning to program, but he’s young enough that the normal programming approaches bore him. I had tried implementations of Logo in the past, without much success. A couple months ago, I was checking the Make magazine blog and stumbled upon an article about a Scrolling Mario game in… Read More »

A different view of programming languages

I’ve been thinking lately about the differences between programming languages. Over and over again, we see religious wars over what is the best programming language. Lately, we’ve also seen a lot of comparisons that look at particular classes of languages. Object-oriented vs. procedural Dynamic vs. static I have always had a kind of fascination with… Read More »