News

Escaping the Tar Pit: Introducing Skunk V0.3.2 at RubyConf 2019 - Ruby on Rails Upgrades

This year I had the honor to speak at RubyConf in Nashville.It was my second time attending the conference and first time as a speaker. Ita...

This year I had the honor to speak at RubyConf in Nashville.It was my second time attending the conference and first time as a speaker. Italked abo...

Working Around ActiveRecord Callbacks | Super Good Software

Here's a pragmatic strategy for getting things done when excessive ActiveRecord callbacks are getting in your way.

Rails 6 adds ability to block writes to a database – Saeloun Blog

Rails 6 adds the ability to block writes to a database even if the database user is able to write using connection.while_preventing_writes

Ruby Concurrency Progress Report

Open Source Progress Report

A Q&A with Eileen Uchitelle of GitHub

We talk with Eileen Uchitelle, Engineer at GitHub and Rails Core Team Member

How to Dynamically Update Your Sitemap in Ruby - The Lean Software Boutique

A few months ago I received the task of making the FastRuby.io sitemap refresh automatically after each deploy. That sounds like it would b...

A few months ago I received the task of making the FastRuby.io sitemap refresh automatically after each deploy. That sounds like it would be pretty...

RubyConf 2019 - Language as a Tool of Thought: Consistency versus Progress by Victor Shepelev - YouTube

Language as a Tool of Thought: Consistency versus Progress by Victor Shepelev Our programming language is not a mere instrument: it shapes ...

Language as a Tool of Thought: Consistency versus Progress by Victor Shepelev Our programming language is not a mere instrument: it shapes how we think about...

GitHub - tobymao/snabberb: A simple component view framework for Ruby Opal based on Snabbdom

A simple component view framework for Ruby Opal based on Snabbdom - tobymao/snabberb

GitHub - DocSpring/ruby_crystal_codemod: A codemod / transpiler that can help you convert Ruby into Crystal

A codemod / transpiler that can help you convert Ruby into Crystal - DocSpring/ruby_crystal_codemod

RubyConf 2019 - Fixing Performance & Memory problems by Frederick Cheung - YouTube

RubyConf 2019 - Fixing Performance & Memory problems by Frederick Cheung Performance problems got you down? Do memory leaks strike fear in ...

RubyConf 2019 - Fixing Performance & Memory problems by Frederick Cheung Performance problems got you down? Do memory leaks strike fear in your heart? In thi...

Ruby, Where do We Go Now? | Meta Redux

This article is part of the “Meta Advent 2019” series. I’ve committed to writing a new blog post here every day until Christmas. A wh...

This article is part of the “Meta Advent 2019” series. I’ve committed to writing a new blog post here every day until Christmas. A while ago I wrote an article, where I made the case Ruby seems to have lost its way. I thought I had exhausted the topic, but a few of the recent developments around the Ruby 2.7’s development lead me to revisit it. Ruby 2.7 has become infamous at this point for several highly controversial changes that were either quickly revised or removed. A classic tell-tale of good project management and a clear vision for the future, right? Let’s examine a few of those ill-fated changes in no particular order… Flip-flops Forever Remember how the flip-flop operator (..) was finally deprecated in Ruby 2.6 after years of discussions? Well, it just got (quietly) reinstated. I find it really amusing how this went down - 3 (!!!) people complained about the deprecation and Matz quickly responded with: I hear the negative feedback from the community. OK, I give up. The warning should be removed. – Matz There are numerous other instances where he ignored the complaints of way more people. Go figure. As usual, there was no real discussion on the ticket - just a decision. Not to mention that no one even thought to try to solicit more community feedback on the subject. I learned about the removal of the deprecation when someone posted this on Twitter… None of this is new, in Ruby-land it’s business as usual. It’s just becoming progressively more frustrating for me. Numbered Parameters Revisited Remember the highly controversial numbered block parameter syntax? # now [1, 2, 3].each { |i| puts i } (1..10).map { |i| i * 3 } (1..9).each_slice(3).map { |x, y, z| x + y + z } # Ruby 2.7 [1, 2, 3].each { puts @1 } (1..10).map { @1 * 3 } (1..9).each_slice(3).map { @1 + @2 + @3 } After quite the backlash this syntax was revised to something more reasonable: [1, 2, 3].each { puts _1 } (1..10).map { _1 * 3 } (1..9).each_slice(3).map { _1 + _2 + _3 } A great success, right? Matz made a couple of interesting comments on this mega-thread. My favourite one was: Yes, I admit { @1[@2] = “Go Fish: #{@2}” } is cryptic. But {@1 * @2} is not. So use numbered parameters with care (just like other features in Ruby). The possibility to make code cryptic itself should not be the reason to withdraw a feature. The problem is introducing it or this could break existing code. That is the problem. Numbered parameters are a compromise to simplify block expression without breaking compatibility. FYI, I am not fully satisfied with the beauty of the code with numbered parameters, so I call it a compromise. – Matz So, he accepted something that he wasn’t perfectly happy about. OK, I can understand the need for compromises from time to time. But I totally hate this line of reasoning “The possibility to make code cryptic itself should not be the reason to withdraw a feature.”. I think that adding features for the sake of adding them is not a reason to add something either. I also think that we should be careful with the impact of features on tools and with all the accidental complexity they bring (e.g. now Ruby parsers are more complex). Not to mention the fact that no one could make a strong case for introducing this feature in the first place. I’m still not sure what’s the grand problem it solves… The Totally Useless Pipeline Operator This was probably the most ridiculous part of Ruby 2.7’s development cycle. At some point the pipeline operator landed in master: # now foo() .bar(1, 2) .display # Ruby 2.7 foo() |> bar 1, 2 |> display Everyone who has actually used the pipeline operator in Elixir (the source of inspiration for this change), however, knows that it behaves nothing like this. Here Ruby’s team basically came up with different syntax for . (method invocation) with a lower precedence that allowed you to do questionable things like: (a..b).each {} a..b |> each {} I won’t go into much details about this misguided operator. After all, a lot of great articles exist about it already.1 For me the important things here are: This feature was not well thought-out It generated a massive backlash It was quickly reverted Sounds familiar, doesn’t it? The Rise and Fall of the Method Reference Operator Ruby 2.7 was supposed to introduce a method reference operator: [2, 4, 8, 16, 32].map { |n| Math.log2(n) } [2, 4, 8, 16, 32].map(&Math.:log2) Well, not anymore. This feature was recently reverted. There were some good reasons for it to be reverted, which serves to underline my point that a lot of changes to Ruby recently were made without thinking much about their implications. Matz, made one particularly interesting comment on this ticket: In recent years, we have added/discussed a lot of features inspired by functional programming. But those features are not designed with a grand design. Those are rather ad hoc additions. We felt the future, more functional Ruby should be designed with the big picture of functional Ruby programming, which we lack currently. Besides that, I don’t like the specific operator (.:) which looks like braille. So you don’t have to consider this revert as a rejection of this whole idea, but an invitation to the next try. – Matz I was really glad to see this, as it seems that Matz also understands that without a solid vision in the end we’ll just get one big mess. I’m a bit sad about the .: operator being reverted, as this was a feature I could see myself using, but that’s a small price to pay for a better future of Ruby. Parameter Forwarding Weirdness Just when I had some hope about the future I came across another “brilliant” addition to Ruby 2.7 - parameter forwarding. It’s best explained with an example: def foo(...) bar(...) end This defines a method foo, that can have any parameters whatsoever and simply forwards all of them to bar. I don’t know about you, but I always wanted something like this!2 There are some plans to make it a bit more generic and support forwarding a subset of all parameters: def foo(a, b, ...) if a.even? bar(b, ...) end end Still, I think this is another random addition that doesn’t solve real problems and just adds mental and technical complexity. Epilogue So, we made it to the end of this somewhat bitter and rantish article. So, what’s the takeaway from all of this, if any? It’s good that Ruby’s team listens to user feedback, but it might also be nice for them to actually start asking about feedback in some more open/structured manner prior to making language changes. Especially given their recent track record with the Ruby community… You can’t really expect everyone to be monitoring all tickets in Ruby’s issue tracker, right?3 I’ve often dreamt of a state where Ruby’s team actually announces in advance the focus for the next release (a.k.a. a roadmap), so interested parties can actually go and help with the tasks at hand. That should not require that much extra work - just a bit of good old planning. Some voting system on tickets and annual surveys might be a good idea as well - other programming communities are making good use of those. Many people are excited about Ruby 3.0, but I’m not. It’s a major release in theory, but in practice it will add relatively little to what we have today. It’s not even clear if the new concurrent programming model will make it there or not at this point. Ruby 2.7 has showed better than ever the chaos in Ruby’s development and the lack of a clear direction/destination. There are some signs that Matz understands this as well, so I’m still optimistic about the future. I think Matz should take a page from Rich Hickey’s4 book and take a bit of hammock-time to figure out where he wants to take Ruby next. So, Ruby, where do we go now? That’s my favourite one https://dev.to/baweaver/ruby-2-7-the-pipeline-operator-1b2d. ↩ You can’t here my voice, but that’s sarcasm here. ↩ Especially given the fact that the vast majority of ideas for language changes are just ignored and stay dormant for ages. ↩ The author of Clojure. ↩

GitHub - square/ast_builder: AstBuilder is a tool to make it easier to work with and compose S-Expressions and other AST related tasks in Ruby

AstBuilder is a tool to make it easier to work with and compose S-Expressions and other AST related tasks in Ruby - square/ast_builder

Ruby 2.7 adds shorthand syntax for arguments forwarding – Saeloun Blog

Ruby 2.7 has added new syntax `...` for method arguments forwarding.

RubyConf 2019 - The Functional Rubyist by Joe Leo - YouTube

RubyConf 2019 - The Functional Rubyist by Joe Leo Functional programming’s popularity is on the rise and support for FP is growing in Rub...

RubyConf 2019 - The Functional Rubyist by Joe Leo Functional programming’s popularity is on the rise and support for FP is growing in Ruby. But can you reall...

Rails 6.1 adds *_previously_was attribute methods | BigBinary Blog

Rails 6.1 adds *_previously_was attribute methods for dirty tracking

RubyConf 2019 - Escaping The Tar Pit by Ernesto Tagwerker - YouTube

RubyConf 2019 - Escaping The Tar Pit by Ernesto Tagwerker Nobody wants to inherit a project that reeks but here we are: Stuck in the tar pi...

RubyConf 2019 - Escaping The Tar Pit by Ernesto Tagwerker Nobody wants to inherit a project that reeks but here we are: Stuck in the tar pit. How can we get ...

Ruby Conferences ‘n’ Camps in 2020 - What’s Upcoming? | calendar

Rails 6 adds ActiveSupport::ParameterFilter – Saeloun Blog

Rails 6 has moved ParameterFilter from ActionDispatch to ActiveSupport in order to support filtered attributes with ActiveRecord::Relation#...

Rails 6 has moved ParameterFilter from ActionDispatch to ActiveSupport in order to support filtered attributes with ActiveRecord::Relation#inspect.

Blogcop: A GitHub App That Helps You Manage Your Jekyll Blog - The Lean Software Boutique

At OmbuLabs we use Jekyll to generate our blog. If you are not familiar with it, here is a quick description from the Jekyll site:"Jekyll i...

At OmbuLabs we use Jekyll to generate our blog. If you are not familiar with it, here is a quick description from the Jekyll site:"Jekyll is a...

Michael Hartl, Author of The Ruby on Rails Tutorial - Rails with Jason Podcast - Code with Jason

Rails 6.0.2.rc1 has been released! | Riding Rails

Hi everyone,

Using Rubyfmt with Atom | Schwad

I am a Full Stack Ruby on Rails Software Engineer enjoying solving challenging problems.

From jQuery to ES6 | Drifting Ruby

jQuery has been a great tool for many years, but we've seen a transition in the past years where applications have dropped jQuery and moved...

jQuery has been a great tool for many years, but we've seen a transition in the past years where applications have dropped jQuery and moved to vanilla

Lawrence Mandel on Twitter: "Internet: Ruby doesn’t scale. Ruby: Sorry. I’m busy over here processing $1.5M+ USD Gross Merchant Value (GMV) per minute and 14K+ orders per minute running global #BFCM with @ShopifyEng. #ruby #scale 💪💪💪 #lifeatshopify https://t.co/O7GOblzcbv… https://t.co/Ah7Yhf3oO9"