Better HN
topnewbestaskshowjobs
Log inSign up

saturnflyer

318 karma · joined Apr 14, 2010 (16y ago) · 71 submissions

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 ]

Submissions

comment 3y ago · link · parent

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.

2.

Polyfill-data gem adds the Ruby 3.2 Data class to lower Ruby versions(github.com ↗)

2 points · by saturnflyer · 3y ago · 1 comment

3.

Reading Ruby Metaprogramming Inside Devise(saturnflyer.com ↗)

2 points · by saturnflyer · 7y ago · discuss

4.

Fix it now(saturnflyer.com ↗)

1 points · by saturnflyer · 9y ago · discuss

5.

7 ways to evaluate Ruby gems, and 1 crazy idea(saturnflyer.com ↗)

1 points · by saturnflyer · 9y ago · discuss

6.

Why write code when more dependencies will do?(saturnflyer.com ↗)

2 points · by saturnflyer · 9y ago · discuss

7.

Building tools and building teams(saturnflyer.com ↗)

1 points · by saturnflyer · 9y ago · discuss

8.

Building a Ruby tool that's easy for your team to use(saturnflyer.com ↗)

2 points · by saturnflyer · 9y ago · discuss

comment 11y ago · link · parent

Interesting. What kind of stuff does this course have?

10.

Ruby: the difference between instance_eval and instance_exec(saturnflyer.com ↗)

3 points · by saturnflyer · 11y ago · discuss

comment 11y ago · link · parent

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 11y ago · link · parent

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 11y ago · link · parent

This surprises me. Can you offer an example of those types of problems in some Ruby code?

comment 11y ago · link · parent

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 11y ago · link · parent

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.

16.

Ruby DSL Handbook(clean-ruby.com ↗)

84 points · by saturnflyer · 11y ago · 29 comments

17.

Ruby Forwardable deep dive(saturnflyer.com ↗)

1 points · by saturnflyer · 11y ago · discuss

18.

Eastward Ho a Clear Path Through Ruby with OO(confreaks.com ↗)

1 points · by saturnflyer · 11y ago · discuss

19.

Forwarding Messages with Tell, Don't Ask(saturnflyer.com ↗)

2 points · by saturnflyer · 11y ago · discuss

20.

Delegation Is Everything And Inheritance Does Not Exist(saturnflyer.com ↗)

2 points · by saturnflyer · 13y ago · discuss

21.

How abstractions encourage good thinking(saturnflyer.com ↗)

3 points · by saturnflyer · 13y ago · discuss

22.

Easy Metaprogramming For Making Your Code Habitable(saturnflyer.com ↗)

34 points · by saturnflyer · 13y ago · 1 comment

23.

What to code (in Ruby) when you know what you want(saturnflyer.com ↗)

4 points · by saturnflyer · 13y ago · discuss

comment 13y ago · link · parent

Thanks for some fantastic feedback. I haven't read the worrydream link yet, but will check it out.

comment 13y ago · link · parent

thanks! I'd love to see what you do

26.

How to make your code imply responsibilities(saturnflyer.com ↗)

38 points · by saturnflyer · 13y ago · 9 comments

27.

How to work with presenters and collections of objects in Ruby(saturnflyer.com ↗)

1 points · by saturnflyer · 13y ago · discuss

28.

Finding conventions in Ruby code and handling display of dangerous data(saturnflyer.com ↗)

1 points · by saturnflyer · 13y ago · discuss

29.

The Easiest Way To Handle Displaying Bad Data in Ruby(saturnflyer.com ↗)

1 points · by saturnflyer · 13y ago · discuss

30.

Temporarily add behavior to Ruby objects with Casting(github.com ↗)

1 points · by saturnflyer · 13y ago · discuss

123