3 ms·
> My belief though is that there is some peace of mind that comes from the > idea of what you might call "page composition" -- that this piece of data
by danneu 13y ago
> My belief though is that there is some peace of mind that comes from the
> idea of what you might call "page composition" -- that this piece of data
> sits in this template, that it rides on top of this simple model, that it
> is in ORM from database. There is a huge amount of linearity and convention
> throughout the stack and because of the dynamic nature of Ruby lots of gems
> can be sprinkled throughout without one really understanding what they do.
Actually, the problem with OO and my experience with Rails is this linearity quickly becomes a web where deriving the sequence of events encompasses more and more of your time as the project grows.
Objects call objects across the system and change the state of each other without care. Making a trivial change involves unrolling this web every time.
And that's why I think you have this backwards:
> Now, I'm certain this level of abstraction and functional/mixin kindof stuff can be
> achieved in a Clojure framework but I think it is generally perceived as being a bit
> more non-linear and DIY (libraries not necessarily playing nicely together). As in
> "yes I can get all of these pieces together but then if down the line I have to change
> this piece, how will I accomplish it without breaking everything".
`require`ing a Ruby gem is as non-linear as you can get. It's global with no entry-point. A gem's presence and effects are not obvious. They're often configured with some mutation like:
MyGem.config do |c|
c.key = "secret"
end
Meanwhile, it's obvious when a namespace of Clojure functions is included. And since they're just functions, they're trivial to compose. Completely different experience from what I was used to in Ruby.
- fat0wl 13y agothanks for your input. I see what you're saying about the Closure namespaces and function system making more sense. That's what has been attracting me toward it, along with some general fondness for the elegance of Clojure. I feel you whole-heartedly about the tangled web of OO. That's why I ultimately chose to leave Rails & start pursuing JVM languages. JVM languages seem to be daunting to Rails/Django folks because of all the "boilerplate, syntax, complexity" but I've found that a lot of the tools are so mature that it is not really such a burden. So yes, as an aspiring programmer who wants to have a reach beyond CRUD, the mystery of Rails & it's "fugly" libs eventually turned me off. Aside from things breaking/slowingdown with every version and needing excessive optimization not to accumulate at the interpreter, I came to the realization that the extra time that would be needed to understand more technologies for the different layers of the application (with Java.... Spring/Hibernate/etc.) there is a gain in that well... you actually understand what is going on rather than this tangled mess. I often had to re-factor code in Rails to kindof fit awkwardly between gems. From studying Javascript I learned a lot about asynchronous/aspect-oriented programming and am pleased to see that these concurrency issues are fundamental to most work that is happening on the JVM. I thought Scala/Play was a healthy medium between these two worlds but I'm starting to understand that maybe one needn't compromise.