21st Century C: C Tips from the New School; Ben Klemens; O'Reilly
-
Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly
-
Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt
+
Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications
Concurrency in Go; Katherine Cox-Buday; O'Reilly
-
97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly
-
The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional
-
Systemprogrammierung in Go; Frank Müller; dpunkt
-
Developing Games in Java; David Brackeen and others...; New Riders
Ultimate Go Notebook; Bill Kennedy
-
Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson
+
Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press
+
Leanring eBPF; Liz Rice; O'Reilly
+
Effective Java; Joshua Bloch; Addison-Wesley Professional
+
Pro Puppet; James Turnbull, Jeffrey McCune; Apress
+
Programming Ruby 3.3 (5th Edition); Noel Rappin, with Dave Thomas; The Pragmatic Bookshelf
+
Raku Recipes; J.J. Merelo; Apress
+
Perl New Features; Joshua McAdams, brian d foy; Perl School
+
Systemprogrammierung in Go; Frank Müller; dpunkt
+
Terraform Cookbook; Mikael Krief; Packt Publishing
+
The Docker Book; James Turnbull; Kindle
+
Data Science at the Command Line; Jeroen Janssens; O'Reilly
+
Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly
+
The Pragmatic Programmer; David Thomas; Addison-Wesley
+
The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible
Effective awk programming; Arnold Robbins; O'Reilly
-
Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications
+
Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner
+
Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly
+
The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional
+
Chaos Engineering - System Resiliency in Practice; Casey Rosenthal and Nora Jones; eBook
+
Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson
+
Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly
+
Polished Ruby Programming; Jeremy Evans; Packt Publishing
Site Reliability Engineering; How Google runs production systems; O'Reilly
-
The Docker Book; James Turnbull; Kindle
-
C++ Programming Language; Bjarne Stroustrup;
The Practise of System and Network Administration; Thomas A. Limoncelli, Christina J. Hogan, Strata R. Chalup; Addison-Wesley Professional Pro Git; Scott Chacon, Ben Straub; Apress
Raku Fundamentals; Moritz Lenz; Apress
-
Raku Recipes; J.J. Merelo; Apress
-
The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible
-
Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly
-
Terraform Cookbook; Mikael Krief; Packt Publishing
-
Pro Puppet; James Turnbull, Jeffrey McCune; Apress
-
Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press
+
Modern Perl; Chromatic ; Onyx Neon Press
+
Higher Order Perl; Mark Dominus; Morgan Kaufmann
Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press
-
Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly
+
The Kubernetes Book; Nigel Poulton; Unabridged Audiobook
+
DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible
The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton
+
Java ist auch eine Insel; Christian Ullenboom;
+
Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers
+
Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers
+
97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly
+
C++ Programming Language; Bjarne Stroustrup;
+
Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly
+
21st Century C: C Tips from the New School; Ben Klemens; O'Reilly
+
Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt
DNS and BIND; Cricket Liu; O'Reilly
-
Higher Order Perl; Mark Dominus; Morgan Kaufmann
-
Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner
-
Polished Ruby Programming; Jeremy Evans; Packt Publishing
-
Perl New Features; Joshua McAdams, brian d foy; Perl School
-
Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly
-
Programming Ruby 3.3 (5th Edition); Noel Rappin, with Dave Thomas; The Pragmatic Bookshelf
-
Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly
-
DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible
-
Chaos Engineering - System Resiliency in Practice; Casey Rosenthal and Nora Jones; eBook
-
The Pragmatic Programmer; David Thomas; Addison-Wesley
-
Leanring eBPF; Liz Rice; O'Reilly
+
Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly
+
Developing Games in Java; David Brackeen and others...; New Riders
Funktionale Programmierung; Peter Pepper; Springer
-
Modern Perl; Chromatic ; Onyx Neon Press
-
Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers
100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications
-
Java ist auch eine Insel; Christian Ullenboom;
-
The Kubernetes Book; Nigel Poulton; Unabridged Audiobook
-
Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers
-
Effective Java; Joshua Bloch; Addison-Wesley Professional
-
Data Science at the Command Line; Jeroen Janssens; O'Reilly
Technical references
I didn't read them from the beginning to the end, but I am using them to look up things. The books are in random order:
-
Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly
Implementing Service Level Objectives; Alex Hidalgo; O'Reilly
Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley
-
Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly
-
The Linux Programming Interface; Michael Kerrisk; No Starch Press
+
Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly
Relayd and Httpd Mastery; Michael W Lucas
-
BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley
+
The Linux Programming Interface; Michael Kerrisk; No Starch Press
Go: Design Patterns for Real-World Projects; Mat Ryer; Packt
+
Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly
+
BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley
Self-development and soft-skills books
In random order:
-
The Joy of Missing Out; Christina Crook; New Society Publishers
-
Meditation for Mortals, Oliver Burkeman, Audiobook
-
Deep Work; Cal Newport; Piatkus
-
The Good Enough Job; Simone Stolzoff; Ebury Edge
-
Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion
-
Psycho-Cybernetics; Maxwell Maltz; Perigee Books
-
Staff Engineer: Leadership beyond the management track; Will Larson; Audiobook
-
So Good They Can't Ignore You; Cal Newport; Business Plus
-
The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select
-
The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books
-
Stop starting, start finishing; Arne Roock; Lean-Kanban University
-
The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd
-
101 Essays that change the way you think; Brianna Wiest; Audiobook
-
Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press
-
Never Split the Difference; Chris Voss, Tahl Raz; Random House Business
Getting Things Done; David Allen
+
The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd
+
The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select
+
Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly
+
97 Things Every Engineering Manager Should Know; Camille Fournier; Audiobook
The Bullet Journal Method; Ryder Carroll; Fourth Estate
-
Eat That Frog!; Brian Tracy; Hodder Paperbacks
+
Staff Engineer: Leadership beyond the management track; Will Larson; Audiobook
+
So Good They Can't Ignore You; Cal Newport; Business Plus
+
Soft Skills; John Sommez; Manning Publications
+
Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing
+
Solve for Happy; Mo Gawdat (RE-READ 1ST TIME)
+
Coders at Work - Reflections on the craft of programming, Peter Seibel and Mitchell Dorian et al., Audiobook
Ultralearning; Anna Laurent; Self-published via Amazon
-
Eat That Frog; Brian Tracy
-
Digital Minimalism; Cal Newport; Portofolio Penguin
The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK
-
Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly
-
Influence without Authority; A. Cohen, D. Bradford; Wiley
-
The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook
The Power of Now; Eckhard Tolle; Yellow Kite
-
Solve for Happy; Mo Gawdat (RE-READ 1ST TIME)
-
Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing
-
97 Things Every Engineering Manager Should Know; Camille Fournier; Audiobook
-
Coders at Work - Reflections on the craft of programming, Peter Seibel and Mitchell Dorian et al., Audiobook
-
Ultralearning; Scott Young; Thorsons
-
Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne
-
Soft Skills; John Sommez; Manning Publications
+
The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook
+
Psycho-Cybernetics; Maxwell Maltz; Perigee Books
+
Eat That Frog!; Brian Tracy; Hodder Paperbacks
+
The Joy of Missing Out; Christina Crook; New Society Publishers
+
Never Split the Difference; Chris Voss, Tahl Raz; Random House Business
+
Meditation for Mortals, Oliver Burkeman, Audiobook
+
101 Essays that change the way you think; Brianna Wiest; Audiobook
The Off Switch; Mark Cropley; Virgin Books (RE-READ 1ST TIME)
-
Slow Productivity; Cal Newport; Penguin Random House
+
Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press
+
Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne
+
Digital Minimalism; Cal Newport; Portofolio Penguin
+
Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion
Atomic Habits; James Clear; Random House Business
+
Stop starting, start finishing; Arne Roock; Lean-Kanban University
+
Slow Productivity; Cal Newport; Penguin Random House
+
The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books
+
Eat That Frog; Brian Tracy
+
The Good Enough Job; Simone Stolzoff; Ebury Edge
+
Influence without Authority; A. Cohen, D. Bradford; Wiley
@@ -161,21 +161,21 @@
Some of these were in-person with exams; others were online learning lectures only. In random order:
-
Developing IaC with Terraform (with Live Lessons); O'Reilly Online
-
Protocol buffers; O'Reilly Online
+
The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online
Ultimate Go Programming; Bill Kennedy; O'Reilly Online
F5 Loadbalancers Training; 2-day on-site training; F5, Inc.
-
AWS Immersion Day; Amazon; 1-day interactive online training
-
Functional programming lecture; Remote University of Hagen
-
The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online
-
Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training
+
The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online
Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon
-
Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online
-
Structure and Interpretation of Computer Programs; Harold Abelson and more...;
Red Hat Certified System Administrator; Course + certification (Although I had the option, I decided not to take the next course as it is more effective to self learn what I need)
-
The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online
-
MySQL Deep Dive Workshop; 2-day on-site training
+
Developing IaC with Terraform (with Live Lessons); O'Reilly Online
+
Functional programming lecture; Remote University of Hagen
+
Structure and Interpretation of Computer Programs; Harold Abelson and more...;
+
Protocol buffers; O'Reilly Online
+
Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online
+
AWS Immersion Day; Amazon; 1-day interactive online training
+
Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training
Apache Tomcat Best Practises; 3-day on-site training
+
MySQL Deep Dive Workshop; 2-day on-site training
Scripting Vim; Damian Conway; O'Reilly Online
Technical guides
@@ -183,8 +183,8 @@
These are not whole books, but guides (smaller or larger) which I found very useful. in random order:
-
Advanced Bash-Scripting Guide
Raku Guide at https://raku.guide
+
Advanced Bash-Scripting Guide
How CPUs work at https://cpu.land
Podcasts
@@ -194,61 +194,61 @@
In random order:
-
The Pragmatic Engineer Podcast
+
Wednesday Wisdom
Deep Questions with Cal Newport
Dev Interrupted
-
Fork Around And Find Out
-
Wednesday Wisdom
-
Modern Mentor
-
Pratical AI
-
Fallthrough [Golang]
+
Backend Banter
Maintainable
-
Cup o' Go [Golang]
Hidden Brain
-
The Changelog Podcast(s)
+
Pratical AI
+
Cup o' Go [Golang]
+
Modern Mentor
+
The Pragmatic Engineer Podcast
BSD Now [BSD]
+
Fallthrough [Golang]
+
Fork Around And Find Out
The ProdCast (Google SRE Podcast)
-
Backend Banter
+
The Changelog Podcast(s)
Podcasts I liked
I liked them but am not listening to them anymore. The podcasts have either "finished" (no more episodes) or I stopped listening to them due to time constraints or a shift in my interests.
-
Go Time (predecessor of fallthrough)
-
CRE: Chaosradio Express [german]
-
Java Pub House
-
FLOSS weekly
Modern Mentor
Ship It (predecessor of Fork Around And Find Out)
+
Go Time (predecessor of fallthrough)
+
FLOSS weekly
+
Java Pub House
+
CRE: Chaosradio Express [german]
Newsletters I like
This is a mix of tech and non-tech newsletters I am subscribed to. In random order:
-
Applied Go Weekly Newsletter
Register Spill
+
Applied Go Weekly Newsletter
Ruby Weekly
-
byteSizeGo
-
VK Newsletter
-
Andreas Brandhorst Newsletter (Sci-Fi author)
-
Changelog News
-
Monospace Mentor
Golang Weekly
+
The Valuable Dev
+
Monospace Mentor
The Imperfectionist
+
Changelog News
+
VK Newsletter
+
Andreas Brandhorst Newsletter (Sci-Fi author)
+
byteSizeGo
The Pragmatic Engineer
-
The Valuable Dev
Magazines I like(d)
This is a mix of tech I like(d). I may not be a current subscriber, but now and then, I buy an issue. In random order:
-
Linux User
-
LWN (online only)
-
Linux Magazine
freeX (not published anymore)
+
Linux Magazine
+
LWN (online only)
+
Linux User
Formal education
diff --git a/gemfeed/2021-07-04-the-well-grounded-rubyist.html b/gemfeed/2021-07-04-the-well-grounded-rubyist.html
index af0aa455..75d538d5 100644
--- a/gemfeed/2021-07-04-the-well-grounded-rubyist.html
+++ b/gemfeed/2021-07-04-the-well-grounded-rubyist.html
@@ -135,7 +135,7 @@ Hello World
Other Ruby-related posts:
Back to the main site
diff --git a/gemfeed/2025-10-11-key-takeaways-from-the-well-grounded-rubyist.html b/gemfeed/2025-10-11-key-takeaways-from-the-well-grounded-rubyist.html
new file mode 100644
index 00000000..75950fb3
--- /dev/null
+++ b/gemfeed/2025-10-11-key-takeaways-from-the-well-grounded-rubyist.html
@@ -0,0 +1,273 @@
+
+
+
+
+Key Takeaways from The Well-Grounded Rubyist
+
+
+
+
+
+
+
+Published at 2025-10-11T15:25:14+03:00
+
+Some time ago, I wrote about my journey into Ruby and how "The Well-Grounded Rubyist" helped me to get a better understanding of the language. I took a lot of notes while reading the book, and I think it's time to share some of them. This is not a comprehensive review, but rather a collection of interesting tidbits and concepts that stuck with me.
+
+
+
+One of the most fascinating aspects of Ruby is its object model. The book does a great job of explaining the details.
+
+
Everything is an object (almost)
+
+In Ruby, most things are objects. This includes numbers, strings, and even classes themselves. This has some interesting consequences. For example, you can't use i++ like in C or Java. Integers are immutable objects. 1 is always the same object. 1 + 1 returns a new object, 2.
+
+
The self keyword
+
+There is always a current object, self. If you call a method without an explicit receiver, it's called on self. For example, puts "hello" is actually self.puts "hello".
+
+
+
# At the top level, self is the main object
+p self
+# => main
+p self.class
+# => Object
+
+def foo
+ # Inside a method, self is the object that received the call
+ p self
+end
+
+foo
+# => main
+
+
+This code demonstrates how self changes depending on the context. At the top level, it's main, an instance of Object. When foo is called without a receiver, it's called on main.
+
+
Singleton Methods
+
+You can add methods to individual objects. These are called singleton methods.
+
+
+
obj = "a string"
+
+def obj.shout
+ self.upcase + "!"
+end
+
+p obj.shout
+# => "A STRING!"
+
+obj2 = "another string"
+# obj2.shout would raise a NoMethodError
+
+
+Here, the shout method is only available on the obj object. This is a powerful feature for adding behavior to specific instances.
+
+
Classes are Objects
+
+Classes themselves are objects, instances of the Class class. This means you can create classes dynamically.
+
+
+
MyClass = Class.new do
+ def say_hello
+ puts "Hello from a dynamically created class!"
+ end
+end
+
+instance = MyClass.new
+instance.say_hello
+# => Hello from a dynamically created class!
+
+
+This shows how to create a new class and assign it to a constant. This is what happens behind the scenes when you use the class keyword.
+
+
Control Flow and Methods
+
+The book clarified many things about how methods and control flow work in Ruby.
+
+
case and the === operator
+
+The case statement is more powerful than I thought. It uses the === (threequals or case equality) operator for comparison, not ==. Different classes can implement === in their own way.
+
+
+
# For ranges, it checks for inclusion
+p (1..5) === 3 # => true
+
+# For classes, it checks if the object is an instance of the class
+p String === "hello" # => true
+
+# For regexes, it checks for a match
+p /llo/ === "hello" # => true
+
+def check(value)
+ case value
+ when String
+ "It's a string"
+ when (1..10)
+ "It's a number between 1 and 10"
+ else
+ "Something else"
+ end
+end
+
+p check(5) # => "It's a number between 1 and 10"
+
+
+
Blocks and yield
+
+Blocks are a cornerstone of Ruby. You can pass them to methods to customize their behavior. The yield keyword is used to call the block.
+
+
+
def my_iterator
+ puts "Entering the method"
+ yield
+ puts "Back in the method"
+ yield
+end
+
+my_iterator { puts "Inside the block" }
+# Entering the method
+# Inside the block
+# Back in the method
+# Inside the block
+
+
+This simple iterator shows how yield transfers control to the block. You can also pass arguments to yield and get a return value from the block.
+
+
+
def with_return
+ result = yield(5)
+ puts "The block returned #{result}"
+end
+
+with_return { |n| n * 2 }
+# => The block returned 10
+
+
+This demonstrates passing an argument to the block and using its return value.
+
+
Fun with Data Types
+
+Ruby's core data types are full of nice little features.
+
+
Symbols
+
+Symbols are like immutable strings. They are great for keys in hashes because they are unique and memory-efficient.
+
+
+
# Two strings with the same content are different objects
+p "foo".object_id
+p "foo".object_id
+
+# Two symbols with the same content are the same object
+p :foo.object_id
+p :foo.object_id
+
+# Modern hash syntax uses symbols as keys
+my_hash = { name: "Paul", language: "Ruby" }
+p my_hash[:name] # => "Paul"
+
+
+This code highlights the difference between strings and symbols and shows the convenient hash syntax.
+
+
Arrays and Hashes
+
+Arrays and hashes have a rich API. The %w and %i shortcuts for creating arrays of strings and symbols are very handy.
+
+
+
# Array of strings
+p %w[one two three]
+# => ["one", "two", "three"]
+
+# Array of symbols
+p %i[one two three]
+# => [:one, :two, :three]
+
+
+A quick way to create arrays. You can also retrieve multiple values at once.
+
+
+
-
-Published at 2025-10-11T15:25:14+03:00
-
-Some time ago, I wrote about my journey into Ruby and how "The Well-Grounded Rubyist" helped me to get a better understanding of the language. I took a lot of notes while reading the book, and I think it's time to share some of them. This is not a comprehensive review, but rather a collection of interesting tidbits and concepts that stuck with me.
-
-
-
-One of the most fascinating aspects of Ruby is its object model. The book does a great job of explaining the details.
-
-
Everything is an object (almost)
-
-In Ruby, most things are objects. This includes numbers, strings, and even classes themselves. This has some interesting consequences. For example, you can't use i++ like in C or Java. Integers are immutable objects. 1 is always the same object. 1 + 1 returns a new object, 2.
-
-
The self keyword
-
-There is always a current object, self. If you call a method without an explicit receiver, it's called on self. For example, puts "hello" is actually self.puts "hello".
-
-
-
# At the top level, self is the main object
-p self
-# => main
-p self.class
-# => Object
-
-def foo
- # Inside a method, self is the object that received the call
- p self
-end
-
-foo
-# => main
-
-
-This code demonstrates how self changes depending on the context. At the top level, it's main, an instance of Object. When foo is called without a receiver, it's called on main.
-
-
Singleton Methods
-
-You can add methods to individual objects. These are called singleton methods.
-
-
-
obj = "a string"
-
-def obj.shout
- self.upcase + "!"
-end
-
-p obj.shout
-# => "A STRING!"
-
-obj2 = "another string"
-# obj2.shout would raise a NoMethodError
-
-
-Here, the shout method is only available on the obj object. This is a powerful feature for adding behavior to specific instances.
-
-
Classes are Objects
-
-Classes themselves are objects, instances of the Class class. This means you can create classes dynamically.
-
-
-
MyClass = Class.new do
- def say_hello
- puts "Hello from a dynamically created class!"
- end
-end
-
-instance = MyClass.new
-instance.say_hello
-# => Hello from a dynamically created class!
-
-
-This shows how to create a new class and assign it to a constant. This is what happens behind the scenes when you use the class keyword.
-
-
Control Flow and Methods
-
-The book clarified many things about how methods and control flow work in Ruby.
-
-
case and the === operator
-
-The case statement is more powerful than I thought. It uses the === (threequals or case equality) operator for comparison, not ==. Different classes can implement === in their own way.
-
-
-
# For ranges, it checks for inclusion
-p (1..5) === 3 # => true
-
-# For classes, it checks if the object is an instance of the class
-p String === "hello" # => true
-
-# For regexes, it checks for a match
-p /llo/ === "hello" # => true
-
-def check(value)
- case value
- when String
- "It's a string"
- when (1..10)
- "It's a number between 1 and 10"
- else
- "Something else"
- end
-end
-
-p check(5) # => "It's a number between 1 and 10"
-
-
-
Blocks and yield
-
-Blocks are a cornerstone of Ruby. You can pass them to methods to customize their behavior. The yield keyword is used to call the block.
-
-
-
def my_iterator
- puts "Entering the method"
- yield
- puts "Back in the method"
- yield
-end
-
-my_iterator { puts "Inside the block" }
-# Entering the method
-# Inside the block
-# Back in the method
-# Inside the block
-
-
-This simple iterator shows how yield transfers control to the block. You can also pass arguments to yield and get a return value from the block.
-
-
-
def with_return
- result = yield(5)
- puts "The block returned #{result}"
-end
-
-with_return { |n| n * 2 }
-# => The block returned 10
-
-
-This demonstrates passing an argument to the block and using its return value.
-
-
Fun with Data Types
-
-Ruby's core data types are full of nice little features.
-
-
Symbols
-
-Symbols are like immutable strings. They are great for keys in hashes because they are unique and memory-efficient.
-
-
-
# Two strings with the same content are different objects
-p "foo".object_id
-p "foo".object_id
-
-# Two symbols with the same content are the same object
-p :foo.object_id
-p :foo.object_id
-
-# Modern hash syntax uses symbols as keys
-my_hash = { name: "Paul", language: "Ruby" }
-p my_hash[:name] # => "Paul"
-
-
-This code highlights the difference between strings and symbols and shows the convenient hash syntax.
-
-
Arrays and Hashes
-
-Arrays and hashes have a rich API. The %w and %i shortcuts for creating arrays of strings and symbols are very handy.
-
-
-
# Array of strings
-p %w[one two three]
-# => ["one", "two", "three"]
-
-# Array of symbols
-p %i[one two three]
-# => [:one, :two, :three]
-
-
-A quick way to create arrays. You can also retrieve multiple values at once.
-
-
-
Back to the main site
diff --git a/gemfeed/index.html b/gemfeed/index.html
index 9d0a1422..71bbc19c 100644
--- a/gemfeed/index.html
+++ b/gemfeed/index.html
@@ -15,7 +15,7 @@
-This site was last updated at 2025-10-11T15:41:33+03:00
+This site was last updated at 2025-10-11T15:44:10+03:00
The following stats were collected via uptimed on all of my personal computers over many years and the output was generated by guprecords, the global uptime records stats analyser of mine.