
Explore the basics of type checking in Ruby and Ruby on Rails, learning how static type systems verify value constraints to prevent errors and clarify code behavior.
Compare static typing and dynamic typing. Static typing checks at compile time, dynamic typing checks at runtime; Ruby remains a traditionally dynamic language.
Explore dynamic typing in Ruby, where variable types are determined at runtime, offering rapid prototyping and concise code, but risking type errors without thorough tests.
Explore static typing, where a variable's type is known at compile time, as in Java, C++, and Rust, enabling early error catching and clearer, more optimized code.
Explore static typing in Ruby with rbs and BZ type signatures for methods. A type checker, stip, analyzes code to catch runtime errors early and improve safety.
Explore static typing versus dynamic typing, their benefits and drawbacks, and how RBS in Ruby can catch type errors early and enable type checking.
Learn how RBS defines type signatures in Ruby using BHS, and how Stip serves as a separate type checker to validate code structure for safer, maintainable Ruby on Rails projects.
Sorbit, a Ruby type checker with inline annotations, competes with BSS’s separate type files, gaining a niche for early, large projects.
Assess how BBS offers a lightweight, integrated way to understand data structures in large Ruby codebases during development or testing, with evolving limitations and extensions for VS Code and Rubymine.
Develop your ARBs mindset by embracing explicit types from the start, balancing intentionality and clarity with static type checking, contrasting with duck typing in traditional Ruby.
Shift from implicit to explicit types in ruby using RBS, declare the data you work with, and treat types as part of the design rather than a runtime concern.
Ruby favors an adaptive write-test-adjust style, offering flexibility but risking maintainability in large systems. RBS enforces planning upfront, shaping types and interactions before implementation, echoing TDD for disciplined design.
See how RBS enables static typing in Ruby by explicitly defining data structures, like arrays of strings, and catching type mismatches before runtime with a strict type checker.
Define type signatures in BZ for living documentation in Ruby code that stays in sync with the codebase, and rely on the type checker to safeguard behavior.
Adopt a contract-first mindset by defining method contracts—what a method expects and returns. Reduce ambiguity, boost predictability, and ease feature addition in large teams by clarifying types.
Adopt Ruby's first mindset by defining types before logic, reducing runtime errors and yielding clearer, safer code and better design in Ruby and Ruby on Rails applications.
Explore the benefits HBS offers Ruby developers as an alternative, embrace the HBS mindset, and take a practical step toward applying static typing in your code base.
Set up your ruby static typing by installing the Rbbs gem and a type checker, then configure Rubymine or Visual Studio Code with the Rbbs syntax and steep plugins.
Install the bz and steep gems, add them to the Gemfile, then set up steep with a sig folder and targets, and configure editor extensions.
Experiment with static typing in Ruby by creating add.rb, defining a sum method for two parameters, adding a signature file, and using the type checker to fix type errors.
Set up the work environment with all necessary tools and extensions, complete the first type check for a simple Ruby program, and get familiar with the Rbbs syntax.
Explore core RBS concepts and syntax for Ruby static typing. Compare stopwatch and Typecheck for validating signatures against Ruby code with live invalidation on file changes.
Create a typed Ruby animal class with explicit parameter and return types, introduce dog and cat, and implement a sound mixin with abstract methods enforced by steep for safe behavior.
Add an age variable to the animal class by updating initialize with an optional parameter, define name and age as instance variables, and introduce a constant to test the program.
Create a lightweight animal pair using a struct to model pairing and offspring. Define getters, a breed method returning dog or cat, and test positional or named arguments in Ruby.
Learn to use blocks and lambdas in Ruby by adding a birthday method that increments age before passing it to a block, and explore procs, lambdas, and rbs type definitions.
Explore ruby metaprogramming by dynamically defining methods, creating a class method to initialize instances, and using method_missing with respond_to_missing to enforce type signatures.
Examine how monkeypatching works in Ruby, despite being an anti-pattern, and see why Rails relies on it, by adding a new string method with a union type signature.
Explore arrays and hashes in Ruby with static typing by building a zoo model, adding animals to enclosures, and generating statistics using typed arrays and hashes.
Build a foundation in the basics of RBS and begin applying it to real projects, while consulting the official documentation in the Ruby GitHub repository for gaps.
Explore how HBS integrates with existing and legacy code and complex systems, and learn practical strategies for applying type checking in real-world Ruby and Rails projects.
Enable type checking in the IDE to boost development. Use steep with Visual Studio Code or RubyMine to view type signatures and in-editor errors, with setup like bundle exec steep.
Explore generating ruby type signatures with the BBS gem prototype method to create rbbs and RBS files, then assess type prof's inferred types for legacy code.
Discover how the bbs inline gem enables inline type definitions in Ruby, using initialize, add feature, width feature, self type binding, and instanceeval to inspect dynamic methods.
Learn to integrate third-party gems using the rbbs gem and the BBS collection, then configure steep and the rbz collection to fetch missing type signatures.
Add Steep and RBS to a Rails app, initialize signatures, and bootstrap controllers and models for type checking, including device authentication with authenticate_user and current_user.
Integrate steep type checks and rubocop into your Ruby on Rails workflow with a simple shell script to run steep in CI/CD, catching issues early.
Apply BBS to Ruby and Rails projects to write secure, readable, and maintainable code with explicit type signatures. Embrace type definitions to reduce debugging and boost clarity in legacy code.
Unlock the power of type checking in Ruby with RBS. This comprehensive course is tailored for Ruby developers seeking to enhance code quality, maintainability, and safety. Whether maintaining legacy code or building advanced systems, mastering RBS and tools like Steep empowers you to write better, error-resistant Ruby code while simplifying debugging and collaboration.
Through practical examples and hands-on exercises, you’ll explore:
What type checking is and why this is important.
What RBS is and how it integrates with Ruby’s dynamic nature.
Get to know alternatives to RBS, pros and cons.
Writing, managing, and using type signatures for clarity and reliability.
Leveraging tools like `rbs collection`, `rbs_rails`, and `Steep` for Rails applications.
Working with third-party libraries and addressing metaprogramming challenges, including Ruby on Rails framework.
Implementing RBS workflows in real-world projects and CI/CD pipelines.
Using your favourite IDE with static type checking.
Write better documentation with inline type definitions.
Write safer Ruby code with less tests.
This course combines theory with hands-on examples, giving you the tools to adopt RBS confidently and effectively. Whether you're a seasoned Rubyist or just diving into the language, this course will expand your toolkit and help you build better software.
Take the leap and future-proof your Ruby development skills with RBS.