The articles touches on this but just to reiterate because it's worth saying: The most important thing about Rails is knowing how the internals work and maintaining a clean code architecture. Too many times have I seen a mess in Rails because developers only use the APIs and DSLs given to them. The best Rails codebases are the ones who have ample "vanilla" Ruby and just happen to use Rails alongside said Ruby.
Really interesting comment. I've started working on a Rails project. I don't have any professional experience with Rails in particular. Can you recommend any code bases I can read that meet these criteria?
From Rails to Clojure, Then to Java, Then Back to Rails
71–80 of 157 posts
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#72In the "things learned from Ruby" section: Focus on strong object oriented programming What I've learned from Ruby is to favor functional programming concepts - minimize side effects, isolate state mutation, etc. Ruby is definitely OO, but when my Ruby code is more functional it's less buggy, easier to understand and move around, and generally less convoluted.
As someone stated, good OO and good functional is approaching the same goal from different sides. Your code being functional doesn't really make it less OO.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#73Clojure does not have an alien syntax. As with Lisps in general, it has almost no syntax. (operator param param ...) Done.
It has much more syntax than any other Lisp I know, and it seems alien even coming from Common Lisp. In addition to the usual (list) and 'quote and `backtick and :keyword and ;comment, it has [vector] and {map} and #{set} and #(function) and @deref and #"regex" and ^metadata and #?(:conditional) and ... (Yes, several of those are implemented as reader macros. I don't see how that would make them any easier to learn t…
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#74I've tried a lot of different languages over the years including Ruby, Go, Scala, and Haskell. Ruby actually isn't too bad if you don't use Rails. Between Rails and stuff like Spring over in Java-land I've developed a strong hatred of huge frameworks :) Clojure, however, is the one language that just 'clicked' for me almost immediately. In fact, I'm pretty certain I'll be sticking to Lisps as much as possible from he…
What libraries do you use for building web stuff? Over on Reddit[0] one of the problems for newbies to Clojure is not knowing what to use for web development. https://www.reddit.com/r/Clojure/comments/858g9z/what_clojur...
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#75I've tried a lot of different languages over the years including Ruby, Go, Scala, and Haskell. Ruby actually isn't too bad if you don't use Rails. Between Rails and stuff like Spring over in Java-land I've developed a strong hatred of huge frameworks :) Clojure, however, is the one language that just 'clicked' for me almost immediately. In fact, I'm pretty certain I'll be sticking to Lisps as much as possible from he…
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#76Another thing I’m getting is that the new kids won’t like rails, and it’s being harder to hire. I'm surprised by this, to me the language used would be a long way down the list when evaluating an employer.
I don't think it's that newcomers won't like Rails. I feel it just makes sense to go all Javascript instead since that's where the momentum is now and doing everything in one language has a lot of benefits especially when it's something as ubiquitous as javascript.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#77Earlier quoted context omitted.
re-frame is the uncrowned king of web dev at the moment, there is nothing like it out there
That's only for the front end though. Lots of people use Compojure which is essentially Sinatra if you're coming from Ruby. Luminus is a far more complete solution that feels like Rails. After I cut my teeth enough times starting from nothing, Luminus unfortunately feels a little clunky because you have to figure out how it's all glued together.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#78Earlier quoted context omitted.
Isn’t there something called LazyEnumerator that deals with this? In terms of chained .map at least
Lazy enumerators don't make each individual step of the iteration any more efficient. They just let you stop the iteration partway through without traversing the entire original enumerable. Given this contrived example: a = (1..1000).lazy.select(&:even?).map{|i| i*2 }.map{|i| i + 1 }.map(&:to_s).map(&:reverse) There is no benefit from lazy if you do `a.join(",")`, since that iterates over the entire sequence. But if…
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#79This is a bit odd, that concurrency would be listed as something they gained from Java, rather than Clojure: " Clojure: considering the difference between being easy and being simple. Clear difference between data and logic that changes that data. Distinction between pure functions and functions with side effects, try to separate them. Let’s try to make simple code by default. " " Java: performance, concurrency and s…
Of course, idiomatic Clojure might require less mindshare to make highly performant, concurrent code...
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#80I've tried a lot of different languages over the years including Ruby, Go, Scala, and Haskell. Ruby actually isn't too bad if you don't use Rails. Between Rails and stuff like Spring over in Java-land I've developed a strong hatred of huge frameworks :) Clojure, however, is the one language that just 'clicked' for me almost immediately. In fact, I'm pretty certain I'll be sticking to Lisps as much as possible from he…
I'm agree with you as well except the Rails point. I have used and deploy Go/Elixir/Clojure to some certain success. One thing I feel is that no code is as beautiful as Ruby code to my own eye. What make Rails bad in your opinion? Is its performance? I think Rails is just a framework with many utility/helper to help you out.
Every framework has its downsides. Personally I think rails is nice (I am very productive with it).