5 ms·
> A new developer is inspecting a method they're tasked with refactoring. It accepts an argument named "input". What the hell is an input? This is more of a ge
by joelbluminator 5y ago
> A new developer is inspecting a method they're tasked with refactoring. It accepts an argument named "input". What the hell is an input?
This is more of a general criticism of dynamic typing than anything specific about Ruby, but If it's unclear from the code why is it so hard to put a binding.pry in there and inspect the object if you need to? You'd usually wanna put a breakpoint in there anyway when refactoring to see what the hell is going on. And on a normal codebase there will usually be an accompanying test.
I'm not 100% denying that in Java you'll have a type like FactoryBeanXmlConfig which you can go ahead and read the documentation to (which is often insanely verbose due to everything being a type in Java. So lots of reading).
To each his own I guess; I think we all get used to whatever stack we use and become very productive if we stick to it. I acknowledge I would've been productive in Java eventually to the same degree as I am with Ruby, I just wouldn't have enjoyed it as much.
The Shopify example is a bit extreme: you are talking about one of the biggest monoliths in the world; not strictly for Ruby, in any language. So yes you're gonna have to build some tools to accomodate that and yes, probably Java would have worked out better at that size. But how many companies become Shopify - 0.1%? It's either a "scrappy MVC" or Shopify? I disagree:
Up to that size of millions of LOC and thousands of full time devs there's a whole spectrum of companies size where Ruby/Rails works out well. I can't see why a 50-100 man team can't work with Ruby successfully; if the monolith becomes a pain you break it into a few smaller monoliths/citadel/microservice. This essentially allows you to scale to any size, but I think the monolith will take you far; look at Gitlab. I'd say around 100 devs work on it full time (my guesstimate, could be wrong) and their feature development speed is brilliant imo.
There are so many successful Ruby/Rails companies at those sizes it would feel silly to start naming them.
- cageface 5y agoThis is more of a general criticism of dynamic typing than anything specific about Ruby, but If it's unclear from the code why is it so hard to put a binding.pry in there and inspect the object if you need to? This is a lot slower and more tedious than just inspecting the documentation for a statically typed parameter and the cost of doing it over and over and over again adds up. Also there's no guarantee that whatever type you observe in your particular binding.pry experiment is the only one the function receives. Of course people continue to build large & successful apps in Ruby. I'm just saying at a certain point it gets harder than it would be in other languages.
- joelbluminator 5y ago> Also there's no guarantee that whatever type you observe in your particular binding.pry experiment is the only one the function receives. I honestly don't see many methods where it expects a user but it can also receive a shipment or a billingInfo where tons of callers just pass all sorts of stuff to it as they feel like, and me as a dev have to keep wondering what the param is. That's not common at all because most Ruby devs just don't operate that way (Why would they? That's pretty insane). Yes it's easier to shoot yourself in the foot in Ruby but that doesn't mean we all design crap code. Static type people say your dynamic code is always littered with dozens of if param.type == 'user' else if param.type == 'baboon' etc etc. I rarely stumble into this in real life. I'd like to see some real examples (there's enough python/js/ruby open source code for us to make an intelligent discussion)
- cageface 5y agoI don't have examples at hand but I've worked in large Swift, Typescript and Rails codebases over the last seven years and the Rails codebases were the hardest to maintain and had the most errors in production. Have you done extensive work in a strongly typed language?
- joelbluminator 5y agoYes I did C/C++ and Java in college and kinda hated it. It wasn't web based development work like I do now but I've written a bunch of static code in my life. I also took Spring MVC for a spin more recently and absolutely hated it with a passion. I think that the Ruby/Rails project you describe was probably classified as "legacy" and the company moved on to newer cooler tech like Swift/Kotlin/Node. That's when the Rails project becomes really fun where no one wants to touch it/improve/refactor anything and it quickly becomes a pile of shit after a few years since every change is done by someone hating that project and hating Ruby. Am I close? Otherwise I can't really understand why a skilled group of Ruby devs couldn't have refactored the thing.
- cageface 5y ago