News for hackers. Stuff that matters.
Re:Results of the 2012 State of Clojure survey by saurik on Monday August 06, 2012 @11:31AM (#4345582)
> What language did you use just prior to adopting Clojure — or, if Clojure is not your primary language now, what is that primary language?

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.

Re:Results of the 2012 State of Clojure survey by aphyr on Monday August 06, 2012 @11:59AM (#4345689)
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.

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. ;-)

Re:Results of the 2012 State of Clojure survey by runT1ME on Monday August 06, 2012 @01:15PM (#4346080)
It seems to me that Clojure exists on the idealogical extreme opposite of Haskell (standing next to it's little buddy Scala).

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".

Re:Results of the 2012 State of Clojure survey by aphyr on Monday August 06, 2012 @01:33PM (#4346179)
Different techniques are useful for different problems. Sometimes you really want a powerful type system: it makes invariants for safety, concision, and speed available that you can't get any other way. Other times you want a more dynamic type system: especially where you don't really know the full shape of the problem yet. This is a choice you have to make, as a language: where on the type continuum do you fall? It's partly technical, partly cultural. When done well, it pervades the language offering tremendous power--but it is a choice.

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.

Re:Results of the 2012 State of Clojure survey by ema on Monday August 06, 2012 @01:45PM (#4346236)
They have both have immutable data structures and i realized just now, that is after GC the second most important feature i want in a high level language.
Re:Results of the 2012 State of Clojure survey by saurik on Monday August 06, 2012 @12:46PM (#4345912)
Ok. and what answer did you leave for this survey, given that "Clojure" is not valid? ;P
Re:Results of the 2012 State of Clojure survey by aphyr on Monday August 06, 2012 @12:59PM (#4345983)
Prior to Clojure, my primary languages were Ruby and Erlang. Where Clojure or Java libraries are available, Clojure is typically a functional superset of Ruby. Blocks are used as weak macros, that sort of thing. Erlang/OTP is pretty unique in my experience; while actor models are common in various languages, nothing comes close to OTP's treatment of failure modes, upgrades, and distribution. I also miss Erlang's pattern matching, though Clojure's destructuring bind is sufficient for many cases.
Re:Results of the 2012 State of Clojure survey by saurik on Monday August 06, 2012 @01:08PM (#4346037)
... so... you agree with me, that having to choose a single primary language doesn't work. The question was both worded quite explicitly to force you to choose a single language, and if you add up all of the percentages you can tell that the original form actually required only a single answer. My feedback was "people often don't have a single answer to this question", and after you spent multiple paragraphs attempting to claim I was wrong, when I asked you to actually tell me how you'd have answered the question, you came back with two answers. The question either needs to be reworded to allow for multiple answers or it needs to be reworded (in the way I attempted to provide an actual example of, putting in actual effort on my part to help future implementations of this survey) to help the person answering choose a single one.
Re:Results of the 2012 State of Clojure survey by mattdeboard on Monday August 06, 2012 @01:21PM (#4346109)
Choosing a single primary language does work because it's an informal web survey about a programming language. It's not a contract or a test of loyalty/zealotry. Your position here seems like getting upset when asked what your favorite sandwich is.
Re:Results of the 2012 State of Clojure survey by saurik on Monday August 06, 2012 @01:25PM (#4346137)
I am someone who is interested in Clojure trying to learn something from a survey that was posted, and I'm providing constructive feedback (explicitly constructive, as I went out of my way to carefully come up with an improved wording that could be used for one of the questions) to further that goal. To help demonstrate that the question was confusing, I asked someone here to answer it, and he came up with multiple answers to the question, which was the very way I claimed that the question failed, as the question only allowed a single answer. I don't care about "contracts" or "loyalty/zealotry": I care about trying to come up with an improved survey that has answers that mean something. I'm "sorry" that no one else does, and that they would rather type long replies about how much they love Clojure than discuss issues in question design on a survey... whatever.
Re:Results of the 2012 State of Clojure survey by aphyr on Monday August 06, 2012 @01:42PM (#4346224)
I answered "Ruby" on the survey without question: in my case, it has significantly broader applicability than Erlang.

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.

Re:Results of the 2012 State of Clojure survey by cemerick on Monday August 06, 2012 @12:42PM (#4345896)
As I said somewhere in the post, I am not a survey or polling professional. So, I'm sure mistakes have been made.

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.

Re:Results of the 2012 State of Clojure survey by saurik on Monday August 06, 2012 @01:29PM (#4346158)
So, in my 70/30 example, the goal was to demonstrate that there were two reasonable paths for someone in that situation to start using Clojure, and that if this question were worded differently it would be possible to get useful information out of it: you could tell whether Clojure's "main in-mind competitor" was Python or JavaScript; this could be done in a way that even removed the mental biases of how a developer self-associates himself, because the question could be made resilient to such.

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.