4 ms·
So much of what makes Ruby Ruby is based on dynamic types. Is this going to be optional? I've been moving away from Ruby a bit over the years specifically becau
by learc83 12y ago
So much of what makes Ruby Ruby is based on dynamic types. Is this going to be optional? I've been moving away from Ruby a bit over the years specifically because I want static typing, but I can't imagine that the majority of Ruby devs feel this way.
Also isn't Crystal basically a compiled, statically typed version of Ruby?
- grandalf 12y agoNot really -- with strong typing you can still use duck typing. Swift has a cool approach to this.
- learc83 12y agoUnless I read something wrong, the proposal was to add static typing not strong. Dynamic vs static, and strong vs weak are two different things, although the exact meaning of strong vs weak isn't really settled. Many people already consider ruby to be pretty strongly typed. It's definitely already more strongly typed than javascript.
- ryan-allen 12y agoI've been doing C# after years of Ruby, and every time I find myself needing or wanting to do 'duck typing', what falls out is an interface and then using generics. After years of Ruby, this is so handy because you end up formalising 'on the side' the commonalities of your modelling. I had no idea what generics were for, and I thought interfaces were mostly for over-abstraction but lo, I was wrong. They are very handy. They are typed duck typing! Combine that with type inference, and you've limited all the ugly 'everything is typed' code, and what you get is code that looks a lot like Javascript. And if you don't like, that, there's F#, that as an ex-Ruby guy, looks rather compelling, but with all the benefits of C# as well. I didn't realise until I was out of the echo chamber that Ruby is only a small spot on the radar compared to the rest of the software world.
- learc83 12y agoI completely agree with everything you wrote, that's been my experience as well. I'm also a Ruby guy who's moving a lot of my projects over to .Net. F# is actually what attracted me, but I'm really enjoying C# as well.