Rails wins every battle for initial development speed, as the conventions are so thorough and well thought out that nothing even remotely comes close. Laravel is creeping in, but it's not there yet IMO.
LiveView however, scales better (in every sense of the word). It also comes with batteries included (auth, database access, jobs, mailer, complete testing kit etc), little-to-no-DIY-JS, and one of the finest VMs there is (BEAM).
If nothing else, I'm happy that these projects all fight the "let's take a step back"-fight. At $DAYJOB I write React with Relay and the amount of hoops one needs to jump through is exhausting, even though I've been writing frontend JS for many years now and consider myself half decent in it.
At a glance it's hard to see the value or believe that it has the same longevity or $$$ value.
In terms of $$$ value, it is extremely efficient --including all the "alien" stuff, and that's why it's so cool. An Elixir team will generally create things cheaper to build and operate.
Now, the question is how many Elixir shops you are going to find a job with, but the answer to that depends on the type of career trajectory you are choosing. For example, Rails is not an industry standard by any means if you think in terms of classical IT consulting jobs but has a stronger dev mindshare in startups, so there you go.
Personally, I'm comfortable betting my career on Elixir at the moment. It's too goddamn good to remain a niche language - I expect it to get a lot bigger in the years ahead as more companies and devs fall in love with it. It'll happen slowly, and it's never going to reach the level of saturation that that, say, Javascript has, but I think it has a bright future.
Phoenix and LiveView are a joy to work with, much more so than any previous technology I've used. I haven't yet looked at any of the exciting new ML stuff that's happening in the Elixir world (Nx etc.) but hopefully they'll drive adoption too. I'm never going back to my old ways.
(And of the two, I'm more productive in Phoenix, but I didn't mention that in the comment you're replying to.)
(I think the only way to join the Slack atm is to be manually invited because the signup app got broken by Heroku's pricing changes - but if you email the address in my profile then I'll ask someone to invite you.)
It saddens me that ruby, python, elixir, JS... many of the best and most productive backend frameworks have types as an afterthought only.
Rust is cool, but it's also hard to write(did last year's AoC using it, and it was fast to run, slow to write).
Anyone have any recommendations for me? Should I look at go/gin perhaps? No Java please - I need type inference because I'm a spoiled baby.
Edit: anyone tried crystal? Looks promising, but doesn't seem popular...
Could you elaborate on this?
The project structure of a Rails project is fixed and it's easy to jump into somebody's else project. The structure of a Django project is potentially pure anarchy, good luck with that.
That's mitigated by the lack of autoloading so you can learn the structure of the project by looking at the import statements at the top of the files. Unfortunately that means that you have to waste time by writing those imports. I hated that in Java even if the inevitable Java IDE added them for me.
The ORMs are more or less equivalent. I have a dislike for having to actually type the default scope (not the Django term) in Django as in
Model.objects.filter(...)
when Rails lets me type Model.where(...)
The real time waster is the templating language which in Rails is basically Ruby and in Django is not Python. It's something else much less powerful so you have to either prepare all the data in the controller (which is called a view in Django) exactly as they'll be displayed in the page, or write a templatetag and use it to transform the data inside the page. That loses an unbelievable amount of time. If I count the cumulative hours, days, weeks spent at writing templatetags instead of a couple of Python statements I don't know whether to thank Django developers for the easy money or to roll my eyes because that time is useless.To recap, Django wastes developer time. It's death by a thousand cuts. I'll never use it for one of my personal free time projects.
Edit: don't be too smart in Rails, that is don't build too much magic and waste the time of the next developer into a quest for finding where something really happens. Write straightforward code and if some method name is created automatically, put a comment hinting at the source.
But yeah, if I had an option I'd prefer things to be more explicit.
When you find yourself interacting with the magic parts, it is imperative that you comment what is going on so the next dev, which will probably be you, isn't also surprised.
Great point around project structure and ability to move between codebases - I think the lack of enforced structure in Django absolutely helps increase codebase entropy over time.
Django has support for Jinja templates so you could just use that and call methods in your templates, which negates the need for most template tags.
Although its been a while, I do remember struggling a lot with autoloading in rails for two reasons: you can't find your dependencies from the code itself and when it breaks down its quite hard to debug. Maybe things are better now with rails and when you get really proficient you know how to find where things are - however that increase the learning curve which is supposed to be a benefit with rails. With django, I can generally look at the imports to see what this module is using. With the help of the right tools I can:
- 'go to definition' of any symbol and 99% of the time land in the source, even of django itself - automatically add imports so you don't have to write them - automatically sort and format imports and see the unused ones
With the optional static typing that is being greatly improved with recent releases, things get even easier.
I prefer this a lot above the rails 'magic', for me it is a huge time saver because my memory is not so good, there is minimal friction moving around between code and is various dependencies to see exactly how its done. With rails I'm more often looking at the docs (not so great) or examples, with django I'm most of the time looking at the source code itself or running the shell (which is very, very good).
> Model.objects.filter(...)
Its called a manager. I understand you don't like to type 'objects', it fits in the rails culture of being allergic to redundancy, though I can't really empathize with it.
> The real time waster is the templating language which in Rails is basically Ruby and in Django is not Python.
I hate both but prefer the django template language. I'm surprised this is such a time waster for you. I think its good practice to not put too much logic in the templates so the division of labor in django is much better imo. But then again, I'm not a good frontend person and have problems with the deeply nested structures in html. Everything can help me simplify the template is a huge timesaver for me, bugs in the frontend code are terribly annoying. Honestly I hate frontend.
> Its called a manager. I understand you don't like to type 'objects', it fits in the rails culture of being allergic to redundancy, though I can't really empathize with it.
The point it that the objects method adds zero information to the statement. However it's an opportunity to add a soon to be discovered bug when Django crashes because one forgets to type .objects
They should have made filter a method of all model classes and of the models.Manager class. Same thing for all its sibling methods.
This is time well spent in my opinion. Everyone, including future you, benefit from it.
One of my biggest gripes in Rails is not being able to do this.
The frontend situation in Django is terribly outdated. Just the templating system is the worst thing I've ever seen, and it doesn't even have an asset pipeline.
Rails has pretty good code generation. If I want just want to get started and add a birthday field to the settings page, I can run a short one sentence command and it will go off: it will know how to do schema migration, routing, views, controller, etc. This is possible because everything is so straightfoward and consistent. I'm not saying generators are a good way to write your code, its just one example of how rails has very a high level of abstractions.
Django however has the admin. Once you have a model, it will generate a fully functional cms for it and its very tweakable. For a lot of businesses, the admin is quite servicable as a cms or administation tool, and it is a _huge_ timesaver.
I generally prefer django over rails, it just seems all much more explicit and easier to discover to me, however I do agree you can be a lot faster with rails once you learn how things fit together.
Rails has the optional ActiveAdmin gem but it has basically no automatic integration with the Rails app and it's not included. That means that any Django app has a basic admin and most Rails app don't have one.
To be fair, it's easy to hit the limits of those admins but by baking a user hierarchy in the main web app with a super user, you can use the standard web app for many administration tasks. If you can impersonate users (handy for debugging and you have all their data anyway) you can do a lot of things without an admin interface.
Architecture-wise I really like the ember-data approach because it allows a lot of automations when it comes to left join/right joins of datasets, with an integrated mockup server etc.
But it's not as cool as the other ones I guess, because it just works too well enough!?
As I said in my previous post, it's a framework based on conventions, so it'd a batteries-included approach to both frontend and backend.
[1] https://emberobserver.com/categories/ember-data-adapters
I’m thinking of building a side project with Rails and I’m wondering if they are worth it?
I'm truly amazed how much simpler things are. I feel sad most of us have forgotten how easier things could be, and I'm terrified about new people joining this industry that will never know about how easier things could be because they'll never experience that (as things are right now, who knows the future...).
If you're reading this and never tried Rails, or discarded it because you listened somebody say the usual "PHP is ugly/Rails is dead/JavaScript is messy" give it a try with an open mind and ignore what others say for a moment. I can't recommend it enough.
It might not be the best tool if you have 1k engineers working on the same repository, but as a small team it has no competitors, it's just miles ahead everything else (well, honestly, maybe Laravel is as good).