Live data from Hacker News

From Rails to Clojure, Then to Java, Then Back to Rails

engineering-management.space

41–50 of 157 posts

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#41
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.

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#43
post #40

Earlier quoted context omitted.

Judging by listings in the month jobs posting, the vast majority of hiring companies won't look at you if you don't have immediate and long experience with their current tech stack.

Back in my late 20s, I got stuck on maintaining a legacy software system written in Ada95 (I was unemployed in 2008 and it was the only work I could find). When that job went away, I thought I could get a job using something more modern. However, the only job I was able to land was a new development project in Ada2005 (actually it was a port from SPARC to x64 and a partial rewrite of the same legacy application I had…

Ha, I was somewhat in the same position, my first job out of college was working for a NASA contractor using Ada. I programmed on the side using C for fun and was able to find a startup to take a chance on me after a few years.

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#44
As a hiring manager, I now look for at least two languages, and they don't need to be the tech stack we're currently using. If you're a good developer, and you know more than one language, you understand that picking up another is not an insurmountable barrier. You'll pick up our stack soon enough.

What I need to know is if you can think critically, not if you already know what we plan to teach.

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#45
post #16

Earlier quoted context omitted.

Ruby used functionally is great, but it takes an already time-inefficient language and amplifies that weakness (lots of creating new collections and returning them, whereas normally in Ruby you would modify elements within the collection).

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 you do `a.take(10)` or `a.detect{|s| s == "14" }`, the chain will only be executed for each item in turn until 10 elements are produced or an element is the string "14", respectively.

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#46
post #36

Earlier quoted context omitted.

Not OP but in my limited experience the MVP slot is mostly held by Django, with Node + typescript, Go and Elixir being the “safer, faster” variants “kids” are using.

Ha it's funny seeing Django in that list because back in day (10 years ago or so) before rails took over I was trying to get everyone to use Django at my job. Then rails exploded and I moved to that. I honestly thought Django was mostly dead now.

Anecdotally Django seems less common in the job listing post every month than Rails but is still present, and the python experience is relevant to many more.

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#47
post #33

Earlier quoted context omitted.

Ruby is still a beautiful language, particularly for its object oriented-ness. And I think Ruby's nature, simplicity and power appeals to young people, however the resurgence of a towering Javascript/NodeJS is hard compete with. These are market forces that really matter when you're wondering what language & platform to use for your MVP. In recent surveys, Ruby & Rails has fallen to the bottom of the list among the f…

Ruby also suffers from top quality JITs vs what JS has. The only good option being JRuby, as far as I understand. I am not at all into Ruby. Regarding being polyglot and seniority, a possible solution is to work for consulting companies that focus on multiple stacks.

Most of the time you're not using JRuby for the JIT but for threads and/or to fit into some Tomcat/other Java environment. JRuby isn't exactly fast.

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#48
post #3

In 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.

Like Gary Bernhardt's notion of a "Functional Core, Imperative Shell" — https://www.destroyallsoftware.com/screencasts/catalog/funct...

Damn, I knew I got this idea from somewhere, I just totally forgot where. Thanks for posting this link - I'll have to rewatch it.

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#49
post #30
post #18

Clojure 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…

True, but i don't have to remember 5 different map implementations either :)

Re: From Rails to Clojure, Then to Java, Then Back to Rails

#50
post #34

I'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...

Post reply on HN