
Productivity brought by Clojure [slides] - tosh
https://www.slideshare.net/humorless/the-productivity-brought-by-clojure-149170292/
======
keymone
Clojure's immutable data structures (lists, vectors, maps and sets) are
actually _not_ copy on write, they're based on red-black trees such that when
you "mutate" the value, a new one is created that shares everything but the
mutated part with the original.

Clojure is amazing and i can't recommend it enough. I wish more people looked
past the unfamiliar syntax and understood why it exists and how it makes you
achieve more with simpler code.

~~~
lukifer
I'm pretty sold on Clojure's value, I've read up on its structure/syntax, but
generally struggle with learning the standard lib and trying to read/write
actual code. Any resources you can recommend for gradually ramping up, and/or
"lightbulb moments" for a dev steeped in C-like languages?

~~~
rafd
If you're new to functional programming, I recently gave a talk on applying FP
concepts at ClojureNorth:

[https://youtu.be/vK1DazRK_a0](https://youtu.be/vK1DazRK_a0)

The main example I work through is in JavaScript so that Clojure's syntax
doesn't get in the way (I love s-expressions, but they're not the point of the
talk).

~~~
pdsouza
Came across this talk a few weeks ago and I have to say this is one of the
best pragmatic talks comparing non-FP vs. FP paradigms I've ever seen. I
really like your example problem, how you explore state and mutation in the
different paradigms, and how you refactor step-by-step towards a functional
design. Thank you!

~~~
rafd
I'm very glad you liked it! Thank you for your kind words.

------
cleansy
Amazing how they just write a flat: "at least 30%" increase in productivity.
Based on what exactly? How did they even measure that? I don't want to talk
these slides down, especially since I think that a lot of use cases might
benefit from something like clojure but sources would be nice to read up.

~~~
chungus
If you are referring to the "30% increase in productivity from REPL driven
development", it could be he means not having to recompile after each change,
so not having your workflow interrupted.

~~~
EForEndeavour
That sounds like support for REPL-driven development, not specifically clojure
use.

~~~
6thaccount2
Agreed to a degree.

I find Python in the REPL to be great, but I think Common Lisp with Slime and
maybe Clojure with Cider take it to a new level. You can write your code and
when it errors out it drops you into the REPL where you can update the code
incrementally while it is running.

If Python gets me X% increase, Lisp and Smalltalk (and maybe Forth) get you
some X% + Y%. The parent comment is right that 30% is probably a back-of-the-
envelope calculation and not a rigorous one.

I'm only a novice/superficial language geek, so I can't tell you why Lisp and
Smalltalk can do that though. Extreme late binding? Hopefully someone more
educated can reply.

~~~
marble-drink
Python in a REPL isn't really possible because you can't reload modules. It's
OK if you're working on just one module but as soon as that's not true it's
just not possible. And if you use relative imports you can't even do that.

I'd love to know if anyone has a way to get it to work because I really miss
REPL based development from my common lisp and Clojure days.

------
dimitar
Really nice to see stories about Clojure on HN.

Initially, it wasn't clear for me what editor is used but it appears to be
Vim/Neovim with Fireplace: [https://github.com/tpope/vim-
fireplace](https://github.com/tpope/vim-fireplace)

Actually looks pretty simple and straightforward. There is a healthy choice of
different editors and IDEs for Clojure right now, thanks to building on common
foundations of
[https://github.com/clojure/tools.nrepl](https://github.com/clojure/tools.nrepl)

------
ecmascript
I have never really understood what people get from these slides, but my while
my experience with clojure is extremely limited I can say that I found it to
be rather interesting but hard.

I could not grasp several error messages, took me a long time to write
something to a database and it didn't really feel at all natural to me. But I
guess you'll have to get used to the functional nature, but I don't believe
all the hype about functional programming in general.

If it was so effective as people seem to claim, I am sure everybody would use
clojure. My experience is rather the reverse, it is harder and takes a long
time to develop in. Maybe it's more predictable and is better software with
less bugs in the long run, but I wouldn't really know since I lack the
experience.

A lot of programming languages today, like javascript, already has functional
stuff within it. I get the appeal for it, but I'm not sure it's the best tool
for every job or even most stuff.

If anyone is willing to post a youtube-talk or something that can convince me
of otherwise, please feel free.

~~~
LandR
> If it was so effective as people seem to claim, I am sure everybody would
> use clojure.

I don't think this is even remotely true. As much as everyone in this industry
wants to believe it's fast paced and fast moving / evolving, it's hellishly
slow in picking up on good ideas and will waste an exorbitant amount of time
on bad ideas...

Cool / Hip seems to be valued more than quality when it comes to languages /
frameworks while the actually useful slowly, _painfully slowly_ , trickles
down.

~~~
zaphirplane
Java, c# and python are hardly hip and rank as some of the most used languages

~~~
kls
I was around at the dawn of personal home computing and for the
commercialization of internet technology so I have seen each of these come and
go. Though they are not the cool kids anymore, the sheer volume of code keeps
them around, and given that people have those skill-sets, new code gets
produced in them.

Java was certainly the fad dejure in it's time, OO was the craze and Java had
just been dumped out on the internet, by Sun, for free. In a time when a good
portion of compilers costed money (especially if you where not on an Intel
based PC), you could learn Java for the price of an internet connection.

c# was the cool kid if you where a Windows developer, Microsoft was looking to
update their aging development stack and give themselves hardware portability,
so they basically created the JVM for windows in the form of .NET . To ensure
that people switched over they kicked the legs out of VB6 and pretty much
forced everyone to the new dev stack. They offered a host of language that you
could use to write windows apps, but they conformed all of them to the OO
style that was popular at the time. With that said, VB.NET did not look like
VB6 it looked a whole lot more like C# with VB syntax. So given that
developers had to pretty much learn a new language even if it had familiar
syntax most opted to just go ahead and learn c# as Microsoft was pimping c#.

Python is the odd ball in your list as it kind of languished for a while. It
was not obscure but it was more like Ruby, it had it's devotees but was rather
flat, not obscure just flat. That being said, it did have it's cool kid, day
in the sun and that was when Google started using it heavily. The AI winter
really killed LISP as "the" AI language and there really was no heir apparent,
that is until (IIRC) Google started producing some of their machine learning
tech and they implemented it in Python. This instantly made Python the cool
kid and people started adopting it. My opinion is that Google felt they where
too heavily invested in Java and thus needed to diversify into another
language. At the time there where not a lot of options that had the
combination of mature enough/without legacy clutter/availability of
developers, to make the cut, that is why I think Python made the short list.

TLDR: the GP poster is right, popularity and trends have more to do with
language adoption than technical merit does.

------
erokar
The fact that Clojure runs on JVM turns me off. I find that Elixir is very
similar to Coljure, with a runtime that better supports immutability and
concurrency.

~~~
jwr
Why does it matter to you? I mean, I know why I find it to be a positive:
implementing a runtime is a vast and complex task, and doing it well is way
too expensive for most projects (see for example the problems Python has had
over the years with the global interpreter lock).

If you can use a runtime with gazillions of man-hours invested into making it
better, and get easy access to bazillions of native libraries, why not?

~~~
tdbgamer
While I agree with you that the JVM is great, I think most people that don't
like it really just hate Oracle. It's not really a technical argument as much
as it is philosophical. I don't really care either way, but I can see why
people would mistrust Oracle knowing their history.

~~~
jwr
I understand the sentiment, Oracle is a terrible company and I don't like it
either. But at this point we have the OpenJDK and you can use the JVM without
caring about Oracle at all.

------
whalesalad
Too many people conflate clojure with high paying salaries. It's not clojure
that is earning the salary... it's the kind of engineer who might practice
something like clojure that is desirable.

~~~
iLemming
I think the reason why Clojure (alongside with F#) is the most paid language
(according to StackOverflow and State of JS surveys) because more and more
FinTech companies are discovering that the language is exceptionally well
suited for manipulating financial data (and not just that). Another reason is:
like the one you've mentioned: Clojure mainly attracts more experienced,
"grumpy" developers, those who have seen things and tried different ways and
become almost apathetic and burned out from (over and over again) building and
maintaining projects that despite all the efforts almost always spiral into
big, unmaintainable clusterfucks.

