6 Best Crystal Programming Courses for 2024
Here are the best online courses to learn Crystal: a modern, elegant language that combines the speed of C with the expressiveness of Ruby.
Quick Access:
- For Complete Beginners: Text-Based, Video-Based
- If You Have Some Programming Experience: Ruby Developers, Programmers
- Hands-on Exercises: Exercism, Crystal Koans.
Crystal is an object-oriented programming language that combines the speed and power of C with the expressiveness and readability of Ruby, making it easy to write and easy to understand.
With Crystal, you can write less code and get more done. With a built-in type inference system that eliminates the need for explicit type annotations, if your code compiles, your code is guaranteed to be type error-free at compile time.
But don’t let its ease of use and high levels of abstraction fool you into thinking that it’ll be sluggish — nay, Crystal is extremely fast! It is built on top of the LLVM compiler infrastructure, giving it performance on par with C and C++. This means that your Crystal code can run faster and use less memory than code written in other languages.
Not only is Crystal a great choice for building web applications and servers, thanks to its growing ecosystem of community libraries and frameworks such as Amber that replaces Ruby on Rails or Kemal that replaces Sinatra, you can go even beyond.
Are you ready to dive into the world of Crystal programming? Read on to see my top picks for the best courses to learn Crystal.
Click on the shortcuts for more details:
Here are my top picks. Click to skip to the course details:
Course Highlight | Workload |
Best Free Crystal Course for Ruby Developers (Serdar Dogruyol) | N/A |
Best Free Introduction to Crystal for Complete Beginners (crystal-lang.org) | N/A |
Best Free Introductory Crystal Course for Programmers (Gábor Szabó) | 3–4 hours |
Best Project-Based Video Course for Complete Beginners (Timnan Sheni) | 3-4 hours |
Best Practice Platform with Free Mentoring (Exercism) | 127 exercises |
Best Free Hands-on Exercises to Learn Crystal Incrementally (Andrea Manzini) | N/A |
What is Crystal?
Crystal is a general-purpose, object-oriented programming language designed for high performance and readability. Developed in 2014 by Ary Borenszweig, Juan Wajnerman, Brian Cardiff, and a team of over 300 contributors, Crystal has a seductive tagline: “Fast as C, slick as Ruby”.
- Fast as C: Crystal is about 10% slower than C. This is quite impressive considering that C is a low-level language with no garbage collection while Crystal is a high-level language with garbage collection. In comparison, Ruby is about 8 times slower than Crystal. Crystal’s blazingly fast performance can be attributed to its LLVM compiler infrastructure, the same compiler technology used by C and C++ itself, as well as other famously fast languages such as Fortran, Rust, and Julia. Crystal also prides itself on its C interoperability, making it easy to call native C libraries. And if you want to see how Crystal fares in real-world usage, just compare the Kemal framework (Crystal) to Sinatra (Ruby) and Ruby on Rails (Ruby) in the barchart below.
- Slick as Ruby: Crystal’s syntax is heavily inspired by Ruby — if you’re a Ruby veteran, you’ll feel right at home. But if you have not touched Ruby in your life, you’ll still find yourself picking up the language quite fast due to its simple, human-readable syntax. Additionally, Crystal has a built-in package manager called Shards (similar to Ruby’s gems) which makes it easy to install and manage dependencies.
But unlike Ruby, Crystal is statically type-checked, which means type errors will be caught early by the compiler rather than fail on runtime. Don’t worry though, you don’t need to explicitly define types as the compiler can intelligently infer types. Crystal also supports many modern features such as a macro system for powerful metaprogramming capabilities as well as support for concurrency, making it well-suited for high-performance and concurrent systems.
Crystal has a wide range of applications, including web development, systems programming, and data processing. It is often used by companies such as 84codes, Invidious, and Protel for building web servers, web APIs, and web scraping tools, due to its performance and expressiveness. And since it is concurrent, Crystal is also suitable for building command-line tools, distributed systems, and data processing pipelines. Though Crystal is relatively niche even compared to other niche languages out there, Crystal programmers earn an average pay rate for developers according to the 2023 Stack Overflow Developer survey, with a median yearly salary of $77,100.
Why You Should Trust Us
We know how online learning works. Class Central, a Tripadvisor for online education, has helped 60 million learners find their next course. We’ve been combing through online education for more than a decade to aggregate a catalog of 200,000 online courses and 200,000 reviews written by our users. And we’re online learners ourselves: combined, the Class Central team has completed over 400 online courses, including online degrees.
Courses Overview
- All of the courses are suitable for beginners to Crystal, while two courses are friendly towards complete newbies to programming
- All of the courses require you to run MacOs, Linux, or if you’re on Windows, WSL2. This is because Crystal is not yet fully supported on Windows at the time of writing
- All of the courses except one are free.
Best Free Crystal Course for Ruby Developers (Serdar Dogruyol)
Prior experience with programming is required to take Crystal For Rubyists written by Serdar Dogruyol.
This short yet comprehensive guide aims to help developers learn and understand the Crystal programming language by contrasting Ruby with Crystal. Though the course name may sound like it’s only aimed towards Ruby developers, it actually means that it assumes no knowledge of types, pointers, concurrency, or other similar things. Non-ruby developers are welcomed!
You’ll cover the basics of writing your first Crystal program, types, concurrency, metaprogramming, and more. By the end, you’ll have enough knowledge of Crystal to start exploring Crystal’s frameworks and libraries.
What you’ll learn:
- Understand the advantages of Crystal over Ruby and install Crystal
- Write your first Crystal program and implement FizzBuzz to learn syntax and structure
- Learn to run Crystal programs
- Discover Crystal’s built-in testing framework
- Understand static typing with intelligent type inference in Crystal
- Learn about method overloading with static types
- Explore concurrent programming with Channels
- Discover Crystal’s metaprogramming capabilities
- Learn to interoperate with C libraries using C bindings.
Serdar Dogruyol is the author of Kemal (the blazingly fast web framework you saw in What is Crystal?), a curator of Crystal Weekly, and a Crystal Core Member. He’s a Crystalian who has extensive experience working with a variety of languages, including Ruby, Java, PHP, Crystal, and Elixir.
As this course does not provide any exercises, you should try doing some from other courses in this article.
Website | crystalforrubyists.com |
Instructor | Serdar Dogruyol |
Level | Beginner |
Workload | N/A |
Certificate | None |
Best Free Introduction to Crystal for Complete Beginners (crystal-lang.org)
Targeted at novice Crystal programmers and people with no experience with programming, you’ll learn the basics of Crystal in a very short amount of time with Crystal Language tutorials. Hosted on the official Crystal language website, the content is sufficient but limited. I recommend that you supplement your learning with the practical courses in this guide.
Prior programming experience is recommended, but not required.
What you’ll learn:
- Start with “Hello World!” to understand Crystal program structure
- Learn about variables and data types, including reassignment to different types
- Perform arithmetic and string operations easily
- Use control constructs: conditionals and loops
- Create methods with arguments and type restrictions
- Explore two example programs: a command line application and an HTTP server.
The Crystal website also contains guides to other aspects of Crystal programming such as concurrency or performance, along with manuals for the compiler and the shards command.
Also, the entire website is open-sourced including the tutorials and guides. Anyone can contribute towards helping new Crystallians learn and adopt the language!
Institution | Crystal Team |
Provider | crystal-lang.org |
Level | Beginner |
Certificate | None |
Best Free Introductory Crystal Course for Programmers (Gábor Szabó)
Gábor Szabó has an excellent introductory course to Crystal programming.
I like this free course particularly because it’s easy to let the video play, sitback, and learn. This is because Gábor Szabó is an excellent teacher who can explain in detail what is happening on screen with his well-crafted slides and examples. Though of course, it’s a much more effective learning experience to follow along writing down code examples as you watch.
The video series covers most but not all of the slides in the link, so by the end of the course, you’ll have learned the basics of the Crystal language, including its syntax, type system, and how to run code. You should check out the slides, as they also give you exercises to complete.
If you have a few hours to spare to see what Crystal is all about, and also have some prior programming experience, this is a great course for you.
In this course, you’ll:
- Set up Crystal in a Docker container and explore third-party libraries (shards)
- Learn how variables and data types work in Crystal, including primitive and compound types
- Perform string concatenation and mathematical operations
- Write a command line program that processes STDIN arguments and prints results
- Learn about early exit in Crystal
- Create basic shapes like rectangles
- Explore interactive environments and write Crystal one-liners
- Generate random numbers in Crystal.
Gábor Szabó is a programmer with almost 40 years of experience in programming languages such as Perl and Python. He runs the Code Maven YouTube channel and website.
Channel | Code Maven |
Provider | YouTube |
Instructor | Gábor Szabó |
Level | Beginner |
Workload | 3–4 hours |
Views | 885 |
Likes | 29 |
Certificate | None |
Best Project-Based Video Course for Complete Beginners (Timnan Sheni)
Learn Crystal Programming is a great project-based introductory course to the Crystal programming language and is friendly towards absolute beginners.
You’ll learn how to write powerful, efficient, and concise programs in Crystal through four hands-on projects: a name guessing game; a rock, paper, scissors game; a simple calculator application; and lastly, an automatic file organizer.
No prior programming experience is required to take this course!
What you’ll learn in this course:
- Install Crystal and relevant VSCode extensions
- Explore Crystal’s data types (Strings, Numbers, Floats, Arrays, Hashes)
- Handle user input and implement control flow (if statements, while and unless loops)
- Create a name guessing game and rock, paper, scissors with nested logic
- Learn imperative programming with step-by-step instructions
- Transition to object-oriented programming: create objects with properties and actions
- Develop a calculator app using object-oriented principles
- End with an IO-intensive app to organize files by format.
Timnan Sheni is a software developer and tutor specializing in Ruby on Rails. He runs a YouTube channel as well as a blog where he posts educational content on Ruby on Rails and Javascript.
Provider | Udemy |
Instructor | Timnan Sheni |
Level | Beginner |
Workload | 3-4 hours |
Enrollments | 3K |
Certificate | Paid |
Best Practice Platform with Free Mentoring (Exercism)
Exercism is an open-source, online platform for learning and practicing programming. They provide a collection of free coding exercises in difficulties, from easy to hard, in various programming languages (including Crystal!).
When I want to learn a programming language, I use Exercism to complement my learning experience. Not only does it allow me to practice what I’ve learned, but it also gives me the opportunity to compare my solutions with others. And that’s not all — the best part about Exercism is that it offers free mentoring.
Each exercise comes with automatic feedback of your code as well as personal mentoring to help you understand your code’s strengths and flaws. I can submit my lousy code for any exercise, and after some time, receive constructive feedback from an experienced developer. This helps me improve my coding skills and write less lousier code. And so can you!
What you’ll learn:
Exercism offers Crystal exercises of varying difficulty levels.
- Easy exercises include reporting leap years, converting binary numbers to their denary equivalent, and encrypting/decrypting ciphers such as Atbash, Caesar, or rational
- Some medium difficulty tasks are determining if a number is mathematically perfect, abundant, or deficient, calculating a person’s allergy score, and generating proverbs from a list of words.
Exercism provides exercises on 70 programming languages including Python, Kotlin, F#, and even WebAssembly. Their mission is to help everyone get really good at programming, regardless of their background, share the love of programming, and help people upskill as part of their upward social mobility.
Provider | Exercism |
Level | All levels |
Workload | 120+ exercises |
Enrollments | 2.3K |
Contributors | 50+ |
Mentors | 80+ |
Certificate | None |
Best Free Hands-on Exercises to Learn Crystal Incrementally (Andrea Manzini)
The Crystal Language Koans are a set of free exercises aimed at teaching you the basics (and more!) of Crystal. It’s an interactive learning tool that’ll guide you through a series of challenges through trial-and-error unit testing, incrementally building your Crystal programming skills. You’ll learn through iterative testing — see the tests fail, and fill in the codes until all of the tests pass. Then, you’ll do it again until you finish all sets of exercises.
This course is more structured than Exercism, dealing with a wide variety of Crystal topics. The goal is to provide an engaging and hands-on way of learning the language while also reinforcing key concepts.
You should have some prior experience with Crystal to take this course.
You’ll learn:
- Data types and data structures: The building blocks of every program, you’ll need them for correctness and efficiency
- Control structure and functions: These allow the program to make and repeat decisions, promoting code reuse
- Object-Oriented Programming: Learn how to organize software around object, which have data and behavior
- Type System: Explore Crystal’s robust type system in detail
- Error Handling: Errors are bound to happen in run-time. Learn how to deal with them
- Concurrency: Crystal is built for concurrency, with constructs such as channels
- Macros: Just like Ruby, Crystal has macros. Unlike Ruby though, they expand at compile time
- Interoperability: Crystal prides itself on C interoperability
- Specialized Data Types: Sometimes regular data types don’t cut it. Fortunately, Crystal is more than regular
- Text Processing: Text can be hard. Learn how Crystal makes string operations easy
- Environment & Paths: Need to access files on the system? No worries!
- Data Formats: There perhaps may be as many data formats as there are trees on Earth. Learn how to read the most common ones
- HTTP & Networking: Experience what Crystal is built for — efficient server processing.
Andrea Manzini is a Unix System Administrator and an open-source contributor. He works for SUSE as a QE Automation Engineer, where he does automated test development and quality assurance for SUSE product release.
If you’ve read my other guides, you’ll know that other programming languages have their own Koans out there. In fact, this Koan is inspired by RubyKoans, CppKoans, GoKoans.
Provider | GitHub |
Instructor | Andrea Manzini |
Level | All levels |
Workload | 50+ Koans (exercises) |
Stars | 46 |
Certificate | None |
Best Courses Guides Methodology
I built this ranking following the now tried-and-tested methodology used in previous Best Courses Guides (you can find them all here). It involves a three-step process:
- Research: I started by leveraging Class Central’s database and the internet. Then, I made a preliminary selection of Crystal courses by rating, reviews, and bookmarks.
- Evaluate: I read through reviews on Class Central, Reddit, and course providers to understand what other learners thought about each course and combined it with my own experience as a learner.
- Select: Well-made courses were picked if they presented valuable and engaging content. Selection criteria includes comprehensive curriculum, affordability, release date, ratings and enrollments.
Pat revised the research and the latest version of this article.