Sometimes Kernel#puts and string interpolation doesn't give us the level of control we want over our program's output. When we need to control numeric formatting and field widths, we need to understand string formats
graceful.dev/courses/tapastry/modules...
Posts by Graceful.Dev
In which Jessitron and Avdi discuss the merits of larger and smaller LLMs, and the challenges of code review in codebases with a lot of history.
graceful.dev/podcast/historically-is-...
While the File methods are great for occasional use, for programs that deal extensively in filenames we need to bring out the big guns. Today we'll get an overview of Pathname, Ruby's swiss army knife for path manipulatio
graceful.dev/courses/tapastry/modules...
Introducing... "Machines of Code and Grace" - the official Graceful.Dev podcast! In this inaugural episode, Jessitron explains how she's using AI Feature Owners to avoid accidental regressions.
graceful.dev/podcast/ive-often-wished...
Ruby provides a lot of tools for breaking filenames into their component parts, but they aren't always well documented. Today's episode combines goes over some basics as well as a tip you might not be familiar with.
graceful.dev/courses/tapastry/modules...
When loading domain objects from an external service, it can be expensive to load up associated objects with them. Today's episode takes a look at a pattern for transparently lazy-loading such associations.
graceful.dev/courses/tapastry/modules...
Today we look at the humble String#gsub method, and learn that it has some surprising tricks up its sleeve.
graceful.dev/courses/tapa...
In today's episode, we'll examine how the availability of tools to aid refactoring can change how we write code.
graceful.dev/courses/tapa...
Today's episode is about a semantic convention for error handling that I learned from Jim Weirich.
graceful.dev/courses/tapa...
Today we go a little deeper into keyword arguments in Ruby 2.0/2.1, covering a few use cases we didn't cover in the last episode.
graceful.dev/courses/tapa...
Today's episode is a guide to transitioning various hash argument idioms to Ruby 2.0/2.1 keywords.
graceful.dev/courses/tapa...
Today's dish is a refactoring approached from two different perspectives. Enjoy!
graceful.dev/courses/tapa...
Graceful.Dev stands in solidarity with immigrants and migrants - our friends, colleagues, students, vendors, and heroes without whom coding work would be immeasurably poorer. I'll be donating the first month of all subscriptions started today to the MICA project here in St. Louis. - Avdi
Recently we looked at the Sequel library for interacting with SQL databases. Today, we'll use Sequel again to play with the native JSON support in PostgreSQL 9.3.
graceful.dev/courses/tapa...
We've used the "ghost object" pattern to lazily load attributes of a model object. And we've made a macro to easily declare "ghost-loadable" attribute accessors.
graceful.dev/courses/tapa...
When is it appropriate to metaprogram? Today's episode looks at one situation in which it may be a good choice.
graceful.dev/courses/tapa...
Today's episode demonstrates a technique for speeding up the process of sorting some collections.
graceful.dev/courses/tapa...
In today's episode we learn at how to implement lazy loading using the "ghost object" pattern.
graceful.dev/courses/tapa...
ActiveRecord has become practically synonymous with SQL database access in Ruby, but it's not the only way to talk to SQL stores. Today we'll explore Sequel, a wonderfully rich tool for interacting with many different SQL RDBMSes.
graceful.dev/courses/tapa...
Since Ruby 3.1 you can find out all of a class' subclasses dynamically--no extra metaprogramming required!
In the last episode we looked at the problem of "aliasing", here there are multiple objects representing a single row in a database. Today, we'll look at one possible solution to that problem.
graceful.dev/courses/tapa...
Today we look at a perncious problem that sometimes plagues code which uses an Object-Relational Mapper (ORM).
Documentation of the ActiveRecord inverse_of option mentioned in the episode can be found here: http://api.rubyonrails
graceful.dev/courses/tapa...
In this episode we look at a tool that I've found invaluable for managing configuration in my applications.
graceful.dev/courses/tapa...
In today's episode I cover a classic development technique that doesn't get enough press these days. Interactive, exploratory development was and is common in the Lisp world, and Ruby's dynamic nature is aptly suited to take advantage of this style of programming.
graceful.dev/courses/tapa...
For basic mutable data structures, you can't get much quicker and easier than Ruby's "Struct" class! But do you know everything it can do? Full screencast, now free to all!
youtu.be/0fei3uDkjNE
Hi there, graceful devs! Here’s what’s new in the garden… Content Updates There are two hefty new episodes since the last update! The first one, Policy as Structure, introduces a powerful approach to architecting your code for flexibility and change.
graceful.dev/site-news-26...
Originally captured in Kent Beck's classic book "Smalltalk Best Practice Patterns", Pluggable Selector is an under-used strategy for making methods more flexible. Learn how to use it in Ruby, in this classic Graceful.Dev episode now free to all!
youtu.be/rMsL3ZH4A2s
Memoization of a complex object can seem like a free optimization... but there are always trade-offs. Full episode now up for members: https://graceful.dev/topic/resist-memoization/
youtu.be/t5UjASNKChQ
Class @@variables are conventionally avoided in modern Ruby. Refine your #Ruby style with Graceful.Dev courses!