Ask HN: Ruby or Python for 2018?
Clearly the Ruby community is experiencing some kind of event where the numbers are shrinking and some of the more prolific bloggers/contributors are talking trash and moving on and i'm not sure what to make of this. There is alot of tutorials and information already out there but it's getting dated and i'm not sure how much of it that was written in several-versions-old Rails will still apply and there's not ton of new stuff coming out. There seems to be a gem or tutorial for anything I could need to do but it's growing more stale by the day as their creators seem to be off to greener pastures.
Python has it's moments for me but after doing some tutorials I'm really finding Ruby/Rails to be just fun and exciting to use. I like how thorough the framework is and the development experience in general, with console commands for everything and automated tests re-running on save, and it seems they are adding greatly to the rails core, as opposed to Django's big 2.0 feature was basically copying Flask's URL system. I also like the community having a vocal figure like DHH kind of "leading the pack" with alot of methodology I agree with.
Is ruby really as bad as people say and is on it's way out? Is leaving Python for it, if my only interest is web-application development, a dumb idea? it seems like i'm standing at this cross-roads looking out and seeing on one side, Rails is awesome but people hate Ruby, and the other side is people love Python but Django is a big limp dick and I don't have time to program the kitchen sink with Flask. choosing between either is very confusing...
38 comments
[ 3.2 ms ] story [ 95.8 ms ] threadhttp://phoenixframework.org/
It has some Rails roots, so you might like it.
I've found php is somewhat slightly more verbose and fewer data structures seems to make php code easier to maintain for other people than perl and java (which I also maintain...).
There's not a lot of new stuff coming out of these frameworks because of how mature they are.
Both languages/frameworks are comparable. Your end product will not be very different regardless which route you take. Both languages and frameworks will be maintained 10 years from now. The job market for both will exist 5+ years from now.
Pick one you like and get to work!
I program in Ruby right now for work but am comfortable switching to Python. There are plenty of Ruby positions available, we've hired 5 or so Junior Engineers out of Rails/JavaScript bootcamps. It's just that Python has the data science and machine learning positions in addition to web development.
All this with the caveats that: I think both languages have advantages and disadvantages and I think knowing more languages is better than knowing fewer or one.
The #1 rule that trumps all, no matter how small or big your project: Use whatever facilitates your work.
Sometimes you need to get things done quickly, sometimes you need to hire a lot of people cheaply/easily, sometimes you need a project to scale. In each of these cases, you may want to use a different tool. For something that's your side project, you probably just want to be able to get work done effectively and enjoy what you're doing. Pick that tool that you most enjoy working with, in that case.
For me, I default to Ruby (and I haven't touched Rails for work in 2 years!). I find it to be a joy to work with. I expect that later, as a I grow as a developer, this will become Elixir and/or Erlang. Sometimes I have to work in Python, because that makes sense for the project. I find it a bit of a slog, but it gets the job done and lets me move on to other things.
If you are a developer learning the ropes, I couldn't recommend a better language than Ruby. Your skills will translate. You will find work. The places that hire junior developers that only care that you know their stack aren't worth your time.
Most of the people that have publicly roasted Rails were wrong, for one reason or another, by the way (especially that Twitter blog post...). Too often, people are trying to fit a square peg into a round hole. The best advice I can give you after that first rule is that you should ignore what people say and just get your work done. That's the thing that differentiates people who stay working in this field and those who don't.
1) the language you know best
2) the language you most want to learn
Only you can decide on which has a higher priority.
Personally, I'm a big fan of Rails and Flask and use both on a regular basis.
You may also want to give this a read:
https://nickjanetakis.com/blog/it-doesnt-matter-what-web-fra...
Is this sentiment common? It might be just my personal echo chamber but I've often heard the opposite stance, i.e. people saying they hate Rails because of all the "magic" but at the same time they like Ruby as a language because of its flexibility.
All of my ETL pipelines are built in Ruby and I wouldn't have it another way. From a development, support and deployment persective, Jekyll is hands-down the best "web framework" I've ever worked with. If you need to build websites that don't need sessions/accounts, there isn't a better tool. NGINX's SSI module fills in some (tiny) gaps.
Ruby's a great language with a healthy set of tools. It's just not popular among people making CRUD apps right now.
To most folks though, unless they're already Ruby developers (AND not a Rails shop), Ruby and Rails might as well be the same thing.
we have switched to python for our FaaS but only because of lack of Ruby support from AWS lambda.
I also think that once you learn Python, a lot of other languages' syntax (such as Go and C# for me) becomes more approachable.
Django, a highly competitive web framework. With great extensions like Django REST Framework. Assets with django-webpack-loader. So on. It may not be as good as Laravel or Rails, but they're all really active.
But the thing that makes Python best is the web framework is where it begins, not where it ends:
Want text analysis? NLTK or spaCy
Data? Pandas, numpy, pytables
Want more analysis? scikit-learn, tensorflow, theano.
Solid language standards? PEP8 and PEP257 makes most python code you see in open source very conformant
Test framework? pytest. And its plugins. tox for testing against a matrix of python versions/settings (kinda like Travis).
Handling environments + packages easily? pipenv
Multiple python versions? pyenv
Editor integration? Jedi + python-mode for VIM, VSCode, Atom, Python
Images / Graphics? pillow
Super-powered REPL? ptpython
Deployment? Fabric, Ansible, Saltstack
Documentation? Sphinx, Docutils
Want C/C++ integration/performance? pybind11, cython, CFFI, swig
Mobile dev? kivy (though I wouldn't say it's the best yet, when I tried it, setup was easier than react-native)
And that's just scratching the surface. Python has high quality, permissively-licensed libraries, with solid documentation. A lot of the plugins I mentioned above for handling data use C-level speedups. Of these, tensorflow, and Theano can use GPU speedups.
Rails is fantastic. I like guard and the asset pipeline. But I just learned to use GNU Make's "$ make -j task1 task2" and django-webpack-loader. I also hear good things about Laravel in PHP.
with so many supported libraries available i keep finding that adding more functions to Python code does not actually add much to the amount of code.
Part of the reason I suspect is the development cultural difference brought by language barriers. Without sound development, it surely will struggle to become better than alternatives.
https://www.ruby-forum.com/topic/4570470
[0] https://pragprog.com/book/ppmetr/metaprogramming-ruby
Anyway, I just started using CherryPy for a new project and would like to recommend it. I had actually used it around 10 years ago and hadn't given it much thought until recently, but it's quite simple and nice for REST APIs.
Ruby is designed to make programmers happy.
Ruby and Rails are "boring" because they are mature and do their job extremely well, so the cutting-edge devs that helped get them there got bored and moved on to other newer ecosystems.
If you are more interested in getting the project done fast and efficiently and you don't mind doing it someone else's way, then RoR is a good choice.
If you like to do things your own way, then Rails will probably frustrate you because it is very opinionated on how things are done. You can override everything, but some people's personality is more suited for the node.js world that is far less of a framework and more of an ecosystem of libraries.
These are 2 popular posts that will help you figure out if RoR is a personality fit for you:
http://david.heinemeierhansson.com/2012/rails-is-omakase.htm...
https://medium.com/@timbuchwaldt/rails-is-boring-thats-great...
If you are intending to collaborate then python might be a better choice as its more popular.
Just a different take. Either one is great.
I'm personally not someone that likes to look at new languages and compare them for the sake of it. There are folks that like to compare compilers or interpreters and the internals of how those work and debate them.
I'm more interested if something new can help me in delivery of working software. Having moved from a Java world to Ruby/Rails, I find it not just helps me deliver, it pretty much gets out of my way (most of the time) compared to Java.
I haven't done much more than read about Python/Django/Flask. If they are mostly similar to Ruby/Rails it doesn't sound like there would be benefit to learning them outside of curiosity (and an affinity to Monty Python).
I suspect that big name bloggers and people that talk a lot about things may find a need to keep viewers coming to their blogs/channels. If there isn't a lot of new stuff to write about but it is still a solid delivery platform, that isn't too exciting to draw viewers.