The Future of Frozen String Literals— A key change in Ruby 3.4 (now in preview) is string literals in files without frozen_string_literal will begin to act as if frozen and raise warnings if mutations occur, pending a future enforcement of this as the default. Why? Xavier explains the history of automatically freezing string literals in Ruby and why this is happening now. Xavier Noria |
An FAQ for Namespaces: Possibly a Key Future Ruby Feature— This proposal introduces the ability to create virtual 'namespaces' that allow loading libraries, extensions, etc. so apps can load different versions of the same libraries. This could solve some ‘dependency hell’ issues, such as in testing. Matz has suggested this could become a distinctive feature for an eventual Ruby 4.0. Satoshi Tagomori |
📄 Articles, Tutorials & Videos |
Five Things to Avoid in Ruby— While in at least one case, it’s more about what to add to your code (Rubocop), these basic pointers are worth a skim. Martin Streicher (AppSignal) |
A Testing Anti-Pattern: Merged Setup Data— Making tests clear is a favor for both yourself and others, but when there’s lots of setup data, it can make it harder to understand the system’s state at the beginning of each test. The lesson: Constrain setup data to what each test really needs. Jason Swett |
|