4 ms·
Try once more. Pick a small project and just try and try again until you get it written. Tip #1 - spend more time in the repl than in the editor. The repl le
by blunte 9y ago
Try once more. Pick a small project and just try and try again until you get it written.
Tip #1 - spend more time in the repl than in the editor. The repl lets you figure out and grok the small things.
Tip #2 - compose the small things into bigger things. (And if you find yourself composing too many semi-complex expressions into on big expression, feel free to take any smaller grouping of expressions and turn them into a function.
You may start out very disoriented; but if you keep trying, at some point after trying (perhaps for a few evenings, consistently) it will just suddenly click. It's a wonderful feeling to suddenly get it.
One last tip - Everything is really just this pattern: open paren, operator, some number of parameters/data, close paren. I'm not a Lisp teacher, so I may be stating this inaccurately, but it's just that simple. The pieces may look like more than what I just described, but they are really that simple.
And on the topic of "too many parens", compared to Javascript, C/C++, Java and many other languages, you'll find about the same number of them. They're just arranged differently (and more uniformly in Lisp). Better yet, because they're so uniform, you can completely ignore/forget about the end of big expressions with their )))). Ignore it. Use an editor that matches braces, (I like rainbow color matching).
And now, a warning. If you take the time to really learn Clojure, there's a good chance you'll love it. Then you will find that in most companies, you won't be able to use it unless you sneak it in. Then you'll end up in Elixir because it "looks like" Ruby, and because everyone bought into Rails. But you'll still wish you were using Clojure.
- TeMPOraL 9y ago> And on the topic of "too many parens", compared to Javascript, C/C++, Java and many other languages, you'll find about the same number of them. Exactly. Even more, if you start counting {}, <> and []... Also, before someone says "but prefix notation!", all mainstream languages are prefix too everywhere except math. That is, frob(barify(foo, bar)) is prefix notation, and equivalent Lisp is achieved by just shifting the opening paren to the left of the operator name (and dropping commas, thanks to the uniform syntax): (frob (barify foo bar))
- cutler 9y agoAdoption of Elixir is no higher than Clojure. Slightly lower, I'd say. The bigger danger of loving Clojure is going back to working with OOP. Clojure can seriously damage your tolerance for OOP and in today's job market that's a real handicap.
- blunte 9y agoFor me, Elixir is a way to do Rails-like web development with much better runtime performance, plus the big bonus of functional programming. And because Rails was such a success (I still get recruiter spam constantly for Rails positions, even after 10 years), I think Phoenix+Elixir will gradually come out on top. It's just a shame that I fell in love with the Lispiness of Clojure. Do...End...sigh.
- cutler 9y agoBeyond the superficial syntax similarities how can developing in a functional language possibly be Rails-like? Mutable OO and immutable FP are opposite ends of the spectrum. I never bought this Elixir for Rubyists sales pitch. Phoenix does't even use an ORM. That said, I really like Phoenix. I too get a lot of Rails spam from recruiters which I find hard to fathom since Rails usage is on the decline. What's your take on this? Is it that Rails shops will only settle for senior developers?
- blunte 9y agoSyntax similarity probably reduces the "fear of new" (different) that prevents some people from making the transition. But the biggest factor is that the creator of Elixir, José Valim, is a well respected Rails contributor. But indeed, Elixir is so different from Ruby that one doesn't just casually move to it from Ruby without learning to think functionally. To your question about Rails, I'm not sure I can say whether it's in decline or not. But I do know that many hiring managers are not technical enough to know what's important, so they try to replace exiting employees with people who have the same skills. And probably there are one or more Rails apps that still need dev/maintenance. As far as money goes, Rails is still a very lucrative career focus, at least in the US.