Question from someone who invested much time in Python. What benefits Ruby has to convince to move? Instead continue with Python?
When it comes to scripting languages, the objective differences are very nuanced. Largely, it depends on what you want to do. Python, for example, is extremely popular in the data sciences. A complementary example for Ruby would be rapid application development with Ruby on Rails, a web framework that allows you to build web applications very quickly. Another example would be building an API using Ruby's Sinatra library. Python also has web frameworks, so it's not as if Ruby has an exclusive claim to this benefit, but many developers find tools like Ruby on Rails and Sinatra very satisfying and beneficial to work with.
My recommendation would be to give Ruby an honest shot. Don't make the mistake of simply trying to write Python code using Ruby. Really dig in to what makes Ruby, Ruby. If you enjoy it, then you've added another language to your tool belt. If you don't, you might walk away with some ideas about development that you can apply to Python.
Ruby delivers on the promise of being "optimized for programmer happiness." But I think that in order to experience that you have to become fairly immersed. In fact, some of the best parts seem outright offensive at first (question marks in method names?!). No language is perfect. But once you get past the idiosyncrasies, I honestly do think Ruby feels better. That's pretty esoteric, so I'll try to call out some specifics as well.
I agree with most of what's already been said, but I'll try to add a few things. In order of most to least significance (for me):
The standard library, especially with regard to collection methods. Want to slice/filter/sort/chunk an array/hash in some weird way? Ruby's standard library almost certainly supports it. So many amazing things are built-in across the board.
Not relying on indentation for scoping. It's one of my biggest beefs with Python. Yes, of course, code should be indented properly. But goodness....let my linter enforce that, not the interpreter. I don't love ruby's do/end keywords (I prefer curly-braces), but at least having a visual cue for end-block is a vast improvement over python.
A more consistent interface. Everything is an object, and you invoke methods on those objects. I think [].size just makes more intuitive sense than len([]).
Great readability boosts from things like question-marks or exclamation-points in method names (admittedly that felt gross and wrong at first), trailing if-statements, unless-conditionals, invoking methods without parens (though I only sanction this if not passing args).
A more helpful, less snobby community. 100% just my personal experience, maybe I've just had bad luck with pythonistas.
No __init__.py nonsense. Maybe that's fixed/improved in python3? But I hate it. In fact, I hate any use of dunders...littering the code with unreadable symbols.
More than a versus (it's more striking) I would really like to know what things they have in common and how they differ, what their main advantages are compared to the other and of course their opinion of them. One point to take into account is because they believe that python is more used in AI and Machine learning developments.
Videos
I started learning Python as a hobby some years ago. I really liked to learn it and I also made an app for me using PySimpleGUI to make exams reports (laryngoscopy). Then I saw Ruby and started to learn it and I like it a lot too. I made another app for exams reports using Ruby on rails. Now I want to go further, study harder to work as a programmer, but I really don't know if I go with Python or Ruby. Maybe Python should be easier to find freelances or jobs in the future? Thanks for your help
So , I been thinking deep lately, with a sprinkle of curiousness. With all the hype behind python nowadays, I've noticed most people learn python and ruby is out of question for most juniors. Correct me if I'm wrong, but, if that's the case, Learning solely only python, wouldn't that create more competition for yourself in the job market if you're a junior competing with 90 % of other juniors who also only learned python for back end?? Would learning ruby and going that route / niche be a better option due to less people learning ruby, and an ongoing need to fill ruby positions? What do you guys think. I mean, as a developer, We are worth what the market is willing to pay at the end of the day. Less of a surplus in talented developers in a certain language drives a higher salary point due to lack of talent no? I've done research, and I don't see ruby going anywhere. Sure, anyone can learn both, but I noticed that's not the case. I rarely ever hear someone talking about learning ruby, it's always learn python. But is ruby a good choice for a junior developer trying to land their first job? By junior, I clarify as in, knowing and understanding intermediate to advanced programming concepts. Wouldnt it help you stand out a little bit better considering like I said most bootcamps and juniors learn Python?
Im attaining a software programming degree soon and am looking for a path to full stack, and just looking for some insight Any feedback / perspectives would be appreciated. Thank you guys so much for taking the time to read this post, and happy coding c: .
I am completely sure I want to dive into the world of Programming (web dev) and ultimately get a job(in programming) to continue learning to program.
I have to choose a path: to get a Programming job and ultimately support myself.
Why should and shouldn't I choose the Elixir programming path to reach my goal?
I have dabbled into Elixir Programming a bit and I have already started to like it.
I have to choose a language and it's confusing. I like Elixir but I don't know where it will lead me, the other is JS, and Python which seem to have a lot of opportunities but I never got along well with both.
And then there is Ruby, which in terms of Job Opportunities seems similar to Elixir.
My Background: I am from a Commerce Background. Know basic Python, MYSQL, and created a few blog sites using WordPress and managed their backend by myself (cloud hosting), which gave me an understanding of configuring the NGINX webserve.
Python is one of the most used programming language but some languages like Ruby were not so different from it and are very less used.
What is the main factor which make a programming language popular ? Where are People using Ruby 10 years ago ? What are they using now and why ?
According to you what parameters play a role in a programming language lifetime ?
Strictly between these two. Excluding their uses (Ruby mostly used for web dev, Python mostly used for AI/ML) which is more beginner friendly for new programmers, considering their syntax and features?
Hi folks, as a web engineer I've been coding for quite a lot in Ruby and Python and have an obvious question since that both languages are often compared to each other: why is Ruby not as popular as Python outside of the web? In my opinion obvious Ruby's advantages are as follows: object model is sane, neat and intuitive compared to Python's magic methods based duck typing, descriptors, metaclasses and imperative std; blocks are an absolute killer-feature; no Unicode hell; metaprogramming is easy to use; pip literally can't be compared to gems + bundler which can be found in almost all projects. The only advantages I can see in Python is list/dictionary comprehensions, and some low-level features buffer protocol.
Hey so as the title say, I'm really interested in becoming a DigitalNomad and learning how to programme, obviously this is not a viable career untill I'm confident with the language I learn. Just wondering what you guys think would be the best language for a person like me with no experience, I hear both are the easiest languages to learn (not to say they are not hard) If you could tell me some pros and cons of each language and what sort of work i would be looking at with each language (freelance & office) thanks, and sorry if this is not the place to ask!
I think Ruby is better for learning.
Everything is an object™
clearly demarcating the end of a logical block with end, rather than whitespace is much easier to follow for beginners.
Documentation for Ruby is much more readable
Depends what you want to do, most Ruby people do web dev (e.g. apps's backend and websites), and python devs do a lot of data crunching and some web dev.
Personally I use Python sometimes for small things I can't do with ruby (mitmproxy, machine learning, etc.) but I try to send the data back to some ruby code as fast as possible :D.
I can’t stop laughing 😂😂😂
https://www.guru99.com/python-vs-ruby-difference.html
Hello,
I'm thinkink about learning new scripting language, Ruby or Python. I'm going to use it for creating non-web applications, for Windows and Linux. So my first idea was to look for already made applications.
There are lot of applications and tools for real-world usage written in Python. For example:
-
youtube-dl (famous console tool for downloading/converting videos)
-
OpenShot (GUI video editor)
-
Wifite (favourite tool for hacking wifi routers)
-
PiTiVi (another video editor)
-
Ubuntu Software Center (GUI package manager)
-
BitTorrent (original torrent client)
-
Blender (3D modeling tool and video editor)
-
...and much more
But in Ruby, there is literally nothing famous except Ruby on Rails (which is not even application, but framework).
After checking the languages syntax I like Ruby much more. But it looks like every time real programmers have to choose scripting language for non-web application, they always choose Python over Ruby.
Why is that?
I have decent experience with both and still strongly prefer Python syntax. The reason Python is more popular is probably a combination of the popularity snowball effect and the simplicity of the underlying implementation, which together lead to a huge selection of high quality libraries.
from Internet import Everything
That's why.
I have never worked with Ruby, but I work with all of the "other" scripting languages in data science.
Why use Ruby? Why does it exist?
Ruby vs R - I don't see the comparison. Ruby is a general purpose programming language, R is specifically designed for statistical computing. Different tools for different jobs, you won't be building a web-app in R any time soon.
Ruby vs Perl - At the time Ruby was being developed, perl wasn't much of a general purpose language, it was mostly a tool for scripting and string processing and had a limited and rather bolted on object model. With modern perl you could make a more direct comparison but the mindshare has largely departed from perl and Ruby borrowed it's best features while adding a much stronger object model.
Ruby vs Python - These are pretty much directly comparable languages and it's more a matter of taste than anything. Python still has a bit of a bolted on object model which makes it a little weird to work with for those that prefer the smalltalk style object model of Ruby. Python has a strong following in the data science world due to the quality of supporting libraries: numpy, scipy, pandas, etc. Both rubyists and pythonistas have relatively strong opinions on language design that run into conflict at various points. As one example Ruby strongly favors chaining for functional programming constructs, map, filter, reduce, etc. Python heavily favors list comprehensions to fill the same use case.
Why would you use python instead of Perl? Or Perl instead of R?
Mostly preference, and sometimes availability of a certain library (for ruby, classically Rails).
Why does it exist?
https://en.m.wikipedia.org/wiki/Ruby_(programming_language)#History
I was talking with my colleague about the possibility of an object-oriented scripting language. I knew Perl (Perl4, not Perl5), but I didn't like it really, because it had the smell of a toy language (it still has). The object-oriented language seemed very promising. I knew Python then. But I didn't like it, because I didn't think it was a true object-oriented language — OO features appeared to be add-on to the language. As a language maniac and OO fan for 15 years, I really wanted a genuine object-oriented, easy-to-use scripting language. I looked for but couldn't find one. So I decided to make it.
Hi, Im basically looking around for a language that would replace Python for me. I need something that is easy and fast to write in, interpreted, and dynamic. Sure, Python is that, but also Python is a very fast-changing language which causes packages to be frequently out of date for specific versions or operating systems, there is a ton of features that get kinda forgotten because new ones were added.
Therefore my problem is that: I want to write high-level scripts/packages mostly for automation that I know will run today and in 5-10 years. Do I think I could achieve that in Python? I don't think so.
That's why Im looking at Ruby. I know that Lua is also a good candidate, mainly due to the fact that the whole language is basically in maintenance mode now, and no new features will be added. But its environment is not as mature as Rubys. So my question is how does Ruby compare to all of that?
Hello,
So I’m really intrigued by watching one of the ruby on rails screencast and that has sparked my interest in learning Ruby.
I do have experience working in following languages:
Python (my strongest skill)
Java
JavaScript
I mostly code in python and I’m looking for resources to learn ruby.
So I just graduated with my associates in web and software development, and while I'm job searching I'm gonna try to add another language to my toolkit. I really want to do back-end development primarily.
So I was wondering which is better to learn for back-end web programming. I've been told Ruby is more for web applications and Python is more for scientific programming?
Any advice would be great!
I would say look for what jobs you want to apply for and see what they use in their back-end. Python and Ruby are both good for web development, but PHP and javascript have more real estate in web development.
I’ve never used Ruby, but I’ve heard great things about Ruby on Rails for backend work, so it seems like a perfectly good language, but not the most common one.
Python on the other hand is used in a vary broad variety of settings—backend APIs, artificial intelligence, data science, image processing, random utility scripts, desktop apps (pyQT), etc. You will likely encounter python many times in your career going forward, so it’s definitely worth knowing. I vote python.
Hi I want to learn an all-purpose scripting language which I can use in:
-
Unix text processing (instead of awk, sed, Perl)
-
Web development
-
Programs for Unix open source projects
-
Mobile Dev (not as much important as the first three items).
So, Ruby or Python?
Unix text processing (instead of awk, sed, Perl)
You've named the kings of that domain, ruby and python both have text processing/regexp facilities but they are nowhere near as fast. I like ruby's regexp implementation a little better than python's. (go figure, says the guy on the ruby subreddit)
Web development
Ruby has some pretty bitchin web frameworks, though django and flask do a lot of the same things. The only thing that might edge ruby out as a clear winner here is that rails has so much community support, so if you don't want to re-invent the wheel, you can use a gem, whereas python might not have the same level of community support for django. It's probably pretty close.
Programs for Unix open source projects
Python is probably viewed as more of a "systems language" now than ruby. Both are equally capable of being scripting languages used for everyday tasks, just depends on what you're wanting to do.
Mobile Dev (not as much important as the first three items).
Ruboto/Rubymotion/Mobiruby are all things. I think ruby might actually take this the most handily.
tl;dr Learn multiple languages, use the tools that make sense for the project. Don't be bound to a single language.
I did 8 years of scientific programming in ruby, and 3 years of professional web dev in python (yes, it's ironic). Both are great languages, and I'm more than happy to code in either language at this point. I personally think ruby is easier to use for most of the things you mentioned, and I think ruby is a more elegant language than python (I think ruby is a better language, but I do think aspects of python are better).
You really can't go wrong with either. And, as was already pointed out, use python 3.6 if you choose python (the 2 train has left the station, thank heavens).
I am new to programming and would like to learn a language good for web and app development. I have read python is a great all round language to learn to get started and Ruby is a little more challenging but more powerful in the areas I want to learn.
Which do you reccomend I put my focus in?
To me, they're about the same. Yes, they have different philosophies (there's one way to do it vs. there's many ways to do it). Python is currently quite a bit more popular than Ruby, for several reasons
-
Guido, who invented Python, works at Google so Google uses Python (among other languages) a fair bit.
-
Python is associated with data science and numerical libraries (NumPy, Pandas, etc)
-
Python is taught at some US universities instead of, say, Java
Python has two web frameworks that people tend to use (Django and Flask) although there are other Python web frameworks. Ruby is most closely tied to Ruby on Rails (but again, other web frameworks exist, e.g., Merb, Sinatra, etc).
In the end, it probably doesn't matter which one you learn. I've played a little with both, and find they do roughly the same thing (maybe it's because I haven't delved into either deeply). Python's popularity might make it a better choice.
I'd say to go with Python just because of the relative popularity of the two languages. They are both highly-abstracted languages with minimal (if any) boilerplate. But Python has been around for a long time, and Ruby has been steadily losing popularity over the last 5+ years, maybe more. Rebounding from the "rockstar developer" years, I guess.