Rails Is a JIT Compiler

(railsatscale.com)

11 points | by fbuilesv 2 days ago

2 comments

  • twiss 1 hour ago

        class Order < ActiveRecord::Base
          enum :status, { pending: 0, paid: 1, shipped: 2, refunded: 3 }
    
          def shippable?
            paid? && !refunded?
          end
        end
    
    Bit off-topic but if `:status` is an enum, then `paid? && !refunded?` is equivalent to `paid?`
    • rapind 1 hour ago
      It should be yes. Well it's ruby, so you could probably overwrite it with your own `def paid?`, but I suspect the `&& !refunded?` is just cruft.
  • WesolyKubeczek 1 hour ago
    Opens the article

    > The title was bait to get you to open this article. But

    Closes the article

    • dmix 1 hour ago
      Your loss, it's a well written article.
      • tessierashpool 1 hour ago
        incorrect on two levels.

        first, if somebody tries to cheat you, and you walk away, that's just not what losing looks like. that's the right move.

        second, no, it's not good. it opens with clickbait, pivots to some other topic, so the first question is "what is it really about?"

        they don't tell you what it's really about. they make you read the whole article to find out.

        even if you're willing to accept people acting in bad faith, you still need to be able to assess if the article's worth reading. the only signal on that topic is the disrespect they showed to your normal process for doing so.

        it would have been easy to fix with "here's what the article is about, and why the hyperbole almost works:" followed by a sentence which did that job.

        they don't do that. instead they introduce a character without explaining who he is, so you have to click a link to find out (but again, no signal as to whether or not you should care). then you get a whole bunch of intricate code specifics, again without any signal about why you should care.

        it's a very consistent theme. you're not going to get a good article out of an experience where you have to click external links and go several paragraphs deep just before learning "it's probably still going to be about enums" and "these people have no respect for either my time or the general principle that writing should be clear."

        • pitched 46 minutes ago
          The title is relevant to the article. The first line walking back the statement was a bit cowardly but understandable given how easily angered it could make readers and that fact makes it funny and the reason I kept reading. The rest of the article backs up the title.

          Also Aaron is on the Rails Core team and probably colleague of the author at Shopify. Sam is also a colleague of the author at Shopify. The target audience of this article is people deep in that same culture and definitely not you.

        • dmix 47 minutes ago
          I don't take headlines that seriously. I only care if they wrote something interesting.

          Drive-by HN commenters always obsess about accuracy of headlines, I prefer reading the actual articles and judging it on that. I read the whole thing and it discussed some difficult open source work they are doing on Ruby in a way that kept my attention, shrug.