Results of the 2012 State of Clojure survey
cemerick.com
cemerick.com
Yes, yes, a thousand times yes! Phil Hagelberg (a.k.a technomancy and a fellow HN'er) has done (along with many others) has done a great job of providing a great stack to start working with Clojure. From emacs-starter-kit to clojure-mode to smooth integration with leiningen, all Clojure enthusiasts and developers alike save so much in yak-shaving.
Someday perhaps I will get a chance to say thank you in person, but allow me to start here - Great job guys, and thank you!
Leiningen has "just-worked" for me from day one. Everything I have wanted to do has not only been possible, but very straightforward.
On the tooling side, the next version of the Light Table Playground will be even more friendly than the previous one and seeks to make it a one click experience to go from nothing to a complete Clojure env. It's also getting tutorial content and a few other things that should make it far easier for people just starting out.
In terms of the documentation and discovery problem, I think we just need to push documentation into the community's culture and I imagine the best way to do that would be to make tools that make beautiful documentation easy. We have codox for the generation of API docs, but nothing for longer form documentation and I haven't seen an environment that really embraces both the consumption and creation of docs - this is a problem I really want to see tackled in Light Table and I think there are some very cool potential solutions.
As for pushing documentation into the clojure culture, having on-demand online docs for any clojar or github repository would go a long way. We don't even have to reinvent the wheel as it's already been done in ruby, http://rubydoc.info/ (source - https://github.com/lsegal/rubydoc.info).
Marginalia was never intended as a system for writing longer form docs... but truth be told I don't know what "longer form doc" means. User manuals?
In any case, Marginalia is trying to fill the "code-reading" space rather than the API and user-manual nitches. For the latter case, I've been experimenting with another tool.[1]
How so? Isn't GitHub already its own on-demand online docs service?
https://github.com/technomancy/leiningen/tree/master/doc
https://github.com/technomancy/clojure-mode/blob/master/doc/...
On second thought, I'm not sure if any of this would go a long way as I don't know clojure's culture too well yet. I just know I've found indexed docs to be valuable in ruby when linking to and discussing a library's API.
There's a place for API reference pages, but considering that most tools to generate it require evaling the code in question, a third-party hosting service would have to implement some fancy sandboxing and wouldn't really offer much over GitHub Pages since it's just static HTML.
But I don't think when people complain about documentation that they're complaining about API reference. I suspect people want accessible tutorial-style prose and introductions. But maybe next year's survey could distinguish between the two.
Good documentation with examples, especially integrated R/W documentation is absolutely essential. Integrated clojuredocs etc.
I don't think PHP would be still around if the docs were more like docs in other langs. People can give additional examples there, describe bugs, differences in various versions, even small programs demonstrating the intended use or a workaround. It could be a lot better technically but it's very clear that it is super useful and a great time saver.
Really? I find it hard to believe that the problem is caused by a lack of tools. Clojure already has five or six tools for spitting out a programmatically-generated HTML overview of the shape a given project.
Instead I think it's clear the reason this doesn't happen is that good documentation is really difficult to write and people don't want to put the necessary effort into it. Putting aside the obvious problem that good English prose is really difficult to write, you have to overcome the fact that the people qualified to write the documentation don't much benefit from it. On top of that, it's very difficult for an experienced user to put himself in the mindset of a beginner.
In fact, I'd go so far as to say that the existence of all this existing documentation tooling only goes to reinforce the harmful notion you can just run something like marginalia over your codebase and publish the HTML output somewhere and consider your project documented. Sure, API overviews are valuable as a reference, but they're mostly just a distraction to someone starting out who just wants to figure out whether the project is a good fit for their needs. Long-form prose documentation is crucial at that stage, and it's awfully hard to come by.
http://jacobian.org/writing/great-documentation/what-to-writ...
Anyway the tooling is trivial--getting an overview of the API and docstrings has been done over and over, and rendering a pile of prose in markdown files is hardly rocket science. The real problem is cultural.
In the end, however, it comes down to us; the people using the language and writing the libraries now to do exactly this. It's why I spent so long writing stuff for Noir and it's something we as a community that already exists need to do better.
Yes.
> and I imagine the best way to do that would be to make tools that make beautiful documentation easy.
Well, we've already got "built-in" tools that make handsome docs (maybe not beautiful, but certainly nice enough :) ). That is to say, almost all Clojure projects are on github and github automatically renders .md files into lovely html. With syntax highlighting too, if you label your blocks like so:
```clojure
(some :clojure "code")
```
So, just encouraging authors to add a some doc/*.md files to their project would be an excellent start. :)> In terms of the {snip} discovery problem
I'm hoping [this](https://github.com/uvtc/clojure-dining-car) might help address that, if it gets some more community traction.
And Python and Ruby are sure languages, people like to program in.
For example, if you're in the CLR or the JVM already, there's a lot of reason not to move. Ruby and Python's relative obscurity might work to their benefit.
Yes, it seems economic. After investing time in the larger and more enterprise-focused ecosystems, you'll probably have less incentives to try or move to something else.
That's not implying, that Python and Ruby don't have great ecosystems themselves.
Or more cynically they have a higher potential of being language hipsters :)
This is just a silly question: almost every single day I am using all of bash, HTML, Python, Objective-C++, Java, C, C++, JavaScript, and SQL. This is required because I do work on a mobile application targeting iOS, Android, and "the browser" that has a server part and native components on the clients (using a mix of custom and off-the-shelf open-source codebases).
So, what is my "primary language"? I'd simply argue I don't have one, and I haven't had one for a decade. The idea of having a primary language honestly comes off to me as a sign that the developer hasn't spent much time programming yet: the real world has so many languages in it, and many times the practical choice is constrained by that of the platform or existing code to interoperate with.
The question about what language I used just prior to adopting Clojure is also not going to work very well: it was probably bash, as I used that language to download and setup Clojure. It may have been something like Haskell, as I might have been in an experimenting mood that day. It could have been any of the above "used" set (as I probably just had "learn Clojure" on my todo list right after something else random). The result of that version of the question doesn't really have meaning.
A much better question might be, "for the tasks that you find yourself now using Clojure, what language do you now feel you are most using less often?" (although spending some more time on the poor "most/less" phrasing that I left in that might cause problems with non-English speakers). This question better handles people who are long past the idea that they primarily code in some specific language.
It also lets you answer the question more precisely: a person even working in only two languages, JavaScript (client, 70%) and Python (server, 30%) who started using Clojure on the server as a replacement for his current usage of Python is a different kind of user than the person who started using ClojureScript on the client as a replacement for his current usage of JavaScript.
I've been writing code for ~18 years, ~10 professionally. I've programmed in (chronological order here) Modula-2, C, Basic, the HTML constellation, Perl, XSLT, Ruby, PHP, Java, Mathematica, Prolog, C++, Python, ML, Erlang, Haskell, Clojure, and Scala. I can state unambiguously that Clojure is my primary language: it is the most powerful, the most fun, and has the fewest tradeoffs.
Like Haskell, I view Clojure as an apex language: the best confluence of software ideas towards a unified goal. Where Haskell excels at lazy, pure, strongly typed problems, Clojure is my first choice for dynamic, general-purpose programming. I wish it were faster, that it had a smarter compiler, that it had CPAN's breadth, that its error messages were less malevolent, that it had a strong type system for some problems. But for all this, you gain a fantastically expressive, concise, rich language built out of strikingly few ideas which lock together beautifully. It gives you a modern build system, a REPL, hot code reloading, hierarchies, parametric polymorphism, protocols, namespaces, immediate, lazy, logical, object-oriented, and functional modes, rich primitives, expressive syntax, immutable and mutable containers, many kinds of concurrency, thoughtful Java integration, hygenic and anaphoric macros, and homoiconicity.
Were Clojure to cease, I would immediately endeavor to replicate its strengths in another language. That's a primary language to me. ;-)
In more general terms: no, I don't see this as a critical methodological error. Could it be "Pick your top n"? Sure, might be useful. Yet, I've never met a programmer who had trouble with "What's your [primary|favorite] language?", and the survey made it clear what to do in cases where more than one option applied: pick one, and don't worry too much. Survey design is always a balance between specificity and nuance, and I think in this case he made an OK call.
How did you go from one extreme to the other and pick it as your 'primary' language.
Isn't it like saying "I really like President Obama, but my favorite politician is Rick Santorum".
In many other respects, Haskell and Clojure are ideologically similar. Both emphasize immutability, referential transparency, higher-order functional programming, and laziness. Clojure chooses to layer this on top of a mutable core; Haskell uses monadic combinators. Again, there's a difference of perspective. Haskell's technical emphasis on purity makes powerful invariants available to the compiler, but requires some serious type acrobatics for concurrent stateful operations. Clojure gains the ability to drop to mutability in a simpler way, but places the burden on the programmer to keep track of side effects: relying on culture to maintain sane guarantees.
But: I don't think many people have the same trouble with this question as you do. A particular type of discussion recurs with programmers, whatever their background, around which languages one has used over the years. Inevitably, people characterize their usage into a serialized narrative. For example, mine is: BASIC (C-64) -> assembler (again, C-64) -> BASIC (Amiga this time) -> C -> RealBasic -> C++ -> Java -> Python -> Scala -> Clojure.
Of course there are overlaps and dozens, hundreds of "secondary" or otherwise concurrently-used languages splattered about, but that doesn't prevent most people from being able to construct that narrative. The question simply aims to find out what other people slot into the last position in their progression (or, second-to-last, if they already consider themselves to be 'Clojure programmers').
And, if there is any internal indecision about what one's primary language is, the fact that only one answer could be given forces the issue through the lens of personal identification and affinity, which is far more valuable than defining "primary" as "language spent the most time with". e.g. Even if, through some sordid turn of events, I were to spend 70% of my time programming in JavaScript, I'd still report myself as a Clojure programmer if I could only name one language.
After all, there is a goal to the question other than to just ask people "what're all y'r favorite languages out there in ClojureLand!", right? If not, then sure: the question as answered might be somewhat vaguely reasonable, in that it is more "free association in the mind of the person answering the question"; but if you have some actual purpose to asking, maybe to provide better "how to move from language X to Clojure" documentation, or to know on what forums and in what magazines outreach efforts should be coordinated, or to get a feel for the kinds of language and library features that people may be missing, the question as stated isn't really going to help, and may as well be replaced with the much simpler "what is your favorite non-Clojure language".
Again: the developer might actually consider himself a JavaScript developer, consider JavaScript even to be the one true language that binds all other languages together and by which all other languages should be understood, and thereby is his "primary language", and yet in his world he just replaced every single moment he used to use Python with Clojure. The answer "JavaScript" is then of some vague interest, but honestly he wasn't even using JavaScript for these tasks before even though he theoretically could have been: for some reason the kind of task he is now using Clojure for was dominated before by Python in his mind, and that's what it is going to be compared to and what it is going to be replacing.
1. Download the lein script 2. Place it on your $PATH (eg. ~/bin) 3. Set it to be executable. (chmod a+x ~/bin/lein)
Step number one takes you text you need to copy and paste into a text editor, but what do you save the file as? A new programmer doesn't know what his/her $PATH is, and you can't simply cd ~/bin. And for the last step, you need to save the file as lein, which you might not have done.
Why is Clojure the only community that does this?
http://blog.johantibell.com/2011/08/results-from-state-of-ha...