5 ms·
I've never learned ruby in an intentional manner, but whenever I needed to write some, I found that things just worked the way I expected it to, and the docs we
by djohnston 8y ago
I've never learned ruby in an intentional manner, but whenever I needed to write some, I found that things just worked the way I expected it to, and the docs were always super helpful. To be fair, I haven't built anything large scale with it, but my experience with the language has been anecdotally pleasant.
- colechristensen 8y agoI am having the opposite feeling about Python. Seems everyone is using python these days and I am constantly running into things which I like just a bit less as I am trying it for side projects. Things just don't quite work the way I expect them to.
- enraged_camel 8y agoSame. I’ll get downvoted for saying this but I find that it is a very overrated language that is popular mostly because of its dominance in fields that are currently in the vogue, i.e. ML/AI. (I know Django is a thing, but that has always been in the shadow of Rails, and rightly so.)
- nkozyra 8y agoNo downvotes, but I think it's popular because it's an extremely well-designed language. It has a ton of warts - not even to mention the 2.x -> 3.x kerfuffle - but in general it is a thoughtfully designed language.
- wenc 8y agoIn 2005 I had to choose to invest in learning either Ruby or Python as a primary language for writing a fairly complex piece of technical software. I looked into Ruby and it struck me as being a truly aesthetically pleasing language, and since it espoused the "principle of least surprise" -- with caveats, naturally -- most Ruby code tended to be straightforward to read. Python on the other hand, while clean -- I came from Perl -- had a fair bit of ugliness like the "self" argument in class methods, and the "dunders" in dunder methods (__init__). That said, the Python ecosystem, especially in the numerical computation space, was far ahead of Ruby's at the time, so I chose Python. It worked out really well and allowed me to accomplish what I needed to. To this day I have no regrets choosing Python. Compared to many languages (like Haskell etc.) Python's design isn't the most aesthetically pleasing or orthogonal or clean. But being a Dutch design, at least initially, it was very pragmatic. And Python is by no means ugly on an absolute scale, on the contrary. It’s just not as beautiful as some others. Python's main advantage is the energy behind it: to this day there are no converged alternatives to Numpy or Pandas on Ruby. I can't help but wonder that if in an alternate universe/timeline, Travis Oliphant, Pearu Peterson, Wes McKinney and others happened to have encountered Ruby first, we might have a different de facto language for scientific computing and data science.
- h8hawk 8y agoI don't understand why people bashing self argument. It's part of best design decisions in python. Methods in languages such Java or JavaScript always have hidden argument called 'this'. In js this actually become messy duo to binding of this. In python you can easily find this method is bind to instance of class aka 'self'. It's not always self, It could be cls for classmethods or nothing for static methods.
- wenc 8y agoMost languages have an implicit “this”/“self” which works well. This makes it easy to convert functions to class methods and vice versa without using any editor refactoring features. It also makes it easier to refactor (no need to search and replace every reference to foo within an object to self.foo —- the only time this might be iffy is if there’s a global function foo, but in practice it’s not onerous to handle) Also beginners don’t have to mentally blot out in their heads the self argument when calling a method (“you mean self isn’t the first argument?”). Debug messages are also more consistent (“the debug message says my method needs 1 argument. Isn’t self right there?”) I accept Python’s explicit self for what it is (Python’s philosophy prefers explicit over implicit), and don’t have trouble with it but aesthetically it deviates from most OOP languages out there. It’s a valid choice for practical reasons but I would also say that an implicit “this” is an equally valid choice for aesthetic reasons. Here’s a survey of this/self choices: https://en.m.wikipedia.org/wiki/This_(computer_programming) https://en.m.wikipedia.org/wiki/This_(computer_programming)
- type0 8y agoPython is like a dutch windmill and Ruby is like a japanese origami. Python is robust and Ruby is elegant.
- AlexB138 8y agoA lot of Python's popularity, in my experience, is from the simple fact that it came loaded on many mainstream Linux distros by default. Many people picked it up simply because it was there, and it became the de-facto systems tooling language for a while.
- pr3dr49 8y agoI don't see why anyone should be downvoted for expressing his or her own consclusions that draw on personal and practical experience of using both languages. The comment is not inflamatory and it merely reflects your own experience. Perfecly valid.
- NowThenGoodBad 8y agoI can’t speak about here, but on Reddit, people use the voting for “like/agree” or “dislike/disagree”. At some point I read somewhere that the whole point of upvote and downvote on Reddit was for “contributed to conversation” (upvote) or doesn’t (downvote). That, to me, makes sense. Disagreeing is part of what promotes good, challenging discussions. It also buffers us from external influences controlling the crowd of “agree’ers”. By promoting and encouraging differences of opinion or view, we make it harder for someone to come in and sway the crowd.
- pr3dr49 8y agoI think I'm starting to get the gist of it now. Thanks. I should have upwoted than, because I felt the sentiment to be valid in the context of the post and the conversation thread.
- em-bee 8y agounfortunately some people feel that saying something they don't agree with isn't contributing to the discussion and are downvoting anyways. i upvote comments that i see unfairly downvoted. btw, our little subthread here is off topic and may be downvoted for that. (rightfully as we aren't contributing to the actual topic)
- maksimum 8y ago> I am constantly running into things which I like just a bit less as I am trying it for side projects. Things just don't quite work the way I expect them to. How much of your like/dislike do you think comes down to familiarity with the language? When I was first learning python, I definitely didn't like it as much because I was unfamiliar with some fairly basic syntax. Exactly the feeling that you're describing (I was coming from matlab). I've been using python for two years now and expressing most 'programs' feels like second nature. I.e. if I am to describe an algorithm on a whiteboard I may as well do it in python because then I don't have to worry about coming up with pseudo-code conventions on the fly, and there is little syntax getting in the way of me expressing semantics. Based no the link, it seems like ruby is largely similar to python, but it has slightly different choices. I'm curious what someone who's experienced with both would have to say about the stylistic features of the languages (ignoring libraries).
- onli 8y agoI have some experience with Python and a lot with Ruby. My experience is similar to djohnstons: For the longest time I just wrote Ruby like I thought it should work, and it worked, and if not you'd look up that specific thing in the docs. I struggled at first with attr_accessor and instance variables and the difference between String and Symbol, and I needed to see blocks in other code multiple times to understand them, and implicit block passing I got just recently after many years. But overall, Ruby just worked: If you mix "how would I write that in basic english" and "make a mix of all the C-like languages I know" and for the functional aspects "take what I remember from the onetime I learned a lisp", then you write Ruby, and it feels very natural. Python does not feel natural at all. And I don't mean the indentation, that's in your face enough that it can be handled fast. But Python is just everywhere almost like you'd expect, only to still be different whenever it can. Dicts for example, why is that in there instead of a Hash or what I'd call a assiociative array? Using list instead of Arrays, as if it were a lisp, only that the list behaves like an array with different syntax, and Python is not lisp like at all. Null is of course not null (I already disliked ruby's nil), it's None. Compare how easy ruby makes range, and how inelegant Python makes that. In the end none of that matters that much and discussing it too much probably only leads to a flame war. What mattered to me: My python program (an audio player for the tray) was completely unstable, it ran into multi-thread issues without me ever understanding why and how to solve them. My first ruby program was enough to pass my employer, my second one is still online (and one of my active projects linked in my profile). If I want got get something done and have it work well, I use Ruby. Though fact of the matter for ML or even just statistics the ecosystem is way less nice and I will be forced to use Python next time, my try to use Ruby during my last encounter with ML just failed.
- nurettin 8y agoI wrote both and I think you are right in terms of unexpected things happening in python. I never had a problem with ruby map/reduce, but any expression more complex than a simple loop becomes hard to write with list comprehensions. On the plus side, python has type annotations and static type checking with the help of mypy. It has async/await which was a good strategic move to give javascript users a sense of familiarity. Ruby is somewhat lacking in this aspect.
- mixmastamyk 8y ago> any expression more complex than a simple loop becomes hard to write with list comprehensions By design, at that point write a function or proper loop. This provides an opportunity for documentation.