There is no tech stack in the world that will get you shipped and proving your business faster than RoR.
There is no tech stack in the world that will get you shipped and proving your business faster than RoR.
I think the surprising thing about this comment is that you actually developed using Django for all those years, and you still prefer RoR.
The vast majority of people on the web that comment invariably say they are pretty much the same and it depends on whether you know ruby or python better.
So people who already use python for finance or data science pick django.
I saw a study (old now, from the early days) that claimed they were about the same but that the admin page on django cut dev time by some %.
This is the first I've heard a long time django user say that rails was faster to develop and not about the same. Can you elaborate on why?
The efficiency you gain using Django on the admin side is lost with every other part of your app.
1. Active Record is superior to the Django ORM (which is still good). Being able to set scopes and do a lot of conveniences right on the model without needing to extend/override a manager is great. Being able to connect to an existing database for free is also great.
2. Controllers are great. The way they can be nested and composed is also powerful. Being able to mount a resource at any level in the hierarchy either alongside or beneath (or both!) is hugely powerful. I can state concerns at each level and 'forget about it' deeper. Eg, if my controller A needs to ensure a given user has access to that resource and all children, I can do that at level A and trust its handled so in the controller for level B or C (deeper layers) I am not worried about it.
2b. The syntactic sugar to add authentication/authorization/guards in controllers is incredible. `before_request :ensure_access`
3. Active Support is phenomenal.
4. You can build very elegant, flexible and powerful RESTful and RESTish API's REALLY quickly. And not just naive stuff that you can do with something like 10 lines of Flask ... but really foundational stuff that allows you to hit the ground running and then build on it layering in more security and functionality.
5. Polymorphic/STI power with Active Record. AR gives you so much more freedom to do polymorphism and bend your database to model your data as you see fit. With Django you are oftentimes stuck doing things their way. For instance if I want multiple classes to share a single database and get instantiated based on a 'type' field ... that is trivial in Rails and difficult with Django. Even moreso if you want to do relationships with those polymorphic objects.
6. Finally... the most important thing... it's sometimes difficult to model your domain/business inside of Django and by extension the Django admin tool. Let's say you have a friendship between two people. How do you create that in Django? You might have a many-to-many which means there is gonna be a join table somewhere. Do you ask your customer support folks to go into the FriendRelationship UI and 'create an object' connecting person_a to person_b and ensuring to choose the correct relationship type from the enum? Worse, you have too many users so you cant use a select field or search box without plugins and are left with two input boxes that expect a valid person ID to the FK. So now customer support needs a workflow for managing this data. I'd rather build my own "manage friends" page that will take me all of an hour and provide an experience modeled after the problem/task not the database.
Or let's say you have a more intricate transactional type of process where an object needs to be created with 3 or 4 child objects. The parent needs to be created first, then the children need to be created and linked to that parent. Sure, you can do this in the Django admin flow but at that point you might as well be writing `INSERT INTO...` queries. Again, I'd rather build my own tool. I will save SO much time building the API and the business logic for my program that I'll be afforded the time to build an administrative tool that is focused on tasks specific to my team/business not just a graphical representation of my SQL tables.
I could go on and on and on. I was a Django zealot for a long time and refused to drink the kool-aid. I bought into the hype from the community and trusted folks when they said "rails is magic, I don't like it" but that is a horribly naive approach and frankly I only hear it from less experienced engineers. When you get acclimated to Rails you realize there is no magic, it's all just straightforward code written by people who truly want to get things done. Perhaps I just align more with the Ruby way of thinking. Django folks tend to pride themselves on boilerplate and more complex interactions... like it's some kind of badge of honor.
You stick a check in the update controller for Friendship to destroy the object unless it has two members (or not to create without two) and additionally you add a "validates_numericality_of :friends, on: [:create, :destroy]" check on the model itself.
When someone "friends" another user, you create a new Friendship with both users as members. It's automatically bidirectional (but you probably want to add some approval logic in here, which is still pretty easy).
The manage friends page discussed is just a collection of all of the Friendships of which you are a member. You can use either update or destroy to remove you from membership, because now either will achieve the same thing.
It's funny hearing this because I was under the impression one of Django's core principles was to avoid boilerplate.
Like you, I've worked a ton in Rails and Django, but I started with Rails and always find Django work to be a slog -- particularly when it comes to environment configuration and administration. And the documentation for when you need to muck around under the hood is really not great.
And, invariably every Django application I've come across has tons of boilerplate.
- make it a web app so the team can run tests
- add some charts
- keep it secure
- umpteen new semi related features
Would have been easier to just start at "rails new".
You'll fly through it.
1. Web development
2. Ruby/Ruby on Rails
3. Test Driven Develepment
If you're new to programming, start with something else. Trying to learn all three of these at the same time is not a recipe for success. Source: personal experience watching 100% of former mentees fail to make any progress with this tutorial.
Rails is not really for new learners in my opinion, since the famous Rails magic can obscure what's happening under the hood, and the framework itself has grown and evolved over the years. Nodejs is better for new devs in my opinion, but Rails really shines once you have the basics and a couple of small apps under your belt.
I'll take django for simplicity any day and run React from it's templates.
First I'd start with creating the database in Postgres. Create tables to hold data and any views needed to represent joined tables for convenience. Once that's settled, the express server comes next to create a CRUD API to work with the data and handle user authentication and authorization. This is dead simple and once it works there's little you need to touch. The database handles any data dependent business logic.
By this point you can make API calls and use the application through any REST client.
So now I just need to create a React client to consume the API and give a great user experience. Don't need Redux. Grab React-Router and a couple packages for UI components and you'll be up and running with the MVP in no time. Checkmate.
Not sure how you're beating Rails or Django at this, unless you're a 10X developer going against a normal one. For that matter, I'm willing to bet an experienced Drupal developer using drush would be faster setting things up.
Node will prob take longer if you're taking time to try out [new hotness lib of the day], though.
If so, would be cool to post it here to get a discussion going on it: https://hackerforums.co/show-hf-f7/
I discovered it recently, and it has been great to be able to use various Python NLP libraries without having to learn a new stdlib, deployment stack, etc.
PHP and the laravel framework will be quicker to develop and faster to ship and perform more requests per second.
JS - Node/ Vue/react base provide one environment which can speed up development.
Still fast compared to Django, java, asp, go, perl, etc