tl;dr: I found out I like parentheses and want more of them in my life.
----
It bewilders me that it was only a few years ago (late 2010) that I asked this very subforum what languages I should pursue to build an app idea that I had. After extensively dabbling in PHP, Python, and Ruby, I went with Ruby and then Rails in particular.
Since then, I've come a long way. I landed my first and current Rails job last year.
But I've learn even more in the past few months. I've been consuming a lot of programming literature from people like Martin Odersky (Scala creator), Rich Hickey (Clojure creator), Sandi Metz (OO Design), and those respective communities.
----
Stumbling upon functional programming via Odersky's Coursera course on Scala was my initial eye-opening encounter.
In particular, it was the first time I encountered the concept of "immutability". And it was there that I realized that mutation is perhaps the #1 culprit of unreadable, unintelligible code that I run into on a daily basis.
How often do we run into the following example?
@x = 10
do_something()
@x == 10 # false. @x is now 42. how? *magic*
Every day.
@x is mutated somewhere. do_something() has side-effects that we now have to hunt down. Our mental stack grows another few layers and with every layer we risk an overflow.
do_something() probably calls methods and those methods probably have more side-effects in store for us and now we're playing a game of Blue's Clues in our codebase grepping for /@x/ just to see what the actual fuck is going on.
----
I first looked for providence in Scala. It felt like Ruby. Lisp's parentheses looked annoying so I initially ruled Clojure out. Haskell just didn't feel right.
But I had a lot of trouble setting up Scala with sbt. I hated Eclipse/Idea. And Vim is not a good tool for a compiled language when you're just exploring a new paradigm.
But recently I gave Clojure another look and this line in particular stuck out at me in its rationale:
I started watching a some Rich Hickey talks starting with his famous Simplicity Made Easy. He even gave that talk at Railsconf last year where he expressed Easy != Simple.
That's where I realized my problem with nontrivial Rails apps: Rails makes things easy. `gem install hairball` makes things easy. It's easy to accrue technical debt. Instead, it should be simplicity that's on the pedestal.
----
I've been using Vim for 3 years. After trying Clojure in Vim, Eclipse, LightTable, and Idea, I ended up trying Emacs + Evil mode (Vim bindings) less than a week ago.
Pure bliss.
I've found a community that helped me vocalize my main frustration with code and I realize that immutable Lisp expressions truly allow you to compose large concepts with small functional operations.
----
I've been playing with Clojure for a short while but it's already made me a much better Ruby programmer. I look forward to the next few years and the novel a-ha moments I will have.
----
And, most importantly, I'm now an unbiased Emacs/Vim warrior. :love-smiley-086:
Sent from my Emacs buffer.
----
It bewilders me that it was only a few years ago (late 2010) that I asked this very subforum what languages I should pursue to build an app idea that I had. After extensively dabbling in PHP, Python, and Ruby, I went with Ruby and then Rails in particular.
Since then, I've come a long way. I landed my first and current Rails job last year.
But I've learn even more in the past few months. I've been consuming a lot of programming literature from people like Martin Odersky (Scala creator), Rich Hickey (Clojure creator), Sandi Metz (OO Design), and those respective communities.
----
Stumbling upon functional programming via Odersky's Coursera course on Scala was my initial eye-opening encounter.
In particular, it was the first time I encountered the concept of "immutability". And it was there that I realized that mutation is perhaps the #1 culprit of unreadable, unintelligible code that I run into on a daily basis.
How often do we run into the following example?
@x = 10
do_something()
@x == 10 # false. @x is now 42. how? *magic*
Every day.
@x is mutated somewhere. do_something() has side-effects that we now have to hunt down. Our mental stack grows another few layers and with every layer we risk an overflow.
do_something() probably calls methods and those methods probably have more side-effects in store for us and now we're playing a game of Blue's Clues in our codebase grepping for /@x/ just to see what the actual fuck is going on.
----
I first looked for providence in Scala. It felt like Ruby. Lisp's parentheses looked annoying so I initially ruled Clojure out. Haskell just didn't feel right.
But I had a lot of trouble setting up Scala with sbt. I hated Eclipse/Idea. And Vim is not a good tool for a compiled language when you're just exploring a new paradigm.
But recently I gave Clojure another look and this line in particular stuck out at me in its rationale:
That's where I connected with the entire spirit of Clojure.Mutable stateful objects are the new spaghetti code
I started watching a some Rich Hickey talks starting with his famous Simplicity Made Easy. He even gave that talk at Railsconf last year where he expressed Easy != Simple.
That's where I realized my problem with nontrivial Rails apps: Rails makes things easy. `gem install hairball` makes things easy. It's easy to accrue technical debt. Instead, it should be simplicity that's on the pedestal.
----
I've been using Vim for 3 years. After trying Clojure in Vim, Eclipse, LightTable, and Idea, I ended up trying Emacs + Evil mode (Vim bindings) less than a week ago.
Pure bliss.
I've found a community that helped me vocalize my main frustration with code and I realize that immutable Lisp expressions truly allow you to compose large concepts with small functional operations.
----
I've been playing with Clojure for a short while but it's already made me a much better Ruby programmer. I look forward to the next few years and the novel a-ha moments I will have.
----
And, most importantly, I'm now an unbiased Emacs/Vim warrior. :love-smiley-086:
Sent from my Emacs buffer.