Comment

Comment by nixpulvis

I still get a real kick out of Ruby's elegant and powerful metaprogramming, which is something other languages don't often compare to.

    class String

      def colorize(color_code)
        "\e[#{color_code}m#{self}\e[0m"
      end
    end
The general advice is to avoid confusing others though, so changing base classes like this is not really a business-safe idea.
parent nixpulvis 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton