Live data from Hacker News

Clojure will affect the way you think about programming

eli.thegreenplace.net

61–70 of 226 posts

Re: Clojure will affect the way you think about programming

#62
post #26

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

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?

Re: Clojure will affect the way you think about programming

#63
post #27

Having spent some time programming in Clojure, for the purpose of expanding my brain, I suspect a better Lisp to start with might be one of the classics - Racket, Common Lisp, etc... One of the reasons I gave up on Clojure was the lack of documentation of libraries, the bad debugging experience (those stack traces!) and the fact that there's no avoiding the JVM. They're all distractions to the learning (that was 2 ye…

Agreed. Debugging Clojure(Script) is a pain. Although I still need to use ClojureScript.

I had a similar experience, trying to learn clj/cljs before I know java, javascript or the web stack. I am a classic arrogant developer (I'll learn it all at once as I go) but in retrospect it was honestly a mistake. If I'd learned basic web servers+node+react/redux then Clojure I'd know more of both than doing it in reverse.

Re: Clojure will affect the way you think about programming

#64

I'm an EE who is getting more and more interested in software development and computation in general. I've been reading Paul Graham and Peter Norvig and decided to learn Scheme. Any thoughts on Scheme vs. Clojure for learning?

Scheme is a smaller language and has legendary beginner books. Start with HTDP and then SICP.

Seconding HtDP. I have gotten lots of mileage from that one.

Re: Clojure will affect the way you think about programming

#65
I don't like working with clojure.

Its basically modern perl. I've worked with both professionally, and the outstanding point with both has been:

- programmers try to be clever in their code, write one giant file full of complicated specialized 'beautiful' code, forget everything they know about breaking big tasks into simple small ones.

- code is a nightmare to maintain for non-author

- non-authors working on code results in adhoc mess of styles

Play with, sure. Learn a few things and watch the videos, absolutely. Rich is a really thoughtful talker. I actually quite enjoyed clojure before I had to collaborate on a code base.

...but goodness me. I cannot strongly enough recommend against using it professionally.

Re: Clojure will affect the way you think about programming

#66
post #32

Earlier quoted context omitted.

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

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.

The biggest difference is the editor integration. Scala, like most languages has a REPL that's basically a toy you use on the side. Clojure REPL is tightly integrated into your workflow.

I did a talk last year where I illustrate it starting around 15 minute mark https://www.youtube.com/watch?v=nItR5rwP4mY

I'm not aware of any non-Lisp languages that provide anything close to that.

The REPL driven workflow directly addresses the problem you're describing as well. When I'm working with Clojure, I never write a lot of code before running it. Each time I write a function, I run it and see exactly what it's doing. This means that I never have to keep a lot of context in my head.

Let's say I need to pull some data from the database, massage it, and return it to the client. I would write the function to read the data, run it to see what shape of the data I get. Then, I would write the function that consumes that data and transforms it. Again, I'd run it and see that I have the data I want, and so on. At each step of the process I only need to consider the last step and the next.

Also, Spec and Schema are commonly used in libraries to provide the description of the data at the API level. This is where I really care what the shape of the data is, as opposed to typing every single function I write.

Re: Clojure will affect the way you think about programming

#67
post #46
post #32

Earlier quoted context omitted.

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

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.

The difference is in the editor integration. When you work with Lisp, your editor is connected to the running instance of the application. You have shortcuts to reload any symbol in the application at runtime directly from the editor.

Re: Clojure will affect the way you think about programming

#68
post #38
post #20

Clojure is the language where LISP clicked for me. Can't recommend it enough, it's got all of it - immutable datastructures, convenient data literals, simple and composable concurrency primitives, very thin interface to host VM. Just put enough effort to get beyond that "omg parenthesis" barrier and it will be a delight. It's like that Half-life joke: there are two kinds of people, those that finished Half-life many…

I've learned to love the parentheses, because they embody what is so nice about lisps (and particularly Clojure)--inside the parentheses is a little nugget of functionality that generally stands on its own. No syntactic tricks, the only "trick" is the macro system, but it's so straightforward that I'm not sure I'd call it a "trick". The other immediate barrier is when Clojure barfs an ugly stack trace. I've heard tha…

hmm sexy idea to have spec help for stacktrace. I expect something cute like elm error messages.

About the parens, it's true it's one great thing, every construct has a value [1].

It's funny because You hear about object orientation where things are uncoupled and standalone yet the language isn't this way. Lisp has this, it's the incarnation of its own idea. But it looks silly if you're in it for the syntactic appeal.

[1] Although I often wish for a helper thing when evaluating the body of, say a let to grab the bindings instead of saying "unknown var a in (inc a)". This is lisp in general

Re: Clojure will affect the way you think about programming

#69

I don't like working with clojure. Its basically modern perl. I've worked with both professionally, and the outstanding point with both has been: - programmers try to be clever in their code, write one giant file full of complicated specialized 'beautiful' code, forget everything they know about breaking big tasks into simple small ones. - code is a nightmare to maintain for non-author - non-authors working on code r…

> - programmers try to be clever in their code, write one giant file full of complicated specialized 'beautiful' code, forget everything they know about breaking big tasks into simple small ones.

What on earth does this have to do with clojure? Programmers will do this in any language, there's nothing special about clojure here.

I personally don't find LISP languages to be the most readable, but I'm fairly sure it's subjective. If you learned LISP and then went to Java, your brain would probably struggle to process all the verbosity...

Re: Clojure will affect the way you think about programming

#70
post #28

Why not Common Lisp or Scheme?

I wonder the same. And the author writes:

>"and Clojure is the first Lisp I'd consider using in production".

I can't really understand the logic in this. If anything, CL has more going for it for production​ usage, like ANSI standarization and many high-performance compilers.

Post reply on HN