That said, different usecases require different languages. I would never use Ruby for a compiler project.
That said, different usecases require different languages. I would never use Ruby for a compiler project.
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.But this is true of any language. The truth is in the middle ground.
In Java, for example, one can do static analysis and identify when a class is doing reflection... and flag as an error if the class is doing reflection on a class that is an instance of java.something.
Class cache = Integer.class.getDeclaredClasses()[0];
Field c = cache.getDeclaredField("cache");
c.setAccessible(true);
I can examine to see that java.lang.{something} class is getting reflected on. I can check to see if anything is calling getDeclaredField and flag that. I can see the setAccessible and really flag that.This isn't about coding errors. This is about being able to analyze the code and see if the code is using prohibited methods.
Through static analysis, I can verify if anyone is trying to do something tricky with the String class.
Can I verify if a method is being modified added to an instance of a String in Ruby through static analysis?
Trying to make such experiments safe in Ruby would be unwise, but starting them in Ruby is happiness.
The drawback in this case is it's not as concise as just typing in a String literal :)
And I'm not a Rails person, so it wasn't flattery.
I have friends everywhere from FAANGMULA to Deloitte to 100 person tech startups (and I am at one myself)to banks. We have a group chat of classmates.
No attempts to stem the wave of resignations anywhere as far as we can tell.
As things have played out, PHP has done pretty well at modernizing (I know some would debate that, but that's a different thread), and Rails has faded a bit into the background -- although now I joke that because Rails is well out of its fad phase, it can get down to the real work.
I do wonder whether Rails has been kind of a mixed blessing for Ruby all in all, though. I think Ruby is, in itself, a great alternative to Python or Perl, and it's the language I reach for first when I'm writing short utility scripts -- but since Rails exploded in popularity before Ruby itself did, a lot of Ruby programmers really only know Ruby to the degree they know Rails.
This so bad that frequently I see “Ruby on Rails” in lists of programming languages aside “PHP”, or “Elixir”, or “JavaScript”.
(When I was most in to Ruby – but not so much Rails, even then – there was actually a palpable divide in the community between the Rails-only community and the broader Ruby community, some of which was Rails-inclusive.)
Maybe in USA. In Europe, Rails has been far less popular. Now I imagine expensive candidates means the ability to work on decade old Rails codebases from previous versions, which means with a lot of Rails experience.
Half the companies using it are 1-2 years old according to him. Lots of 10 person startup teams just fresh off a raise.
Given Google's track record I'm not sure that's the most reassuring argument...
The Ruby and Rails ecosystem has Stripe, Shopify, GitHub actively pushing new things all the time, DHH and co working on version 7 right now, etc...
Python is also great but I still wish Ruby is installed everywhere for writing one-liner since Python isn't good for that.
Ruby is ridiculously useful. Python edges it out for scientific/engineering applications because of Scipy and now Machine Learning ecosystem.
Even still, this doesn't mean anyone should drop what they're doing and migrate all their code to Rust! If you're a Ruby dev (especially if you do Rails) and you're making a living churning out apps with your good old friends like Devise, RSpec, etc. Rust is probably not the thing that'll really wow you. It _can_ do web, and do it REALLY well. But the experience is very different. (Actix/Rocket)
I'm not a C programmer, but I think Rust can fit almost everywhere C can fit.
I think this should be phrased differently. There is a minor bloom of zero-allocation web frameworks in go and java, and probably a few others, which blow their peers out of the water and are horribly not at all idiomatic usages of the languages.
They can be very fast, but the performance cliff for using idiomatic code is very significant.
Does idiomatic rust perform VERY fast? Can it be both very safe AND very performant? I think the answer to both of those is yes, but I honestly haven't used it enough to know.
Honestly I kind of cringe at the "do everything in rust" crowd, if you need to, say, write an API, you can just do that in Python or Ruby or Go, 99% of the times the performance penalty won't matter and Rust is just a very complicated tool for that job.
But it single-handedly reopened the discussion on high performance, safe(r) languages, and I believe that's a very good thing even though I don't use Rust day-to-day. Projects like Zig are in a sense following in the footsteps of Rust.
total = new Decimal(principal);
total.mul(1.0 + interest);
In other words decimals support the same operations as the rest of the language's numeric tower. Go doesn't have this.Go is a networking language. It's good for writing microservices and network protocol clients and servers. That's about it.