DEV Community

Discussion on: Why should I not choose Ruby on Rails ?

Collapse
 
gregopet profile image
Gregor Petrin

Because Ruby is wacky? :) (sorry, personal distaste for Ruby :p)

But you could try Grails as a mix of both worlds: inspired by Ruby on Rails, powered by Spring Boot, in active development since 2005, uses Groovy as its language (Groovy is like injecting Ruby mojo into Java).

I've completed several projects with Grails and while I'm increasingly using micro-frameworks lately for web, Grails is still a very fine framework.

Collapse
 
martyonthefly profile image
Sylvain Marty

Hi Gregor,

I will take a look on Grails to see how it works ! I already tried the Kotlin implementation for Spring and it was very cool to use :) Nevertheless, I don't know if Grails is similar to Kotlin...

Thanks for your reply !

Collapse
 
gregopet profile image
Gregor Petrin

Grails is a framework while Kotlin is a language so you can't directly compare them.

You can compare Grails vs. Spring Boot (regardless of the language in use, and you have quite a few to choose from) in which case Grails is a more opinionated, convention-over-configuration framework with lots of helpers, integrations and concepts that would be left for you to implement on your own in Spring Boot. It has, for instance, its own persistence framework, based on Hibernate down below but looking a lot more like Rails' active record to the programmer. There's plenty more: centralized URL mappings, command objects, a service layer, HTML helper tags and JSON & HAL renderers come to mind first, but do take a look at the docs yourself (and the docs are pretty good btw, which is a huge bonus).

As for the languages, Groovy and Kotlin are loosely related; Kotlin actually took a few of its concepts from Groovy (as did Swift). Groovy is a bit wilder, optionally typed, script-like language, comparable to Ruby. Crazy productive! .. though sometimes its wild side is a bit too much. Kotlin on the other hand is strongly typed, with extra strictness added on top (e.g. null safety and immutable variables). Personally I prefer to use Groovy for scripting and the view layer, and Kotlin for the business logic.

Theoretically, you could use Kotlin to write Grails code, but it's probably not optimal because a lot of the Grails magic relies on Groovy's concepts.