Hacker News new | comments | show | ask | jobs | submit login
Ask HN: Ruby or Python for 2018?
27 points by methochris 11 hours ago | hide | past | web | favorite | 29 comments
I'm having a really hard time deciding between sticking with what little Python I know and using Django or switching over to Ruby/Rails for developing my side project. I'm hoping anyone could jump in and voice their opinion on either side.

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...






I used to hate Ruby until I had to learn it two years ago. Now, I wish that this is the only language I'd ever need to use. It's beautiful, and testing stuff with it is a BREEZE.

Ruby, PHP, Go, Python, Javascript & Elixir developer here:

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.


I can't recall ever hearing anyone say they "hate Ruby".

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...


Python

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.


You seem overly concerned with Hype Driven Development.

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 have almost come to regret learning Ruby because it is a beautiful language that I wish it would be my main language but unfortunately I think it has lost scripting language race by the look of its popularity among competitors.

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


I feel your pain. Beautiful language with no real peers in that regard, as far as I can see.

Ruby’s beautiful object model alone is worth learning. “Metaprogramming Ruby”[0] is a great introduction to that. Its flexibility is what makes things like DSLs so easy. The language also includes functional programming influences. I wrote Django apps in Python for the better part of two years, and for what anecdotes are worth, I didn’t learn nearly as much as I did writing Rails applications in Ruby. I’d pick Ruby every time.

[0] https://pragprog.com/book/ppmetr/metaprogramming-ruby


Python is a good career move. Ruby is more fun. There's no right answer :)

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.


Have you looked at Elixir / Phoenix?

http://phoenixframework.org/

It has some Rails roots, so you might like it.


Elixir and Phoenix are amazing. I use them any chance I get. The problem now is that the ecosystem is still in early stages. You're gonna end up writing some more libraries whereas in an ecosystem like Ruby there are gonna be plenty of gems handling the typical things like Api wrappers.

There are 2 choices of language for any side project.

1) the language you know best

2) the language you most want to learn

Only you can decide on which has a higher priority.


I understand your concerns about Django and Flask... as someone who doesn't work with either on a regular basis, getting reacquainted with Django feels very heavy... and Flask seems too minimal.

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.


For what it is worth, I think you will probably learn something from trying Ruby, even if you wind up sticking with Python. The community and language design are just very different from Python's: MINSWAN v BDFL, many ways versus Pythonic PEP's, everything is an object versus some things are objects, etc.

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.


If you are going to learn something different, learn something really different, not another dynamic unix scripting language.

If you code alone, use the best available which generally I assume people would say Ruby.

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 love Ruby, but Python is super simple to learn. I haven't spent enough time with Python to do anything super cool with it, but it does seem to be more consistent in terms of the code you will read.

I also think that once you learn Python, a lot of other languages' syntax (such as Go and C# for me) becomes more approachable.


> Rails is awesome but people hate Ruby

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.


The Ruby job market outside of Rails is tiny, unfortunately. Most folks never bothered to look. DevOps and InfoSec folks tend to know better -- Chef, Puppet, Capistrano, Vagrant, Logstash, Metasploit, Homebrew, Sass... all written in Ruby)

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 use Sinatra and sequel for a few apps and it's great (and puma to run it all)

we have switched to python for our FaaS but only because of lack of Ruby support from AWS lambda.


I would take a look at Laravel which is php on rails with less magic and more built in features such as authentication and background jobs. The most important thing is that its community is growing rapidly and it has a BDFL ala DHH in Taylor's Orwell. Also there are really good fresh resources such as latacasts Codecourse and the Laracon conferences

I still like php for web development, although it seems to be falling out of favor somewhat. The new version 7 is quite fast, and its quick to get up and running. I've not used Laravel, (I use a lighter framework called Silex) but it is PHP's version of Rails.

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...).


Having had to learn PHP to work on some WordPress stuff, I can honestly say that I find PHP 5.6 and onward to be a competent, usable language. It has its quirks, but so does JavaScript. In fact, I'd say PHP and JavaScript are now close cousins. The array methods are a bit annoying, but you can definitely write effective, clean code in modern PHP.

I would say try out both and use the one that makes you happy and is the best tool for the job.

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...


i have a simple suggestion, you should learn both, we live in a polyglot world now, you need to be able to learn multiple languages and to do so quickly. i started with php then moved to python/tornado/sqlalchemy, ror, ruby/sinatra/activerecord, nodejs/expressjs, and lately golang/gorilla mux/database/sql. just start with one, suggest ror, i’m sure you’ll have multiple projects in the future. ruby was built for web app development, django’s a bolt on for python that then added web functionality. dont worry about the community issues, ror has enough great libraries out there that you could put together a pretty slick website quickly. a side note, if you need to use some scientific packages, python might be better supported like numpy etc. fyi ruby language is much nicer than python imho (insert flame war). dont dwell on this decision too long, either should be able to get you what you want which is a slick website, get a move on it

If you're already comfortable in Python, don't bother with Ruby. You won't find anything new there, and a lot of frustrating language design errors. I've written about this in more detail at http://madhadron.com/posts/2013-02-25-a-criticism-of-ruby.ht....

Python’s more broadly applicable, easier to read and maintain, installed by default on distributions. Pyramid is another good option if you have something against Django.

It's your side project, do whatever you want! You said ruby is fun for you then go with it.

Stick to Ruby, Matz will give us new Ruby this christmas, and he's the best mormon I have ever seen so that's a plus.



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: