Comment by flossly

9 hours ago

I moved from Ruby+Rails, though some other frameworks that I had no choice in (inherited the projects), to my new place of refuge: Kotlin+http4k.

Kotlin is a very acceptable Ruby-with-types. Even better than the new Ruby with optional types. It reads the same, it writes very similar, and it produces very similar "style" of code. I like the be on the FP side; Kotlin (as Ruby) allows that. I dont mind some OO in there; Kotlin (as Ruby) is okay with that. The benefit is a much larger community, JetBrains products that work well (and have free versions for Kotlin) and the JVM (interop with the Java ecosystem means there's a lot of libs you can use).

http4k is a library much like Rack in Ruby. It does a bit more, but essentially they are similar.

I prefer SSR over SPA. With Ruby I used HAML. Now I use kotlinx.html, which is "just Kotlin" (it compiles as Kotlin, allows me to put breakpoints, and mix in bits of logic --in Kotlin obviously-- where i need it. Much better than HAML (or ERB, or...).

I never liked Ruby's ORM. I just dont like ORMs. So I wrap functions over SQL statements that are strings. I do my SQL interpolation with Jdbi. Works very well, and, no ORM.

The test suite runs really fast and tests with a live db. I test that all SQL statements still work (one test per SQL statement; with a non-empty result to ensure the row decoding works).

All libraries (JARs) together amount to 11MB. That's all! I really like little libraries. As a reference SpringBoot (java's Rails) or Hibernate (java's ActiveRecord) require at least 15MB each!

Overall I'm happier here than with Rails. I just like static typing more nowadays, and prefer a "bunch of libs stringed together for my project" over a "framework".

I really appreciate Rails and DHH's approach though: I learned a lot about web development by using it (and Rack, and Merb). Much more than from Django or PHP or JSP/etc. But I'm okay with having moved on.