<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>solnic.codes - Latest Comments</title><link>http://solnic-eu.disqus.com/</link><description></description><atom:link href="https://solnic-eu.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 07 Nov 2022 16:25:27 -0000</lastBuildDate><item><title>Re: WHOOPS! Thoughts on Rails, forking and leadership</title><link>https://solnic.codes/2021/05/01/whoops-thoughts-on-rails-forking-and-leadership/#comment-6034007756</link><description>&lt;p&gt;You clearly didn't read &lt;a href="https://dhh.dk/2012/rails-is-omakase.html" rel="nofollow noopener" target="_blank" title="https://dhh.dk/2012/rails-is-omakase.html"&gt;"Rails is omakase"&lt;/a&gt;, did you now?&lt;/p&gt;&lt;p&gt;Apple did not became successful because Jobs said "let's ask out users what they want, and remove what they don't want". Nor did Gates. Nor Bezos. Carnegie. Rockefeller. Page. Brin. Branson. Ford. Musk. &lt;i&gt;"Oi, Musk, I don't like that your cars have electric motors, remove that pile'o'junk right-oiking-now! And put the petrol back in there, pronto, mate, you hear me?? And remove that creepy autopilot, it's freaking me out! And LIDAR! I want LIDAR, NOWWWWWWWaaawawawaww"&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;I have a reason to believe those people, nor their companies, would not became as successful as they are/were, if they were listening to every single unhappy rant out there.&lt;/p&gt;&lt;p&gt;You can not make a copy of Microsoft and move on with a mix of communism/democracy ruled by the end users. You can do so with Rails though. And you're right, it'll bring problems and fragmentation, but &lt;b&gt;if&lt;/b&gt; your approach is better and &lt;b&gt;if&lt;/b&gt; it really worth the switch - then, eventually, ecosystem will move to your fork. But if you really look at this and realise that your fork will never become a worthy competitor - then, maybe, by a chance, that idea of yours, your vision is not that good after all, huh?..&lt;/p&gt;&lt;p&gt;And, as a final note, when you feel like you, and a handful of likeminded people around you, is &lt;b&gt;right&lt;/b&gt;, while hundreds and thousands of other people around you are, in your opinion, &lt;b&gt;wrong&lt;/b&gt;, then maybe, just maybe, &lt;i&gt;they&lt;/i&gt;'re &lt;b&gt;not&lt;/b&gt; the ones who are wrong, but &lt;i&gt;you&lt;/i&gt; are. Give it some thinking, huh?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Foo Bar</dc:creator><pubDate>Mon, 07 Nov 2022 16:25:27 -0000</pubDate></item><item><title>Re: Cutting Corners or Why Rails May Kill Ruby</title><link>https://solnic.codes/2015/06/06/cutting-corners-or-why-rails-may-kill-ruby/#comment-6033971939</link><description>&lt;p&gt;A bit late to the party (call me a slowpoke, but hey), but I got a bit of a reality check here for you fellows.&lt;/p&gt;&lt;p&gt;Rails are bad.&lt;/p&gt;&lt;p&gt;Okay.&lt;/p&gt;&lt;p&gt;They do lots of bad, wrong, despicable things.&lt;br&gt;They promote sloppiness and laziness.&lt;br&gt;They are bloated and their author is arrogant.&lt;/p&gt;&lt;p&gt;But they're &lt;i&gt;comfortable&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;Fast-food. Instant noodles. Single-use dishes. Junk food. Nail biting. Smoking. Drinking. Car riding instead of walking. Chairs! Yes, chairs! - sitting a lot is bad, but we spend no less than 8 hours in it each day! Eating in the bed, wearing t-shirts to work, happy socks, non-leather shoes, turtleneck-jeans-and-sneakers instead of Desmond Merrion Bespoke and Bruno Mars classic oxfords (feel snobbish yet?). TYPING. Typing instead of coursive writing! Are you too old enough that you were taught in school to write by pen in a pretty cursive manner? Because it should be pretty! It should be &lt;b&gt;right&lt;/b&gt;! When was the last time you cared about it though?..&lt;/p&gt;&lt;p&gt;We do all those things. Eat, wear, use, do, type on keyboard. Some more, some less. But do tell, do you not eat junk food? Do you not enjoy it?... A fat burger full of heart-attack-inducing cheese? Chinese takeout? Cheesier-than-your-jokes pizza? A most comfortable plimsolls your feet has ever made love to but that are considered plain &lt;i&gt;wrong&lt;/i&gt; by some snobbish folks from Ivy-something? Because they're *-ing comfortable! Tasty! Cozy! Comfy, lovely, snuggy, warm feeling that you just enjoy every single goddamn day. &lt;i&gt;*in a cranky voice* But it's wroooong. Caw. Caww. Wrooooooong.&lt;/i&gt; Well you know what? Go be Ivy somewhere else. And leave us to enjoy our sins in peace.&lt;/p&gt;&lt;p&gt;Here, have a potato: &lt;a href="https://9gag.com/gag/a85VgLV" rel="nofollow noopener" target="_blank" title="https://9gag.com/gag/a85VgLV"&gt;https://9gag.com/gag/a85VgLV&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Foo Bar</dc:creator><pubDate>Mon, 07 Nov 2022 15:44:45 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-6033924043</link><description>&lt;p&gt;The analogy is wrong because you have misunderstood languages and dialects. Dialects are not freak versions of languages; rather, what is perceived as standard forms of languages are also dialects, albeit with power (an army, economic resources, political rule over surrounding areas) behind them that allows for deeming them as the standard forms. Dialects come first; languages second. To call one dialect more correct that another is nonsensical.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dkdld</dc:creator><pubDate>Mon, 07 Nov 2022 14:50:44 -0000</pubDate></item><item><title>Re: Get Rid of That Code Smell &amp;#8211; Control Couple</title><link>https://solnic.codes/2012/04/11/get-rid-of-that-code-smell-control-couple/#comment-5776381339</link><description>&lt;p&gt;While I agree with you that it is a good way to remove the smell using subclasses, I’m not sure that you are getting some performance boost. I’d reckon the opposite. Because by subclassing, you are adding a lookup to the vtable. Furthermore, it will make the distance of the object in the memory larger. Thus, that is a cache miss (ie. it can’t be cached by the L1 and L2 caches).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bawenang Rukmoko</dc:creator><pubDate>Thu, 03 Mar 2022 08:20:02 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5740641143</link><description>&lt;p&gt;It suggests that there might be a missing layer in between (I don't know the internals, I'm speculating). I'd put having that layer as a hard requirement for any DSL: DSL should just delegate to simple objects underneath. Now of course, that call will not look pleasant, but the DSL is there to hide it.&lt;br&gt;This approach brings on the table a very simple but powerful concept "Replace the API when needed". Turns out, it's a very useful concept, routes + Controllers do the same thing.&lt;/p&gt;&lt;p&gt;There is also another point that is overlooked: DSL doesn't imply having a special sytnax. A "DSL" could be a bunch of objects interacted in the traditional way, just with a well-known language.&lt;/p&gt;&lt;p&gt;As for schema definition, Ecto (elixir) is a good example of what part should be "custom DSL" and what part should be "just functions" (or objects in OOP-land). I wish there was something like that in the Ruby world. It's a simple data structure built on conventions.&lt;/p&gt;&lt;p&gt;Anyway, sorry, I didn't want to turn this into a post this. I'd choose dry-rb over Rails activemodel (and attributes and validations) any time. I do think there is room for further improvement.&lt;br&gt;It would be easier to discuss this on a virtual call though, the amount of chat that would go into this is extensive.&lt;/p&gt;&lt;p&gt;As for Rails "monopolize" monkey patching, true, although the developers that reach a certain do develop a distaste for what Rails has done.&lt;/p&gt;&lt;p&gt;One point that made me scratch my head is the example about TimeCalc. I think the API could be greatly improved without any sort of monkey patching. An example:&lt;/p&gt;&lt;p&gt;=&amp;gt; TimeCalc['2019-03-14 08:06:15'] + [3, :months]&lt;br&gt;&lt;a href="http://TimeCalc.call" rel="nofollow noopener" target="_blank" title="TimeCalc.call"&gt;TimeCalc.call&lt;/a&gt; in this case would need to do some type checking, but `call` would be the "DSL" part of it, the one that does the dirty stuff. &lt;a href="http://TimeCalc.new" rel="nofollow noopener" target="_blank" title="TimeCalc.new"&gt;TimeCalc.new&lt;/a&gt; should only accept one type, which could be Time&lt;/p&gt;&lt;p&gt;There is the option (yeah, monkey patching) of making a CapitcalCase method:&lt;/p&gt;&lt;p&gt;=&amp;gt; TimeCalc('2019-03-14 08:06:15') + [3, :months]&lt;/p&gt;&lt;p&gt;This is indeed monkey patching, but the chance of conflicts are low if the gem name is used as the method name, which could as well become a ruby convention.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Francesco Belladonna</dc:creator><pubDate>Wed, 16 Feb 2022 23:03:26 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5738355383</link><description>&lt;p&gt;It's amazing that 15 or so years later that this is still something we have to debate about. The early JavaScript days like Scriptaculous\Prototype and others learned the hard way at the same time. Surprised the community hasn't moved past this?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">...</dc:creator><pubDate>Tue, 15 Feb 2022 21:46:45 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5729899968</link><description>&lt;p&gt;I'm so glad you mentioned this. There are methods in ActiveSupport that only exist because Rails' design is missing crucial abstractions. One of the biggest design flaws is the lack of proper coercion and validation abstraction for external input. `presence?` and `blank?` are not needed, period. They exist only because Rails' has taught people to pass unprocessed input directly to the domain "layer" where things like hashes with string keys or uncoerced booleans create more complexity, complexity that is not needed.&lt;/p&gt;&lt;p&gt;This is one of the reasons why I created dry-schema because external input should always be preprocessed before you can work with it. Hashes with string keys should be converted to symbolized hashes, rather than using HWIA (which is a huge code smell BTW). Boolean values should be coerced into `true` or `false`, so that there's no ambiguity about what type of objects represent true or false. If `nil` is allowed and can have a different representation (ie a empty string), then such input should be coerced to `nil` rather than allowing empty strings to be passed down and handled via `blank?` or `present?`. If you have a value that can be an empty array *or* nil, you also don't need `blank?/present?` and instead, you could use Maybe monad, which is a safer way to handle `nil` because *you must* handle the case where something is nil, which ensures you won't get the most famous of all exceptions.&lt;/p&gt;&lt;p&gt;&amp;gt; There are lots of other examples of core problems with ruby that are mitigated by ActiveSupport&lt;/p&gt;&lt;p&gt;This is exactly what I'm talking about. People are used to solving problems using questionable techniques *because* of ActiveSupport. These are not core problems with Ruby, these are mostly problems with how Rails is designed.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">solnic</dc:creator><pubDate>Fri, 11 Feb 2022 02:42:26 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5729893424</link><description>&lt;p&gt;&amp;gt; I think dry-rb tries too much to "protect from external developers" the internals of dry-rb and there is an over-use of DSL.&lt;/p&gt;&lt;p&gt;I suspect it's an impression you have. You're probably talking about dry-schema/validation specifically. Using POROs with a nice API is actually how dry-rb gems are designed. People keep pointing at dry-schema's DSL as if everything else was so DSL-heavy, which is not the case, and dry-schema is *a very special type of a library*. I can assure you an advanced DSL is needed for defining schemas, if you were to define a schema with 10+ keys using PORO-oriented approach, you'd suffer. There's a similar sub-thread about this here, you can check it out: &lt;a href="http://disq.us/p/2ml84xw" rel="nofollow noopener" target="_blank" title="http://disq.us/p/2ml84xw"&gt;http://disq.us/p/2ml84xw&lt;/a&gt;&lt;/p&gt;&lt;p&gt;There *is* a PORO-API for defining schemas, but it's too low level at the moment, so it's not exposed as a public API (yet). ie:&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;dry-schema&amp;gt; Dry::Schema::Macros::Required.new(:name).to_ast&lt;br&gt;=&amp;gt; [:predicate, [:key?, [[:name, nil], [:input, Undefined]]]]&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;You could have a convenient shim on top to automatically put together a schema, but there's *much more* involved in a schema creation process which people don't know because it's hidden by the DSL. There are types, there's coercion, there's key validation, there's a pre-coercion validation and so on. If you were to define all of that using PORO approach, schema definitions would become extremely verbose.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">solnic</dc:creator><pubDate>Fri, 11 Feb 2022 02:28:53 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5729747659</link><description>&lt;p&gt;Thank you, I appreciated the article and agree with the entirety of it.&lt;br&gt;I do have a point against dry-rb libraries because they do have their own internal DSL, but don't provide also "PORO" API. To clarify, my rule of thumb is: a DSL should just delegate functionality to plain old ruby object, so that people can opt-out (or enhance, or change) of the DSL and instead just use ruby classes for the purpose.&lt;/p&gt;&lt;p&gt;Everyone is familiar with:&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;CoerceIntegerFromString.new(some_data).call&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;But you actually need to study that&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;# dry-validate&lt;br&gt;something.filled(:string)&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Of course this example is trivial, but this should be extended to every DSL.&lt;br&gt;I think dry-rb tries too much to "protect from external developers" the internals of dry-rb and there is an over-use of DSL.&lt;br&gt;Remember, everyone is familiar with a simple ruby object. Familiarity is very important, but for some reason we continuously and constantly expect people to learn "new programming languages" (dialects) because they look more like English.&lt;br&gt;I'd rather be able to onboard 100 people because they all know Ruby than make the DSL more English-like so that it looks nicer.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Francesco Belladonna</dc:creator><pubDate>Thu, 10 Feb 2022 22:12:42 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5729495418</link><description>&lt;p&gt;In general, I don't like monkey patching either. But ruby has some real deficiencies that aren't addressed by the core/standard library.&lt;/p&gt;&lt;p&gt;Since only nil and false are falsy, a lot of conditionals end up having to roll their own logic for falsy values like empty array/hash/string. E.g. in python or js you might do&lt;br&gt;```&lt;br&gt;data = fetch_some_data()&lt;br&gt;if (data):&lt;br&gt;  # do stuff with data&lt;br&gt;```&lt;/p&gt;&lt;p&gt;In ruby you always have to do something like `if data &amp;amp;&amp;amp; data.length &amp;gt; 0`, assuming it even has a length. Adding active support means you can do `data.present?` or `data.blank?`.&lt;/p&gt;&lt;p&gt;Similarly, ruby 1.9 added JS style hash declaration, which is great and uses symbols as keys. But if you try to read a hash from an unknown source or partially known source, or where some monkey is patching in string keys, now everything is a mess. Was it `params[:id]` or `params["id"]`? Mutable by default strings was a mistake, and it's getting corrected in ruby 3, but it's far too late. Active support adds HashWithIndifferentAccess, and patches Hash to have `.with_indifferent_access` to fix this.&lt;/p&gt;&lt;p&gt;There are lots of other examples of core problems with ruby that are mitigated by ActiveSupport. If I could merge all of it into ruby core, I would.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Caleb Meyer</dc:creator><pubDate>Thu, 10 Feb 2022 17:15:13 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5729478392</link><description>&lt;p&gt;I've been a Rubyist for over ten years.  Not once have I ever worked on a Rails project.  What I have done is inherit a large(!) amount of code in which one of the original authors (the boss, an old SmallTalk wizard) was &lt;i&gt;quite liberal&lt;/i&gt; with monkey patching.  Holy Moly, what a pain in the patootie that was, especially when I was a more junior programmer and hadn't the chops to quickly extract myself from each morass.&lt;/p&gt;&lt;p&gt;I'll admit to monkey patching in my early days.  I no longer even think about doing so.  I can usually acheive my goals in some other, more compartmentalized way.  On the rare occasions when I do want to add functionality to a core library or something from stdlib -- Refinements!  I see others are mentioning refinements too; and for good reason.  They're right, they don't cover every base that monkey patching does, but perhaps  those use cases that refinements don't cover shouldn't be implemented at all?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dorcus_maximus</dc:creator><pubDate>Thu, 10 Feb 2022 17:00:19 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5729172822</link><description>&lt;p&gt;I think this is an excellent article - software development and engineering is always evolving. I've personally never thought too closely how as Rubyists we're told to avoid monkey patching, but also be okay with the monkey patches from ActiveSupport.&lt;/p&gt;&lt;p&gt;Composing classes and using dependency injection is a significantly easier to understand pattern, it does take away a bit from the "magic" of Ruby on Rails ...though I'd argue that it's okay to see how the magic works.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam Runner</dc:creator><pubDate>Thu, 10 Feb 2022 13:36:02 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5727342790</link><description>&lt;p&gt;&amp;gt; You argue that Rails have the "monopoly for monkey-patching", but by adding a DSL with no class/object equivalent version, you also have a "monopoly on the API" - filled(:str?) is WAY more beautiful than filled(NumberString)&lt;/p&gt;&lt;p&gt;I'm not sure what you mean by that. Everybody can implement DSLs without causing issues like monkey-patching. As I understand, you're talking about various limitations of DSLs depending on how they are implemented.&lt;/p&gt;&lt;p&gt;Regarding APIs for transforming schemas, it's just still a WIP. Like I said, you can merge schemas, you can even compose schemas like `schema1 &amp;amp; schema2` and more features will be implemented eventually. An object-only API would be very simple to implement, but you still need a formal representation of a schema if you want to easily process it, ie export it to another format, generate another representation etc.&lt;/p&gt;&lt;p&gt;Your approach with using hashes is actually similar to what's going on under the hood, it's just that we have the AST, and you have a Hash. Processing ASTs is much simpler than processing Hashes though, that's why we have it.&lt;/p&gt;&lt;p&gt;&amp;gt; I can do the same in dry-schema and dry-validations. But can I write a dry-schema and just "include" it in Hanami?&lt;/p&gt;&lt;p&gt;This will be possible in Hanami 2.0&lt;/p&gt;&lt;p&gt;&amp;gt; Or can I write a dry-schema and, before adding it on a Hanami controller, make all fields optional?&lt;/p&gt;&lt;p&gt;There's no public API for transforming schemas like that, but it will be done eventually, most likely in dry-schema 2.0.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">solnic</dc:creator><pubDate>Wed, 09 Feb 2022 03:37:18 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5727338440</link><description>&lt;p&gt;FYI disqus decided that you're posting spam, that's why your other comment didn't show up. I just fixed it by adding you to a "trusted users" list. Sorry about that, I'm planning to migrate from disqus to something else eventually.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">solnic</dc:creator><pubDate>Wed, 09 Feb 2022 03:28:32 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5726783699</link><description>&lt;p&gt;I'm not sure I'll be able to answer, because Discuss is being weird, but I meant that RSpec have magic, not monkey-patches. Yes, I love the convenience of RSpec but I have to mention that I did got into trouble multiple times with it_behaves_like, and the one-liner syntax...&lt;/p&gt;&lt;p&gt;I mean, they are useful and the code really reads like English, but when you have to declare more than five "let"s and a subject to be able to reuse tests from other places (a pattern that I saw way too many times), I kept thinking if there was any other way that I could compose things...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mauricioszabo</dc:creator><pubDate>Tue, 08 Feb 2022 18:05:52 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5723791074</link><description>&lt;p&gt;I agree with this in principle, though in practice using AS judiciously feels pretty comfortable.&lt;/p&gt;&lt;p&gt;We should also also note that since a few years ago Rails offers the option of loading as little from ActiveSupport as possible: config.active_support.bare.&lt;/p&gt;&lt;p&gt;And the list of features that *every* component of Rails depends on is pretty small: &lt;a href="https://github.com/rails/rails/blob/main/activesupport/lib/active_support/rails.rb" rel="nofollow noopener" target="_blank" title="https://github.com/rails/rails/blob/main/activesupport/lib/active_support/rails.rb"&gt;https://github.com/rails/ra...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dgutov</dc:creator><pubDate>Sun, 06 Feb 2022 09:06:17 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5722660406</link><description>&lt;p&gt;Thanks for the article. My personal position is that monkey-patching of core classes is the reserve of top-level application authors and should not be done by libraries,&lt;i&gt;unless&lt;/i&gt; the client programmer explicitly opts in to it. If they don't opt in, the library should still be usable, though perhaps with slightly more verbose syntax.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Dowad</dc:creator><pubDate>Sat, 05 Feb 2022 07:32:24 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5722553527</link><description>&lt;p&gt;👋 RSpec maintainer here, RSpec has had a zero monkey patching mode since the release of RSpec 3 in 2014, and will be the only option in RSpec 4.&lt;/p&gt;&lt;p&gt;The custom matchers may look like global methods but they are not, your tests run inside an instance of an RSpec example class, and the matchers are methods on that class that return composable classes. Its possible to instantiate matchers directly (and we do internally) if you need to (and is how we compose some matchers ourselves). You could argue creating new matchers (with or without our DSL, we support both) is monkey patching our library, which I would say is a fair and valid use of monkey patching, but it doesn't leak out into the rest of the application eco system, and we go to lengths to make sure we don't poison any of your code with our internal needs, even trying very hard to avoid requiring anything in the standard library (literal require that is)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">JonRowe</dc:creator><pubDate>Sat, 05 Feb 2022 04:03:39 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5721811394</link><description>&lt;p&gt;It took me years to transfer from falling in love with monkey-patching to composable objects with clear boundaries and more abstractions.&lt;/p&gt;&lt;p&gt;When I was Junior, still at University, and I realized the heavy usage of monkey-patching, I felt sth is definitely wrong somwhere but it was not possible to argument the less convienient path, especially when more experienced rails developers said otherwise.&lt;/p&gt;&lt;p&gt;And I think this is a big problem. Decrease of ruby popularity shows that people are just tired with the mainstream (rails) approaches that generate problems over time so people switch.&lt;/p&gt;&lt;p&gt;I hope by publishing more such great argumentations will have positive impact though! Great argumentation!&lt;/p&gt;&lt;p&gt;PS: now I finally understand why you say "czy"!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sebastian Wilgosz</dc:creator><pubDate>Fri, 04 Feb 2022 12:59:11 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5721774550</link><description>&lt;p&gt;&amp;gt; It’s not the first time when I talk about this topic, and I actually really don’t like to repeat myself&lt;/p&gt;&lt;p&gt;I treat my blog more like a garden and I don't think one should ever hesitate to go back and tweak older articles.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sebastian Wilgosz</dc:creator><pubDate>Fri, 04 Feb 2022 12:30:07 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5721737036</link><description>&lt;p&gt;&amp;gt; For the love of Matz, the alternative is to just use Ruby.&lt;/p&gt;&lt;p&gt;To start, I almost completely agree with you from a software engineering standpoint. Mission critical gems should usually aim to minimize their impact on code that requires them.&lt;/p&gt;&lt;p&gt;On the other hand, one thing that has always attracted me to Ruby is that it does not always prioritize traditional software engineering values. In other ecosystems I am often expected to use pure, established idioms. Ruby, on the other hand, gives me the freedom to teach the language how I want to express ideas in straightforward code, to bend the rules, to have fun. In this way it is not unlike Smalltalk, Forth, Lisp -- all languages invented before everybody was so worried about boring issues like long term maintainability of code and "composable APIs".  :-)  I am exaggerating for effect, here, clearly.&lt;/p&gt;&lt;p&gt;I think it is funny you invoke Matz (in a joking way), because Matz clearly designed Ruby to make monkey patching easy. Have a read of this old article from 2003, especially the section on "Orthogonal versus Harmonious": &lt;a href="https://www.artima.com/articles/the-philosophy-of-ruby" rel="nofollow noopener" target="_blank" title="https://www.artima.com/articles/the-philosophy-of-ruby"&gt;https://www.artima.com/arti...&lt;/a&gt;. There are examples of monkey patching within the standard Ruby libraries, too.  Require some thing and suddenly some other class has more methods!&lt;/p&gt;&lt;p&gt;I also think "1.day.ago" is an example of a monkey patched API done right. I'm less happy with API's like &lt;a href="https://github.com/zverok/time_calc" rel="nofollow noopener" target="_blank" title="https://github.com/zverok/time_calc"&gt;https://github.com/zverok/t...&lt;/a&gt;.  "1.day.ago" is harmonious.  It reads exactly like I think.  1 is still a number -- monkey patching doesn't change that. "day" applied to a number is a duration, and "ago" applied to a duration gives me a time in the past.  All very natural, assuming the grammatical rules of English feel natural.  In contrast, time_calc lib asks me to figure out how to say the same thing in a more convoluted way, with parentheses, etc. It requires a translation step between the concept as I think of it and the program code, which is a chore. I write Ruby precisely when I want freedom from such chores.&lt;/p&gt;&lt;p&gt;You say ActiveSupport has a monopoly on monkey patching, which isn't really true in practice. Has the set of monkey patched methods in ActiveSupport really undergone massive churn over the years? Other gems are free to monkey patch. If they choose not to it isn't because ActiveState makes a different choice. Why be happy with granting that same monopoly to the Ruby core? Who is to say that some other group of people get to decide what dialect of Ruby I prefer to write in? How do I try out ideas and prove their utility before adoption into the core? Why must I always do this "in my own code base" and why is sharing these ideas bad?&lt;/p&gt;&lt;p&gt;As a side note, your &lt;code&gt;validate_phone_number&lt;/code&gt; example is interesting because some other functional programming languages solve that problem with the "arrow operator", which is like chaining but without an implied receiver object. The desire to want to monkey patch is also, I think, a natural consequence of the OO design pattern. One issue with Smalltalk systems, which Ruby borrows heavily from, was that their class hierarchies often became rats nests of methods high up in the inheritance chain (just look at Squeak Smalltalk at some point -- there are crazy things like the Object class knowing how to play itself as a sound or animation, etc.). I think this set of problems is one reason OO design is falling out of fashion.&lt;/p&gt;&lt;p&gt;Now, to finish where I started, from the point of view of prioritizing maintenance chores over all else, monkey patching has clear drawbacks, and on this I completely agree! I hope to point out, though, that this is not an issue of absolutes. The drawbacks are merely that, and monkey patching also has benefits.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Armstrong</dc:creator><pubDate>Fri, 04 Feb 2022 12:00:30 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5721617562</link><description>&lt;p&gt;This is always an issue for small projects. If you are used to work with Rails, you'll be surprised how many things you take for granted.&lt;/p&gt;&lt;p&gt;I remember seeing a quiz asking which features were from Rails (ActiveSupport) and which from Ruby. Most people just failed miserably distinguishing them, inlcuding me :P&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gosukiwi</dc:creator><pubDate>Fri, 04 Feb 2022 10:24:49 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5720392531</link><description>&lt;p&gt;Hey Piotr. 👋 Great article, and thanks for taking the time to write this. Now I have one more source of truth to pull from when people bug me about this too because it drives me up the wall as well.&lt;/p&gt;&lt;p&gt;One solution to this problem is to use refinements (I commented on this below as well). I'd be curious what your thoughts on this are and whether that bolsters your argument or detracts from it?&lt;/p&gt;&lt;p&gt;Here's my article and gem which I've written at great length on in case it's of interest and helps provide more background:&lt;/p&gt;&lt;p&gt;- &lt;a href="https://www.alchemists.io/articles/ruby_refinements" rel="nofollow noopener" target="_blank" title="https://www.alchemists.io/articles/ruby_refinements"&gt;Article&lt;/a&gt;&lt;br&gt;- &lt;a href="https://www.alchemists.io/projects/refinements" rel="nofollow noopener" target="_blank" title="https://www.alchemists.io/projects/refinements"&gt;Gem&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I'm not saying refinements are a panacea. Like anything, when used judiciously, I think they are quite powerful and &lt;i&gt;much better&lt;/i&gt; than monkey patching.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Brooke Kuhlmann</dc:creator><pubDate>Thu, 03 Feb 2022 14:50:45 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5720376840</link><description>&lt;p&gt;I'm a fan of refinements for this very reason. Here's the &lt;a href="https://www.alchemists.io/projects/refinements" rel="nofollow noopener" target="_blank" title="https://www.alchemists.io/projects/refinements"&gt;Refinements&lt;/a&gt;&lt;br&gt; gem that I use in a lot of my work. ...and here's my &lt;a href="https://www.alchemists.io/articles/ruby_refinements" rel="nofollow noopener" target="_blank" title="https://www.alchemists.io/articles/ruby_refinements"&gt;Refinements&lt;br&gt; article&lt;/a&gt; that breaks all of this down even further. Maybe &lt;br&gt;that's some encouragement? 😅&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Brooke Kuhlmann</dc:creator><pubDate>Thu, 03 Feb 2022 14:40:43 -0000</pubDate></item><item><title>Re: Rails is not written in Ruby</title><link>https://solnic.codes/2022/02/02/rails-and-its-ruby-dialect/#comment-5720214139</link><description>&lt;p&gt;I wonder how rails would look if it used refinements.&lt;/p&gt;&lt;p&gt;I also would love to see something on ruby like module exports from python/javascript&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Cassio</dc:creator><pubDate>Thu, 03 Feb 2022 12:55:59 -0000</pubDate></item></channel></rss>