Live data from Hacker News

How much can a Clojure developer do alone?

yyhh.org

21–30 of 106 posts

Re: How much can a Clojure developer do alone?

#21

Because Clojure is not terribly fashionable, I imagine the developer pool is much smaller but the candidates are higher quality, mostly due to self-selecting. I really like the sentiment of empowering individual developers to the max. It's funny, a lot of organizations want to beat the averages whilst engineering in an identical fashion to their competitors. You're not going to consistently get outstanding results if…

>You're not going to consistently get outstanding results if you do the same thing as everyone else.

I think the tools matter a lot less than the people using them, and that programmers who perform above replacement level are rarer than is often discussed. I would take a great programmer writing the app in Java to a bad programmer writing the app in Clojure every day of the week.

Re: How much can a Clojure developer do alone?

#22
post #4

> There is no other language that places such an emphasis on programming directly with plain and naked data literals. Counterexamples: Erlang and Elixir. Arguably also Prolog. Also Lua. Many Schemes, and Racket. Of course, REBOL and Red. TCL probably, too. I can't help but think that people making claims of "no other language has X" are in most cases wrong, and should study a bit more before making them. There's a lo…

I think it goes further than the language's support of data literals to the culture of the language itself. The Clojure community takes programing with data literals to, what I would call, a pathological extreme. It's as if nobody wants to write actual code, just data structures to be interpreted, regardless of how general those data structures are. The problem is everybody gets hung up on code is data but doesn't re…

You are contradicting what your parent post is saying and agreeing with the OP. So you agree that Clojure is the most data-oriented programming language, but you feel like it is too extreme?

Re: How much can a Clojure developer do alone?

#23
post #7

The description here of using the Clojure REPL for development is one of the best I've seen. I think part of the issue is nomenclature -- Read Eval Print Loop applies to lots of systems in lots of languages that many devs are familiar with that are not really what Clojure devs mean when they say "REPL." The actual experience is closer to something like Smalltalk where you alter a running system and experiment with it…

I guess I need to watch some of the videos he links, because this sounds horrible to me.

I mostly work in Python, which has a repl (though I'm sure not as complete) and sometimes I poke around in it. But if I am working on a real project, or even just a small script, I always want to run it from the beginning on every invocation, because anything short of that is not proof that it works.

"Editing a running system" sounds like a nightmare! How could you ever know things would actually work?!

Re: How much can a Clojure developer do alone?

#24
post #22

Earlier quoted context omitted.

I think it goes further than the language's support of data literals to the culture of the language itself. The Clojure community takes programing with data literals to, what I would call, a pathological extreme. It's as if nobody wants to write actual code, just data structures to be interpreted, regardless of how general those data structures are. The problem is everybody gets hung up on code is data but doesn't re…

You are contradicting what your parent post is saying and agreeing with the OP. So you agree that Clojure is the most data-oriented programming language, but you feel like it is too extreme?

That sums it up. I think Clojure is the most data-oriented programming language there is, but it gains that title not through features which other languages have as well, but through its general developer culture. And also, I do feel that the Clojure community often takes data-oriented programming too far.

Re: How much can a Clojure developer do alone?

#25
post #4

> There is no other language that places such an emphasis on programming directly with plain and naked data literals. Counterexamples: Erlang and Elixir. Arguably also Prolog. Also Lua. Many Schemes, and Racket. Of course, REBOL and Red. TCL probably, too. I can't help but think that people making claims of "no other language has X" are in most cases wrong, and should study a bit more before making them. There's a lo…

I haven’t written any Clojure for a few years now. So my knowledge and technique is out of date, but I have a contrary opinion on “repl driven” development vs many Clojure advocates. In short: your repl compiled code is state that you now have to track in your head. Yeah, great, you can compile a single function and it hot loads. It’s pretty awesome for experimenting and debug, but the longer your repl session is ope…

I think this is caused because of the disconnect between the source in files and an environment in a REPL. There are alternatives:

You can keep your source inside your environment, like in Smalltalk. Whatever state you modified, it stays modified as long as you use the same image.

You can ignore hot reloading and have short-lived REPL sessions for testing and debugging. This works with Scala, OCaml, Idris, and similar. You don't need to track state too much, as it's frequently reset to known-good defaults.

Erlang allows hot reloading, but of whole modules only. You can only evaluate expressions in the REPL, not definitions. It's a good strategy, because the state in Erlang is rarely shared across modules, and having to reload the whole module ensures that it's always initialized correctly.

I think Clojure model is very close to what Racket has: you can switch between modules in the REPL and mutate their namespaces without ever reloading them from disk. Common Lisp is also close, the difference being that CL is image based, so there's a way for persisting the state changes... even if it's not the best of ideas :)

I like the Erlang model, but they all have advantages if used correctly. Pervasive immutability and sane reloading strategy help a lot, but even without those, you can use the REPL effectively. On the other hand, "living in the REPL" all the time is maybe going too far.

Re: How much can a Clojure developer do alone?

#26
post #6

> I am not using the REPL much, am I doing something wrong? Applies to python, too. I am always surprised if developers and data scientists working with python don't know that ipython, and by extension the python Jupiter kernels, come with a repl that hotloads code changes from local installs: %load_ext autoreload %autoreload 2 Is usually my first cell in a notebook. Repls are so powerful. The repl like behavior of f…

I like Python, but the using the REPL w/ Python's indentation is not fun for me.

I'd venture a guess that anyone advocating REPL-based development in Python is pitching IPython/Jupyter. IPython's REPL supports multi-line editing, trims common leading whitespace from pasted input, among a whole host of other features. The standard REPL is definitely painful for all but the most basic tasks.

Re: How much can a Clojure developer do alone?

#27
post #4

> There is no other language that places such an emphasis on programming directly with plain and naked data literals. Counterexamples: Erlang and Elixir. Arguably also Prolog. Also Lua. Many Schemes, and Racket. Of course, REBOL and Red. TCL probably, too. I can't help but think that people making claims of "no other language has X" are in most cases wrong, and should study a bit more before making them. There's a lo…

I haven’t written any Clojure for a few years now. So my knowledge and technique is out of date, but I have a contrary opinion on “repl driven” development vs many Clojure advocates. In short: your repl compiled code is state that you now have to track in your head. Yeah, great, you can compile a single function and it hot loads. It’s pretty awesome for experimenting and debug, but the longer your repl session is ope…

I was very productive in Clojure for some number of years and never once, not a single time, found benefit in REPL-driven development. I've used it here and there just to test little snippets, but never actually used it for real.

Frequently I found it unnecessary, anyway. Clojure just made it way to easy to get things right that I rarely had to dive in and figure out why something was wrong.

These days I prefer types over Lisps for that, but people change.

Re: How much can a Clojure developer do alone?

#28
post #16

Earlier quoted context omitted.

I haven’t written any Clojure for a few years now. So my knowledge and technique is out of date, but I have a contrary opinion on “repl driven” development vs many Clojure advocates. In short: your repl compiled code is state that you now have to track in your head. Yeah, great, you can compile a single function and it hot loads. It’s pretty awesome for experimenting and debug, but the longer your repl session is ope…

If you write your code the correct way, there wouldn't be any states in your namespaces for you to keep track in your head. That only happens if your code is full of `(def some-state (atom {}))` or something like that. You are basically illustrating my point about "You probably cannot learn Clojure all by yourself". You need a mentor to show you how to do Clojure correctly, or you have the humility to learn the prope…

> If you write your code the correct way,

Then you don't need a REPL. This is a very weak argument, overall: there are programming techniques to compensate for any deficiency in the environment. The fact that you need to use them is already worse than not having to worry about it at all.

> Sadly, most people would rather just try something and jump onto conclusions immediately.

Just a gentle reminder, you're not talking to "most people" here. Nevermind me, we [EDIT: cut out the irrelevant details] I just want to say that assuming good faith and informed criticism are the better defaults for this forum.

Re: How much can a Clojure developer do alone?

#29
post #4

> There is no other language that places such an emphasis on programming directly with plain and naked data literals. Counterexamples: Erlang and Elixir. Arguably also Prolog. Also Lua. Many Schemes, and Racket. Of course, REBOL and Red. TCL probably, too. I can't help but think that people making claims of "no other language has X" are in most cases wrong, and should study a bit more before making them. There's a lo…

I haven’t written any Clojure for a few years now. So my knowledge and technique is out of date, but I have a contrary opinion on “repl driven” development vs many Clojure advocates. In short: your repl compiled code is state that you now have to track in your head. Yeah, great, you can compile a single function and it hot loads. It’s pretty awesome for experimenting and debug, but the longer your repl session is ope…

TL;DR -- Possibly it has to do with the style that I use, but those things doesn't actually happen to me very often, and when they do it's not a big deal. For me, the benefits of REPL-driven-development far outweigh occasionally having to deal with these issues.

Two things. First, I've been bitten by this myself, but it's pretty much always been something like "Oops, I renamed a function and forgot to update a reference to it, but the code still worked because the old definition was still there... until I reloaded the REPL." It's always been a trivial fix for me, since when I try to re-evaluate the buffer containing the outdated function reference it throws a "cannot find function definition" error. I currently consider the advantages of REPL-driven development to outweigh that occasionally happening.

Second thing: maybe others do it differently, but I don't think I generally make manual changes to the state while things are running. If the state doesn't look the way it should, I either start iteratively tweaking functions (by modifying my .clj file and eval-ing them) and re-running with fresh state to understand and resolve the problem, or I work with a separate, similarly-shaped piece of state and run it through functions in a sort of "manual unit testing" to tweak and fix whatever's wrong, and then I re-run everything from scratch to make sure it worked. I don't adjust the state, evaluate a code path, and then continue on if it works (because yeah, I can totally see how that would lead to the sort of situation you describe, which sounds unpleasant)

Re: How much can a Clojure developer do alone?

#30

Serious question: is Clojure worth getting sucked into the complicated/verbose/nested Java ecosystem? I've avoided Clojure to avoid Java. Lately digging Rust...

It depends on what you mean by "worthing" it. To become a better programmer? Definitely worth it to know Clojure, as it does provide a new programming style that has inspired some other ecosystems. To find a job? Probably not. Clojure is not a popular language.

On the other hand, nowadays you probably can get away with not knowing Java when doing Clojure. There are also Clojures that are not on the JVM. For example, if you do Clojurescript, then you probably need to know some Javascript. There are also natively compiled Clojures for shell scripting, e.g. babashka, etc.

Post reply on HN