Live data from Hacker News

Has Python killed Ruby?

news.ycombinator.com

41–50 of 64 posts

Re: Has Python killed Ruby?

#41

If going with the web, I'd go with JavaScript, to a degree you have to learn it anyway. Python and Ruby are both relevant for web as well. Rails vs Flask/Django - both will get the job done, plenty of use cases of major corporations using one or the other. If you're doing DevOps, you should probably learn both. Everything else, which is more backend, APIs, data, data science, AWS, Google Cloud, Big Data databases, et…

To add to that in regards to web development: you're going to need JS anyways much of the time, so learn it. You Don't Know Javascript and Eloquent Javascript are respectively good starting points and good but tough starting points.

But as of yet there's nothing in the JS ecosystem that compares to Ruby on Rails or Django for back-end stuff, so it's worth learning one or both those two as well.

For finding work: learn both, or pick the one that is more popular in your desired field, geographic location, etc.

For improving yourself as a programmer: go for Python first but learn both (good introduction to how programming languages are both different and alike). If you can't be bothered by or interested or learning both, reconsider your field of work, because both are fun.

For anything else: if you're capable of weighing the pros and cons of either in regards to support (hiring coders), project size, level of complexity needed etc.: Python strikes me as the slightly safer / more robust choice, especially in academia, but I'm not confident about recommending either one primarily.

Re: Has Python killed Ruby?

#44
post #35

I use both fairly regularly, and they are very similar. Where they are different in terms of syntax or capability or philosophy, I nearly always prefer ruby. I find bundler/Gemfile/rvm to be less headachy for project dependency management than pip/requirements.txt/venv. For me, ruby code is easier and more pleasant to read. When I need to write a quick bit of temporary code or do some simple data parsing/file managem…

Do you have experience with NPM and Yarn (javascript/node) and if so, how do the package managers and ecosystem compare? I'm asking because I'm primarily a js dev with a bit of Ruby and Ruby on Rails experience, and I'm wondering if Python/Ruby are worth investing in at this point and if perhaps instead it makes more sense to stick with js (Yarn in particular for package management) and explore more fundamental (C/C#…

Yeah, I have worked with js/npm more than ruby or python lately. I've looked into yarn, but haven't used it on a project yet.

I like npm. For package management, I think npm is on par with bundler (ruby) and thus a bit better than pip. I like the ease of use of package.json scripts and find myself using them more and more. They feel lighter and easier to set up than the ruby equivalent (rake tasks, usually), although when you start doing fairly complex stuff (e.g., custom asset management), they can get a bit unwieldy.

As for the ecosystems, I find javascript is more in flux. It is more work to keep dependencies up to date or to decide what library to use when you need one, and I've had apps break on minor and patch updates to dependencies fairly often.

There is also a focus on small libraries that just do one thing. Nothing wrong with that, but the number of dependencies some projects have is a bit crazy.

If you work with Ruby or Python for web stuff, you inevitably end up using JS for the frontend, so it is certainly a reasonable choice to use Express as the server and go full Javascript.

And my company does that a fair amount, but when we need an app to do something more complicated than serve web pages and talk to the database, we end up moving over to flask/python to take advantage of python's better libraries (esp. for math/science/data stuff).

So, I still see some value in picking up python. Nothing wrong with any of the other languages though, and you can learn a lot from any language. Depends on your interests and needs really.

Re: Has Python killed Ruby?

#45
post #35

Earlier quoted context omitted.

Do you have experience with NPM and Yarn (javascript/node) and if so, how do the package managers and ecosystem compare? I'm asking because I'm primarily a js dev with a bit of Ruby and Ruby on Rails experience, and I'm wondering if Python/Ruby are worth investing in at this point and if perhaps instead it makes more sense to stick with js (Yarn in particular for package management) and explore more fundamental (C/C#…

Yeah, I have worked with js/npm more than ruby or python lately. I've looked into yarn, but haven't used it on a project yet. I like npm. For package management, I think npm is on par with bundler (ruby) and thus a bit better than pip. I like the ease of use of package.json scripts and find myself using them more and more. They feel lighter and easier to set up than the ruby equivalent (rake tasks, usually), although…

> For package management, I think npm is on par with bundler

NPM is non-deterministic and doesn't have lockfiles, so it's a bit of a stretch to say it's on par with Bundler.

Yarn solves both those problems for JavaScript projects, and it's much faster.

Re: Has Python killed Ruby?

#46

Ruby is a much simpler and more aesthetically pleasant language. Python has all sorts of sharp corners. You really should learn both but I think Ruby is a much easier starting point. Also, a lot of research on dynamic languages is being done with Ruby, e.g. TruffleRuby, JRuby, RubyOMR, and probably a few more I'm forgetting. Each of those projects is an impressive body of work in and of itself that points to Ruby bei…

> In some sense Python is much more stagnant these days in terms of innovation at the language level.

Python may be more stagnant and the implementation level (at least, in terms of experiments outside of the main interpreter like the ones you describe for Ruby), but the language itself seems to be advancing much faster than Ruby right now.

Re: Has Python killed Ruby?

#47
post #20

Earlier quoted context omitted.

Not just visually. It is also conceptually much more aesthetically pleasant. I still don't know how metaclasses, descriptors, __magic__ methods, multiple inheritance, all the different string formatting schemes, generators/co-routines, etc. work in Python. The amount of stuff you have to learn in Python is a lot more than in Ruby.

> The amount of stuff you have to learn in Python is a lot more than in Ruby. I couldn't disagree more with this. Python is pretty thin when you get down to it. Magic methods alone are 80% of the way to knowing how everything in Python works. Multiple inheritance in Python is way simpler than the two-pronged inheritance scheme of Ruby, where you have both a parent class and modules (which can be loaded either before…

> .. but Ruby doesn't support keyword parameters

Your information is outdated, and only applies to Ruby 1.x. Ruby added real keyword arguments in 2.0, and declaration of mandatory keyword arguments in 2.1.

Re: Has Python killed Ruby?

#48
post #38

Earlier quoted context omitted.

> The amount of stuff you have to learn in Python is a lot more than in Ruby. I couldn't disagree more with this. Python is pretty thin when you get down to it. Magic methods alone are 80% of the way to knowing how everything in Python works. Multiple inheritance in Python is way simpler than the two-pronged inheritance scheme of Ruby, where you have both a parent class and modules (which can be loaded either before…

It's odd... I have relatively little Ruby or Python experience, but I have a kind of undefined affection for Ruby but if I'd have to choice at gunpoint I'd go for Python. I think the reason is that while Ruby does feel more 'pleasant' to me, especially the me that is new to programming, Python feels less vague, and I've grown to hate vagueness in my code. I'd probably recommend Python to new coders at this point, but…

I can't vouch for it myself, but the Django Girls tutorial [1] is the resource I hear recommended most often for learning Django without any prior programming experience.

[1]: https://tutorial.djangogirls.org/en/

Re: Has Python killed Ruby?

#49

Earlier quoted context omitted.

Yeah, I have worked with js/npm more than ruby or python lately. I've looked into yarn, but haven't used it on a project yet. I like npm. For package management, I think npm is on par with bundler (ruby) and thus a bit better than pip. I like the ease of use of package.json scripts and find myself using them more and more. They feel lighter and easier to set up than the ruby equivalent (rake tasks, usually), although…

> For package management, I think npm is on par with bundler NPM is non-deterministic and doesn't have lockfiles, so it's a bit of a stretch to say it's on par with Bundler. Yarn solves both those problems for JavaScript projects, and it's much faster.

Right, you have add on npm-shrinkwrap if you want to lock everything down (which I do use for some projects).

Yarn may well be better than npm, in fact, as far as I can tell it is, but, frankly, npm works well and I'm tired of switching js dependencies, especially really core dependencies like a package manager.

I'm hoping npm just steals whatever yarn does better than it so that I never need to switch...

Bundler is pretty great.

pip... pip... I don't know what to say about pip. It's probably my fault, but I can never seem to get pip to fully understand that what I put in requirements.txt should always always always be used for the project no matter what system level libraries are installed. If yarn were available for python, I'd switch to it today...

Post reply on HN