News for hackers. Stuff that matters.
Re:When Should You Not Use Rails? by nurettin on Wednesday August 05, 2020 @03:58AM (#24058312)
> I’d still start out in Rails, personally. If you’re building something quickly to see if anybody cares, I know of no framework that comes close to its productivity.

I've used RoR for 5 years, spring boot/kotlin for 2 years and Django for a year. Once you've set up the workflow, there isn't much difference in terms of productivity. The pain point is setting up the base project and keeping it updated as library versions change.

What django and spring boot are missing are the commandline generators for entities, controllers and views and a quick setup.

Django and spring boot need a little bit of careful setup. Django needs its settings, applications array, middleware declarations, etc. Once you get over this and start adding your entities, views and routes it goes fine.

Spring boot requires a rigid folder structure, application property files, a careful setup for migrations and logging. Liquibase setup, etc. It doesn't get off the ground easily. Once you start writing your entities, repositories, controllers, services, views it goes smoothly thanks to lazy initializers.

Re:When Should You Not Use Rails? by evnix on Wednesday August 05, 2020 @05:50AM (#24058933)
springboot? it cannot get easier than this: https://start.spring.io/

I personally choose Java/SpringBoot, it has a steep learning curve, but has strong typing, runs as fast as most C++ code out there, plus you can do async.

and if you want something fast but that is as easy as Rails and runs on Java/Groovy/JVM, use Grails.

Re:When Should You Not Use Rails? by treis on Wednesday August 05, 2020 @01:33PM (#24063340)
>springboot? it cannot get easier than this: https://start.spring.io/

That doesn't seem easy at all. Immediately I am presented with 5 choices and then a list of 50 things that I might want to add to my application. Some of those 50 choices seem to be mutually exclusive and I don't have any way of knowing which I might want or why.

Rails? Just rails new myapp.

Re:When Should You Not Use Rails? by cogman10 on Wednesday August 05, 2020 @05:23PM (#24065772)
To be clear, your choices are:

Build system, Language, Spring version, Java packaging, Java version

The rest is naming.

That is not complex to me.

As for the dependency options... well, they are dependency options. I'm sure you have no problem with adding gems to a rails project, even though there are thousands of them that may be mutually exclusive! A non-ruby dev might not know which gem they want and would have no way of knowing what they want or why!

rails new myapp is exactly the same as doing this with no dependencies.

Re:When Should You Not Use Rails? by ben940830298432 on Wednesday August 05, 2020 @05:11PM (#24065635)
If you want something more built out from the start you could use https://www.jhipster.tech
Re:When Should You Not Use Rails? by _AzMoo on Wednesday August 05, 2020 @06:43AM (#24059240)
Great news. Django 3.1 was released today which includes support for async views. The ORM is still not async, but it's a big step.
Re:When Should You Not Use Rails? by matthewowen on Wednesday August 05, 2020 @08:44AM (#24060170)
You mean "static" typing. Ruby is strongly typed, it just isn't statically typed.
Re:When Should You Not Use Rails? by bdcravens on Wednesday August 05, 2020 @08:55AM (#24060263)
> if you want something fast but that is as easy as Rails and runs on Java/Groovy/JVM, use Grails

Is there a reason you'd use Grails over Rails on jRuby?

Re:When Should You Not Use Rails? by nurettin on Thursday August 06, 2020 @01:13PM (#24073043)
Haven't used grails, but back in 2012, JRuby used to generate so many in-memory classes, the class space would run out and we didn't really have a garbage collector for that. It came a few years later. Things might be better with JRuby 9000 and java 1.8+ these days. I presume Grails didn't suffer such problems.

Note: I see that torquebox was discontinued. It was a simple way of getting your rails project to work with JBoss and had many nice utilities like infinispan and stomp. Good old days.

Re:When Should You Not Use Rails? by ageitgey on Wednesday August 05, 2020 @04:06AM (#24058353)
If you are building something new with Django where Rails' generators would have been helpful, check out https://djangobuilder.io/ - it lets you quickly list out the data model and then it generates the whole code skeleton for the site.

It's not a perfect replacement, but it can save time if you are starting a new project with a lot of boilerplate code.