Language and Cognition
Philosophers and linguists have long asked the question, Does the language we speak shape the way we think?
We n...
For further actions, you may consider blocking this person and/or reporting abuse
I think this is also happening in reverse a lot these days. I definitely think I spot Rubyisms in new ideas these days. Hard to trace idea origins though.
I, too, am still very much enjoying developing in Ruby.
I agree that programming languages borrow good ideas from each other all the time, but Ruby's focus on developer happiness seems to make this a first class goal of the language.
Totally agreed. I can't think of a single other language that has developer happiness as one of its stated goals. Although I don't have many opportunities to use Ruby these days, I still think that I was at my most productive when I did. Ruby (and Rails) taught me, among other things, that
π, I used to have questions like which language is better ? After discussing with my friends and listening to people online, I realized that Its better to stop asking these questions. Instead start asking which tool is better for current Job and Trend.
Choose the right tool for the Job.
C#
orJava
for building enterprise and large applications.JSF
you can think of usingAnuglar or
Reactor
Vueetc. for Front End
.Python
for Machine Learning.Go
for Micro Services based performant applications.In future maybe today's Languages and Framework may be outdated, so to survive you will be forced to learn new language of that time.
Conclusion:
Developer Happiness, stick to the language which make your life easier, like easy to read syntax, maintainable, has Good IDE. I like C# for current work, and its up-to you to decide what you like.
Its always good to be Open to learn any language as required and Choose the right tool for the Job.
Hope this helps.
Yup. Like Rust! Obviously Crystal, which is a statically typed Ruby mock-up I believe.
I think this is a key takeaway. I always hear people talking about how they are trying to create Rails for their given language, like JavaScript, but no one has quite hit the mark. It's called Ruby on Rails for a reason!
Like Ben, I am also still really enjoying developing in Ruby.
Laravel comes pretty close doesn't it? Although it seems that Laravel adopted a bit more of the "architecture" and "patterns" mindset of Java, and it's a bit more verbose (I admit you could say more clunky) than Ruby/Rails. But, when working with Laravel the feeling I get is pretty close to the feel of working with Rails.
Is
Ruby
more readable and maintainable thanC#
andJava
, What are its advantages compared toC#
andJava
?Ignoring frameworks and libraries I would say this:
One thing I'd like to add for those who are put off by dynamically typed languages (scripting languages, usually). There's a project called crystal, which is a statically typed Ruby-based compilable language. So if you wanna learn Ruby but use it in a compiled language, consider crystal. It's still in pretty heavy development, it seems, but I've done some small projects with it. It's a little different, but I like it because of its Ruby syntax. I love Ruby.
Actually Ruby does not have functions at all. There are all methods.
They are all objects! :D
Procs are functions.
From the Ruby doc: "Proc objects are blocks of code that have been bound to a set of local variables. Once bound, the code may be called in different contexts and still access those variables."
I can also recommend a book patshaughnessy.net/ruby-under-a-mi... that goes greatly to the implementation as well.
Thanks, What about performance ? does the performance is well when compared to
C#, Java, Python and Go
? I also like to know which server side language is better for making web apps.I don't know what the comparison is in 2020, but for most business logic and webapp use cases Ruby and Rails is more than fast enough. Usually the biggest speed problem in web apps results from excessive database calls and that is going to be a problem in every language.
I found a nice benchmark a while ago, comparing:
Ruby 2.7 vs. Python 3.8 => in most benchmarks, Ruby is faster
Ruby 2.7 vs. PHP 7.4 => in most benchmarks, PHP is faster
source: benchmarksgame-team.pages.debian.n...
I guess almost all compiled languages will have an edge over scripting languages.
blog.iron.io/how-we-went-from-30-s...
I don't think performance is as good as other languages, I consider ruby and python to be slow, developers write code faster though
@lud , what do you mean by "in most benchmarks, Ruby is faster"?? From the same link, I counted 3 (ruby) against 7 (python). Python kinds of win that competition.
And "in most benchmarks, PHP is faster"?? I counted 0 (ruby) against 10 (php). That looks like in all benchmarks
Hi! I am not @lud but @lud :) (this is strange though)
edit: Oh. Looks like it is not possible to tag someone with a capital letter in its name. There is definitely a bug or a dev.to design problem here.
@mcfriend99 "some" in terms of formal logic can include "all". During statistics and formal logic lectures I got that drill, to never say "100%" or "all", but always "most"/"some"/"more than 99%" etc (I am a mathematician, plus English is not my first language, I learned all that logic stuff in German). For a discrete number of objects, that terminology might not necessary, but I just got used to it.
Also, if you scroll to the bottom of the page, you'll notice that this website uses the most recent version of each language, so possibly Ruby was faster in "at least 1" of the specs at the time that I've checked it (it now uses PHP 8, which was not yet released when I wrote my comment).
But honestly, I don't care about if one language wins in 3 out of 5 or 2 out of 7 of whatever. They are all just some isolated benchmarks, which might not reflect reality perfectly. You can write horribly slow code in any language :D
@lud :D @swiknaba should tag me, which is my username. Set up an issue ;) github.com/forem/forem
But I am pretty envious, that you got a/"my" three letter username :P
So it seems that even your username is shown in lowercase in my comment, it tagged you (and not me) successfuly.
About ruby benchmark, ruby 3 shows to be 3 times faster compared to 2.7.*. My scripts for Linux administration in ruby 3 are way better. Ruby solved performance issues very well, and I am pretty sure it will keep going better. I know few languages, but I am only happy when writing ruby code :)
There are people that will argue both sides of whether or not Ruby is more readable or maintainable than other languages. I think Ruby and Rails are both best suited for disciplined, sometimes smaller, teams. I think this actually enhances the "designed for happiness" aspect of the language. Here are some of the reasons I find Ruby so enjoyable.
I agree. Most people I've talked to who don't like Ruby stated they didn't like it because it wasn't easy to read. In my opinion, that's likely because Ruby is not in the C-family of languages and most people are not prepared for that. It took me a little while to break out of that C-lang syntax mode and I'm so glad I stuck with it.
Ruby is consistently OOP from the kernel up. Its ability to do some awesome stuff succinctly and reliably is fun. I just really love Ruby, but it doesn't fit everyone's mold. I suggest that if people find it strange at first but invest the little time it takes to get used to it, they will fall in love with it.
Compared to the mantra of python. "There should be one-- and preferably only one --obvious way to do it". I wonder if that has constrained python developers :)
Matz (the creator of ruby) used to talk about the "Principle of least surprise" being this idea that if the way some language feature works doesn't surprise you, then you're happier for it.
Because of this idea Ruby has many MANY different obvious ways to do anything. This makes many different kinds of devs happy, because they can always write in the way that makes the most sense to them.
This is an amazing boon as a solo dev or a small team, but in larger settings this can be kind of a pain since a code base could become inconsistent pretty quickly unless the org enforces a kind of style.
Python takes the opposite approach.
That's probably why in the early 2010s there was a lot of (mostly comedic) volatility between the ruby and python communities
I agree. There are some Python things that just drive me insane due to the inconsistencies of implementation namely between procedural and object oriented development. Python is an OK language, but given the choice, personally, I'll take Ruby over Python any day.
"Principle of least surprise" maps pretty well onto there should ideally only be one way to do something. If there isn't several ways of doing something it's not surprising :).
I was reading some ruby a while ago, and stumbled upon.
array << element
. It took some serious googling to figure that one out, and I'm sure there are several ways you can write that too.I think the approach that ruby took is one of individuality. Imaging that the "one preferred way" of adding elements to arrays was
array << element
.You'd be surprised that something like
array.push
wasn't working, and even more surprised thatarray << element
even existed.Even though, in our hypothetical language, that's the only preferred way to push to arrays, it's still surprising.
If any of that made sense
It's fascinating to see how something like "principle of least surprise" can be interpreted and addressed so differently. The Ruby and Python solutions for this could not be more different.
Itβs especially interesting because both languages (python 2.7 at least) are pretty similar from a high level technical point of view.
Both OOP style languages
Both interpreted (usually)
Both very high level
Both dynamic
Both are even heavily used in web development
Except for the Python dependency management ;)
This is an interesting question. The two distinct philosophies is certainly the primary difference between these amazing languages IMO.
I still find it easiest to think in Ruby. Maybe that's because I have been writing it for so long, maybe it's because the standard lib handles many details I don't need to think about, and maybe it's just because it truly does live up to Matz's mantra of developer happiness.
All I know is that I still love writing Ruby too.
If you love Ruby in 2020, go join Crystal lang community, Ruby and Crystal should tinker with more cross-project collaborations.
The way people talk about Ruby makes me want to learn this language so much
It's a pretty approachable, tons of resources I'd highly recommend you give it a go.
Benefits of Ruby's development happiness can be translated into it one key business metric: Development lead time. That is a important metric for businesses to stay a step ahead of the competitors especially for startups. I think that is why a lot of the new companies are still on RoR, even though people keep shxtting on it :)
I agree on some stuff, disagree on others.
Most points you make about ruby resonate with me, I love the expressivity, the malleability - gives me options.
In theory it does allow me to explore a lot an solve problems in many different ways.
But does "ruby culture" really exist? Or all we have is "rails culture"?
Rails probably represents 95%+ of all ruby projects out there, with them often you get that aggressive rails culture of "the right way to do things is X" and suddenly fantastic language features are thrown out the window...
I'd like to be as optimistic as you are, I really do, but I'm almost out of faith here..
Agree that Rails monoculture isn't always great and can be dogmatic at times; however, the non-Rails (or Rails adjacent) ecosystem seems pretty vibrant to me right now. Hanami, Roda, Phlex, etc... lots of activity and cool stuff going on out there.
Although I never coded in Ruby (Python dev) it would still be my second choice - I love Django and in many ways, Django is great because of RoR
Iβve heard Taylor Otwell say he pulled a lot of inspiration from for Laravel from Rails as well.
I still love Ruby and use it every day.
I never thought Python would bound back as it did.
I have used Ruby instead of Perl and Awk for 18 years already. π
I love Ruby...but I love Perl too!
I enjoy developing in rails and I wish I had the time to learn more.
After 3-4 years of coding in Ruby, I'm still learning new things.
I'm still learning new things after 10+ years with Ruby and Rails. The breadth of features has much to do with this I think. It may not be at the top of the hype cycle, but there are new and interesting things constantly happening in and around both Ruby and Rails.