Welcome to Classic Season 5! Dive into a series of lessons where you will learn advanced programming concepts, practical applications, and refactoring techniques. Let’s explore how to optimize your code and enhance your understanding of various programming languages and frameworks.
Lesson 1: What Goes in Active Records
In the "What Goes in Active Records" series, we explore design constraints for ActiveRecord models. This lesson addresses the challenge of long test files for small classes. By creating a new value class and tightening interfaces, tests become shorter and easier to understand. The refactoring leaves the tests isolated from Rails, significantly boosting efficiency and speed.
Lesson 2: Collapsing Services into Values
Building on the previous lesson, this session converts the Subscription value object to a database table and ActiveRecord model. Initially, the User class managed subscription logic, which gets streamlined by extracting to its own model. This raises important questions about the suitable location for logic in a complete system.
Lesson 3: Understanding Rubinius
Rubinius, a Ruby implementation, blends Ruby with C++. We’ll review its structure, focus on load order, and object system bootstrapping. This session includes a practical exercise: removing a feature by updating related source files and verifying changes through tests and inspections.
Lesson 4: Comparing Python and Ruby Object Systems
While Python and Ruby offer dynamic expressiveness, their approaches diverge. Python emphasizes attributes, whereas Ruby focuses on methods. This delineation influences language peculiarities, including Python's focus on correctness and Ruby's efficiency in method handling.
Lesson 5: Validating Data Integrity in Rails
Exploring Rails apps, this lesson highlights the pitfalls of controller-level data validation and ActiveRecord limitations. We examine bypass strategies, their consequences, and solutions via real database constraints to maintain robust data integrity.
Lesson 6: Decoupling with Actor-based Concurrency
Addressing hard coupling in code, this session suggests separating object boundaries to enhance design and testing. We explore alternative dependency management methods beyond dependency injection, enabling smooth transitions to actor-based concurrency models.
Lesson 7: Overcoming Primitive Obsession
Primitive obsession, or using basic data types in place of domain-specific objects, compromises design clarity. This lesson reviews the Screencast class transition to a structured object model, showcasing how this shift affects software architecture.
Lesson 8: Isolated Testing without Stubs or Mocks
Discover methods for writing isolated tests by separating data from behavior in objects. Testing focuses on value parts, preventing dissonance with production code. This approach serves well for data-heavy classes, avoiding complexities linked to stubs and mocks.
Lesson 9: Multi-paradigm Refactoring
This screencast covers refactoring across imperative, object-oriented, and functional paradigms. Beginning with imperative form, the lesson transitions through object-oriented approaches to functional solutions, highlighting strengths and limitations of each.
Lesson 10: Bug Report to Test Driven Development
Transform bug reports into tests for targeted defect resolution. This lesson emphasizes step-by-step test-driven development, facilitating problem-solving even when stack traces are deceptive or incomplete.
Lesson 11: Test Style Transition to RSpec
Pre-BDD test cases often lacked expressiveness. We refactor Hamster's test suite to an example style, balancing test coverage and readability with human-readable specifications for effective testing.
Lesson 12: Exploring C and Its Unit Tests
Most underlying software systems are crafted in C. This session introduces a C-based project, discussing its unit tests and structural similarities to object-oriented design principles, despite being lower-level.
Lesson 13: Analyze System Performance Tools
Performance analysis ranges from load average simplifications to detailed DTrace insights. Here, we evaluate tools like /usr/bin/time for measuring involuntary context switches, crucial for detecting system behavior anomalies.
Lesson 14: Implementing Theoretical Actor Syntax in Ruby
Utilizing Ruby's flexibility, this session demonstrates implementing theoretical actor syntax in practical code. By progressively making syntax operational, this lesson reveals the actor model’s potential.
Lesson 15: Asynchronous Test Execution Techniques
This lesson presents ways to run tests asynchronously using tools like tmux and Unix primitives. Learn to communicate between processes for smoother and more efficient test management strategies.
Lesson 16: Comprehensive Test Recommendations
A comprehensive guide to test design covers separating unit and integration tests, using stubs strategically, and listening to test setup complexities. Adopting these practices leads to streamlined and effective testing.
Lesson 17: Embracing Rails Primitives for Refactoring
While often critiqued, this session shows when Rails primitives offer optimal design solutions. By refactoring controllers, behavior is effectively separated, leaving controllers streamlined for HTTP interactions.