Earlier quoted context omitted.
It looks nice, but then again: irb(main):002:0> 10.methods.count => 133 Oh well...
What's wrong with this? What is your expecation?
From Rails to Clojure, Then to Java, Then Back to Rails
141–150 of 157 posts
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#142Earlier quoted context omitted.
> Community feels like the good old Ruby days, but better I really miss that old Ruby community. It was full of that hacker spirit, everyone trying stuff, no one to crush your creativity. Then the startup hipsters took over and came up with good practices, style guides, gems you absolutely had to know to get hired, etc. It drove me away from Ruby, actually. It just wasn't fun anymore. I hope it doesn't happen with Ru…
Your comment really speaks to me. I'm in the process of transitioning my career out of development altogether for the reason you mentioned getting out of Ruby. It just isn't fun anymore. I haven't been able to find a company with a good hacker-spirit since 2010. I like programming, and will probably continue with languages like Elixir and Haskell, but as far as the day-to-day work goes, I'm done.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#143Earlier quoted context omitted.
There is absolutely a benefit to lazy if you're doing more than one combinator even if you ultimately need to iterate over the whole list such as the join case. The lazy version basically turns into a = "" (1..1000).each { |i| next if i.odd? i *= 2 i += 1 a Where as the non lazy version turns into: odds = [] (1..1000).each { |i| odds Which means that you have you went from N iterations to 5*N iterations, with 5 inter…
That's how it could work theoretically, but in practice lazy iterators are much less efficient due to their implementation. I benchmarked it here: https://gist.github.com/mboeh/bb480d93c71046e23816f2c24c23e3... When applied to the same amount of work, lazy iterators consume more memory and take more CPU time than the equivalent non-lazy chained iteration. There's a place for lazy iterators, but you should pretty much…
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#144Earlier 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.
Its not about what is possible, we're all familiar with the turing completeness of everything. It's about what is: the default + easy + encouraged in the ecosystem.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#145Earlier quoted context omitted.
It's not just 'anything' that objects are extended with in Ruby, they are extended with suitable methods pertaining to the domain at hand. 'seconds' is a conversion method of one type into another. You might as well ask why do objects have a 'toString' method. Because it is convenient.
Why does one conversion method have the “to” prefix and the other doesn’t? I guess because the inconsistency looks somehow prettier. But this is what drives me up the wall with the Ruby ecosystem: seems that whenever API designers had the choice between consistency and fun gimmick, they chose the latter. It makes some people feel happy, but often makes the next person who has to read and maintain the code miserable.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#146I'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…
Same here. It's really hard for me now at my day job when I have to write OO. Clojure and functional languages opened up my eyes to OO shortcomings I've been trying to work out for over twenty years. Since I started, I've always felt that there were many things not right about OO and developing using these giant frameworks with so many useless abstractions has gotten old and tiring. Most of my time is spent working a…
Even in my local area (not a tech hub), I'm aware of one small software shop using Clojure, and they have no trouble finding people.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#147Earlier quoted context omitted.
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.
Can you say more about this Pythonisation process? How is Python any better at immutable operations? Ruby and Python are both OO languages which can be used in a procedural style. Hell, you can write a whole app in Ruby without creating a single class if you so choose.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#148Earlier quoted context omitted.
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…
It's only optional though. You can use (list 1 2 3), (vector 1 2 3), (hash-map 1 2 3 4), and (fn [x] (inc x)).
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#149Earlier quoted context omitted.
While I much prefer writing Ruby to Python, Python is just dead simple to get real work done with. It's not elegant, but it's still so much less nasty than C++ or Java. Ruby's #1 problem, for me at least, is that your small project someday runs into a performance wall. I don't know the latest benchmarks, but last I recall Python was about 8x faster than Ruby when both are being interpreted. Yes, there's JRuby, but th…
Say what? Ruby has been faster than Python for interpreted code for years now. Granted, Python is faster for tasks like those Numpy solves, but in arbitrary execution performance, python is just slower. 8x has NEVER been true. That must have been you doing some really bad stuff in one of them but not both.
For sure, Ruby was slow for what we were doing... processing millions of rows of data was so slow that it caused me to decide to try Go (and the same Go program was hundreds of times faster). But I didn't try Python then.
Re: From Rails to Clojure, Then to Java, Then Back to Rails
#150Earlier quoted context omitted.
This definitely feels my own golden age now being able to write Rust and seeing all these great people doing interesting projects and hacking things...
The ecosystem and the community is fantastic. But I have to say, Rust is a harsh mistress. Guess I need more practise.