top | item 14928694

(no title)

cderwin | 8 years ago

If "expanding your brain" is really what we want to optimize, why not learn Haskell? Or for that matter, why not learn something even more strongly typed, like Agda or Idris? Or even a theorem prover like Lean?

Most of the reasons the author presents would either be expanded in one of those languages, or is immaterial to the goal of maximizing learning. After reading the article I have no more reason to consider learning Clojure over learning any of the languages above.

discuss

order

yogthos|8 years ago

One huge difference is the workflow you have in Clojure. REPL driven development is an experience unique to Lisps. When you're working with Clojure, any code can be run in the context of the live app straight from the editor as you write it. This is an amazing experience and very mind expanding in what a development process can look like.

Also, anybody who wants to try FP style programming, but isn't interested in static typing is much better off with Clojure. Type systems in languages like Haskell and Idris add a lot of complexity and mental overhead that's not present in a dynamic language.

Arcsech|8 years ago

I don't think that's entirely unique to Lisps, you can get a REPL into an existing Erlang instance very easily. More easily than getting nREPL running in Clojure, actually. I believe Smalltalk as well, although I'm less confident on that one as I haven't used it much.

justinhj|8 years ago

I work in Scala and it has live code update, interactive worksheets and a repl.

As for type systems increasing complexity I think that depends on the application. As a beginner to Clojure I would pass unstructured data around all over the place and then have the mental overhead of trying to remember the structure or fix it all at runtime.

drawnwren|8 years ago

Is there something about clj's repl that makes it any different from ghci's?

vertex-four|8 years ago

The type system is only one part of a programming language. You can, quite reasonably, have two languages with exactly the same type system that wind up with vastly different ways of programming them due to what you're given as primitives/the standard library.

Programs aren't usually directly portable between languages primarily for that reason - the language designers optimise for a specific way they want their language to be used, then everyone else follows, and eventually you're going against an entire ecosystem if you want to do something different.

dabei|8 years ago

Absolutely agree. However there is a "perfect language" for every programmer to learn, depending on their background and spare bandwidth. For many programmers the jump from their primary language to Haskell or others is too high, not only in terms of complexity but also utility. Several colleagues of mine are picking up new languages right now and a common criteria is they want to build something tangible/useful within a limited time. Having access to the JVM and third party libraries they already know is certainly a plus.

didibus|8 years ago

All the languages you've mentioned will also expand your brain, but in a different direction, mostly related to correctness and provability of specifications.

Clojure will expand it in different ways. Here's some examples:

  - Interactive programming
  - Persistent data structures
  - Immutability
  - Code that writes code
  - Functional programming 
  - Extendable polymorphism
  - Lazy evaluation
  - Eager evaluation
  - Parallel computing
  - Dynamic variable extent
  - Recursion
  - Concurrent programming
  - Declarative programming
  - Aspect oriented programming
  - Logic programming
  - Code as data
  - Software transactional memory
  - Generative testing
  - Contracts guards
  - Optional type systems
  - Conditional restarts
  - Monads
  - Variant types
  - Collection abstractions
  - Array programming
  - Map Reduce
  - List comprehensions
  - Reactive programming
  - And more...

ohyes|8 years ago

They're not lisps, and do not have proper macros.

taktoa|8 years ago

What's "improper" about Template Haskell, other than the easily-avoided phase restriction?

weavejester|8 years ago

I think people should learn both Haskell and Clojure :). However, while Haskell is very obvious in its differences with more commonly used languages, I feel that Clojure is more subtle.

I felt like an idiot while I was learning Haskell; but in Clojure I only realised my idiocy after perhaps a year of working in it. Clojure feels deceptively close to more standard languages, but in its own way is as different to them as Haskell. It just isn't as immediately obvious.

peatmoss|8 years ago

Or Typed Racket if one wants typing and lisp. I don't know how core.typed compares to typed Racket, but that might also be enough to get the flavor of types?