4 ms·
As I recall there is a loose connection between them due to history. When Perl added an object system in version 5 it was heavily influence from Python and Rub
by pravus 5y ago
As I recall there is a loose connection between them due to history. When Perl added an object system in version 5 it was heavily influence from Python and Ruby's designer was inspired by Perl. You can see a lot of similarities between the three beyond their dynamic nature.
- jrochkind1 5y agoRuby's influences are sometimes described as being both Perl and smalltalk, but I'd say Ruby's OO comes more from Smalltalk than Perl OO. Things that came more from Perl to ruby include: Ruby's syntax; first-class regex support; some rarely used features like the Perl-ish global variables and command-line options; just the idea of being an interpreted unix-friendly language executed like `ruby file.rb`. I do think Python and ruby are very similar languages, in the whole universe of languages. I think that's not really because either influenced each other, but instead because both were invented at approximately the same time, to meet similar needs -- both as interpreted-not-compiled, edit-with-a-text-editor, with C-like syntax, etc. Them both being so similar, I wonder what's behind things like "ruby just didn't click for me but then I loved Python" -- but then, I'm the same just opposite. I don't know if I'd say it didn't "click", but I much prefer ruby to python, hugely (and sadly at this point, I feel like a betamax enthusiast), despite knowing that they are basically similar languages.
- 41209 5y agoRuby has some what hostile rules imo. Such as end and lower casing variables. Another factor to mention, Python has some specific use cases, like machine learning which I can only effectively learn by using Python. I actually managed to secure a 30k pay raise by learning Python in my spare time. Anything I can do in Ruby, I can already do in NodeJS. If I ever run across an employer who would offer 30k or 40k more for me to learn Ruby, I would definitely jump at the opportunity.
- jrochkind1 5y agoOf course I understand why people use python if that's where the jobs or better pay are, I have no confusion there! Or for that matter, if that's where the libraries for doing certain kinds of work, like machine learning as you mention, are. None of that is a mystery, as reasons to use python.