I may sounds weird but Ruby is what make me look more into functional programming. I get done a lot with Ruby due to all method it has on Array/Object/Enumerable. The beauty of `&` is awesome and I discover that Elixir/Clojure has that and bring it to next level. I think Ruby has inspired many other language to take that path too. One of the thing about Ruby is that it optimize for happiness, which sound weird. But I…
*> 10.seconds.from_now* I don't understand this kind of weird "urban sprawl OOP" where classes are extended with anything. Why is 'seconds' a method on numbers? Is there also a 'pixels' method so that I could draw a line like this: 10.pixels.from.top_left_corner.to.southeast.using.red.stroke If this doesn't seem like a sensible way of programming graphics, why does the 10.seconds thing get a pass?
From Rails to Clojure, Then to Java, Then Back to Rails
121–130 of 157 posts
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#122Re: From Rails to Clojure, Then to Java, Then Back to Rails
#123I'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
#124Earlier quoted context omitted.
As well as services, a couple of other folders you might want in app are for decorators and form objects. Form objects aren’t very common, but I’ve found it to be a really great patten for simplifying code. Strong params and ActiveRecord methods are fine for simple updates, but as soon as you get to something more complicated (e.g. what if you want validations to apply only for certain users?) it just becomes a mess…
Awesome, the form pattern is a useful one. My coworker and I were just talking about how frustrating it was to have validations coupled so tightly to the models and this would have helped a lot. Thanks!
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#125Earlier quoted context omitted.
to me lisp is its own problem, its value is that it gives you too much it becomes anti social. Society likes ignorance and delegation, lisps gives you the ability to have everything into one atom and mold it as you need it. But that's only useful for 1) people with that kind of mindset 2) hard problems that fall off mainstream/commercial support
Like Autolisp? Autocad (and its clones) of software used by zillions of designer, architects, ... extened by zillions of Lisp programs.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#126In 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.
Yes - Ruby makes it easy. I'm run into the downside, though, that Ruby isn't optimized for immutable operations - tons of object instances created. I've needed to 'pythonize' my Ruby code in the worst cases - using mutable functions to dramatically reduce memory usage.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#127Earlier quoted context omitted.
It's because we don't like or approve of rails. It doesn't make business sense to us (us being a completely anecdotal group of young developers I'm friends with). There are other solutions that provide sufficiently more developer speed and safety, while also providing much better performance than any rails application. Edit: I guess I just hang out with like minded people, but our biases shouldn't negate the fact tha…
What other solutions are you youngsters using then? Elixir/Phoenix? Django/Python? Node? Haskell?
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#128Earlier quoted context omitted.
Except if you're using immutable data, pure functions and explicit state there's a lot less room for OO which (as presented by ruby, java etc) involves mutable data accessed/changed via methods that conceal their state.
Nothing in the concept of OO enforces mutability. The paradigm doesn't enforce anything at all there. You want immutable objects that never changes once created? Fine, go for it.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#129Earlier quoted context omitted.
As well as services, a couple of other folders you might want in app are for decorators and form objects. Form objects aren’t very common, but I’ve found it to be a really great patten for simplifying code. Strong params and ActiveRecord methods are fine for simple updates, but as soon as you get to something more complicated (e.g. what if you want validations to apply only for certain users?) it just becomes a mess…
Awesome, the form pattern is a useful one. My coworker and I were just talking about how frustrating it was to have validations coupled so tightly to the models and this would have helped a lot. Thanks!
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#130Years of Clojure has made me a dramatically better Rails programmer. The biggest change for me is that I now treat ActiveRecord models as gloried hashes with easy-access to a namespace of related functions (ie. methods) that operate on all manner of underspecified partial data, rather than traditional OOP-style objects with sophisticated invariants. I'm also very careful to strictly separate reads from writes, and to…