saturnflyer

Joined 16 years ago

Karma
318
Submissions
71
Member since
Apr 15
I'm the owner of Saturn Flyer, lead developer of Radiant CMS and author of Clean Ruby (http://www.clean-ruby.com)

[ my public key: https://keybase.io/saturnflyer; my proof: https://keybase.io/saturnflyer/sigs/1b51SrA-WjDVL6tnHd3bv3EXpAkCGn4nwo7b9ADqafQ ]

View on Hacker News

Recent submissions

Comment · 3 years ago
I'm on a project that isn't yet on ruby 3.2 and wanted to use the new Data class. I implemented this to allow me to move to it easily.

It does still have 1 failing test about redefining the initialize method with a block, but it works for all other cases.

The Ruby 3.2 Data class is based on C code from Struct. This is all implemented with Ruby.

Comment · 11 years ago
Interesting. What kind of stuff does this course have?
Comment · 11 years ago
Yes. Too often this is done even with complex procedures inside methods. A good DSL should be syntactic sugar for making things easy or at least provide some syntactic vinegar for doing non-recommended things (while still allowing them).
Comment · 11 years ago
Ah. I see. That Ruby doesn't afford this can be somewhat annoying. A counter example is using "alias". It can accept bare words, symbols, or strings. If you really wanted to get around this you could use method_missing on the class but that can open a can of worms.
Comment · 11 years ago
This surprises me. Can you offer an example of those types of problems in some Ruby code?
Comment · 11 years ago
Not yet. But you can signup for a 5-email crash course. It's being updated almost every day now as I add more content.
Comment · 11 years ago
I'm the author. In fact, the first bit of advice I have in the book is: Don't. DSLs often involve metaprogramming, but they don't have to. I'm writing it to record the code practices that I have found useful in getting things right and gather advice and tips from others who have done the same. DSLs are always about communication, so my goal is to create a book that helps developers communicate the purpose of the aspects of their project through code.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton