Let’s wander into the Library of Programming Languages. After winding around the fountain in the main lobby, we see documentation for frameworks, modules, and packages lining elegant shelves. The library has wide glass windows, and the sun streams in this afternoon. The space feels open and pristine.
Shelves are conspicuously flush with volumes from the well-known stalwarts of the programming world: Python, C, Java, Ruby, Objective C, C#, JavaScript and more.
There are also banners and posters for the rising stars of software engineering: Go, Rust, Elixir, Swift, Dart and others.
Today’s journey is not about one of the stable and celebrated languages, nor is it about the freshness of the latest technologies.
In a back room, behind the rows of shelves and through a simple door, lies a rusted trapdoor. An oddly rustic item in an otherwise pristine and modern building, it creaks as we pull it back.
Gingerly, we lower ourselves into the Archive of Forgotten Programming Languages and into the dusty tomes of CoffeeScript.
CoffeeScript
In 2009, the prevailing language of the web, JavaScript, was being criticized for its verbosity and complexity. CoffeeScript is a language that emerged as a response to this, offering a syntax that was both succinct and elegant.
I stumbled on some CoffeeScript files at work lately, and honestly, I kind of like it.
CoffeeScript is considered ancient by most. There are a few corners of the internet that still write CoffeeScript in 2023, but they are few and far between. CoffeeScript was popular and fell out of favor before I started writing code professionally. Since so many features of CoffeeScript were introduced into JavaScript itself, it seems that no one found the need to learn another language.
No one who’s learning web development now would touch CoffeeScript. I doubt many new developers even know what it is. But using “obsolete” technology is actually illuminating. Like reading classic literature, it shows us where we came from.
I was surprised to find myself delighted to work with CoffeeScript. It’s clean, expressive, and soulful in its own way. From the language’s website:
“CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.”
To show you why CoffeeScript is so nice, imagine that we have a library of books. (Yes, a regular library this time.)
If we wanted to represent this library in JavaScript, it might look like this:
With commas and curly brackets flying all over the place, JavaScript's syntax looks immediately unwieldy. In contrast, the equivalent CoffeeScript is less verbose and more expressive. Even if you don’t code, you’ll probably find this easier to read and understand:
The readability of a programming language seems like a trivial thing, but it’s something to take quite seriously. Developers who can read and understand code quickly can debug it quickly to fix an issue. They can also build on it confidently, since they will be able to easily tell what it does.
Expressive code is maintainable code, and maintainable code creates sustainable value.
Old can be Gold
In my opinion, CoffeeScript is still superior to modern JavaScript. Yet, many of the popular features in modern JavaScript, including arrow functions and template literals, were originally features of CoffeeScript. Without CoffeeScript, the JavaScript we have today would be even uglier and harder to maintain.
This programming language teaches us a little lesson. Just because something ages out of style doesn’t mean that it should be ignored. There are plenty of insights that we can glean from examining something that has fallen out of fashion.
And these insights are more likely to be novel, because most people are reading, listening to, and watching popular and current media. The creations deep in humanity’s past could contain lessons and color that we may have forgotten or overlooked.
In the library, we climb back up the stairs, close the trapdoor behind us, and begin scouring the shelves in the main stacks. I won’t be picking CoffeeScript for my next project anytime soon. But understanding CoffeeScript helps me to learn from its syntax and be inspired to bring a new level of expression to the modern JavaScript I build with today.
When exploring the vast canvas of knowledge, what are the forgotten gems that inspire you and your craft?
Very well written !
This is a bit how webgl feels to me. It's definitely old and archaic in ways and I could just use Unity but I end up using it anyway! Ive learned a good deal of graphics programming from it instead of using an abstraction that might help me move faster.