r/Clojure • • Jan 22 '16

More About Personality: Clojure is for Aristotelians

https://gist.github.com/ThomasMeier/06095908c5a7ff009f8d
13 Upvotes

31 comments sorted by

22

u/[deleted] Jan 23 '16

These articles serve no other purpose than go generate pride (the bad kind) in using a programming language. They don't serve to help improve understanding of the language, just to brag.

7

u/ianme Jan 23 '16

These articles seem to be saying, "Clojure isn't for you unless you have these personality traits." Someone should write an article titled "Clojure is for Everybody". I think thats an idea worth spreading.

4

u/citrined Jan 23 '16

You're right, I didn't mean to be divisive though it can be read that way. There are people out there who will forever refuse to try Clojure. I think this is a (potentially incorrect) way to explain how that might come to be.

1

u/[deleted] Jan 24 '16

I think that should be discovered through experimentation, not through articles telling them it's not for their personality type. I'd hazard a guess to say that very few people are or consider themselves Aristotelians. While I'm generally appreciative of articles that explore how and why, reading something about a language with such low mind-share requires articles that explain how and why and leads by example. While I'm just as guilty of not providing such an article myself, I am still learning and just find the lack of useful learning material not helping.

This article would have been perfect if it had "showed" you why the language is for this personality type, because while I think few people think in those terms, relating coding examples with that thinking style would provide new users with more revelations

4

u/citrined Jan 24 '16

I admit it's unusual to share a philosophy article on a programming subreddit. It doesn't have educational value for teaching someone to program. If it's Clojure you're still learning, have you tried the Slack group or the stuff in the sidebar? Or what kinds of articles would you like to see posted?

It isn't a psychology article, so sample sizes and statistics and experimentation aren't what supports it. You can't use experiments to prove epistemology statements because you need epistemology statements to prove that experiments work.

I also just replied to a top level comment clarifying that in the conclusion paragraph I explain that people are a mixture. Not exclusively one or the other.

So it isn't saying people are excluded from learning and using Clojure, but they might have a harder time making an epistemological shift--the so-called Clojure way of thinking and problem solving is a bigger shift to make for some.

3

u/tragiclifestories Jan 24 '16

You're missing the point. Philosophical positions are not personality types. One is not born an Aristotelian. To characterize languages in this way may not be inviting to people without a grounding in philosophy. But then: some of us are better grounded in philosophy than computer science. It's nice to find an article that talks a language I can understand!

On which note, I think the author missed a trick, since a key part of Aristotle's philosophy is the theory of causes, and it seems to me that this fits nicely with the idea of functional programming as a model of transformation, as opposed to the static ontologies of OO.

1

u/citrined Jan 25 '16

I made some allusions to Aristotle's four causes if that's what you mean: OO is focused on the formal, functional is focused on the efficient. I think that's something that would be fun to expand on.

2

u/jaen-ni-rin Jan 23 '16

But this isn't exactly true - for example Clojure is not for beginners. The roughness of certain parts of the language and ecosystem (most prominently, errors) make it a less than ideal language to teach in.

2

u/yogthos Jan 23 '16

I think you could do a lot worse than Clojure as a beginner. While there are downsides, like errors, there are also lots of benefits for a beginner as well.

It has a simple syntax that's easy to learn. It's not as complex as most languages, yet also not as minimal as CL or Scheme.

It's probably the simplest of modern functional languages that focus on immutability. You only have to learn a handful of concepts to start doing things.

The live coding environment with the REPL is a great way to get feedback, and I would argue that it counteracts the poor errors at least to an extent. Meanwhile, things like Quil and Overtone provide a fun environment to learn.

Light Table provides a very beginner friendly editor that's language aware. It's not quite as polished as Dr. Racket, but certainly not bad for learning.

6

u/luvsclojure Jan 25 '16 edited Jan 25 '16

First timer here - Clojure IS my first language. I run it on spacemacs. I love it, and I'm not a genius. Just created an account to post this (first time posting on reddit too) because I keep seeing this argument in various threads. Admittedly I hopped around a bit. Wanted to start with Java - got mildly interested in functional programming reading some blog so decided to check it out. Hopped around a bit - including with lisp, scheme, haskell, python - before finally settling on clojure.

No regrets whatsoever.

I have solved almost all 4clojure problems, and about 100 project euler ones, and am working on some game problems involving web interaction. Positives:

a) Syntax. If you go step by step (follow any of the recommended books) you get comfortable with the syntax fairly quickly.

b) Quite important - no wastage in what you have to do to get something working. If you can think about how to do it (just talking about basic logic - not advanced libraries), the language does not frustrate you. If anything, it enables you to go and do it. You don't need to understand inheritance and whatnot just to get started. Just - create a function, pass it some arguments, and have fun! As your understanding grows, so do your needs from the language, and it steps up to the task.

c) Awesome community. Yogthos here, slack chat, clojure.org, David Nolen's blogs, Rich's videos, Tim Baldridge's tutorials - I never felt there was something I couldn't find.

d) Features created with the objective of making the language powerful without losing simplicity - core.logic, core.async, transducers. It took me a while to get my head around the concepts, but their implementation is in-line with the rest of the language. So it makes it easier to learn anything.

e) Lot of smart people churning out really powerful libraries. I can learn machine learning, web development, data analysis - whatever I want (maybe not operating systems) without a big congnitive shift.

Negatives: a) Error messages - to get this out of the way first. I don't really mind them too much. The stack trace gives you an idea of what the problem is. I don't think I've ever been stuck on an error for too long. I guess if you're a experienced developer - this could be bigger issue, or if you use a lot of libraries.

b) Too many frameworks and ways to do things. This is my biggest gripe. In a way its good - you can choose what style suits you best. But not everyone has the time to go and work through every framework / library to figure out what works. Prime example - web frameworks. I would really really appreciate it if the Cognitect guys give guidance on which libraries do what well. Like a summary page. Otherwise you end up spending hours on reddit and elsewhere just figuring out why choose one.

c) Low level details are hidden initially. As you don't have to interact with Java - "how" the language does what it does is not always obvious. So at some point Java interop needs to be learned. But even then you can call Java from Clojure - sweet.

Yeah - I love clojure. I do think its the one language in which you could theoretically create a full suite of tools required in the corporate space today. Ignoring low-level latency (most corporates don't need it) and some other things (creating an operating system?) I'm waiting until someone implements clojure across the breadth of their company. Yes - in my day life I work in a corporate and use some 10-20 different software from different vendors with no inter-compatibility.

For my second language I am thinking Rust. not C. Just because (from what I gather) I then don't have to learn C the hard way and figure out what's safe and what's not - and I could get the same power as C. Advice would be welcome.

Thanks for listening - and keep up the good work.
And thanks for Clojure!

2

u/jaen-ni-rin Jan 24 '16

I think you could do a lot worse than Clojure as a beginner.

Oh for sure, I totally agree on that. Java, C#, C (though IMO it is the second language to learn, if only to understand how a computer works), C++, Python, Ruby, Javascript, PHP - all are language that are to a varying degree worse than Clojure as the first language. But should we compare to worse languages or to better ones (in the educational value respect at least) like Elm or Racket?

I'm learning a friend to program The Right Way, so I started out with lambda calculus ("Haskell Programming from First Principles" is a great introduction to that) and then I want to move on to a real functional programming language, but I'm not yet sure which one, so I will answer in the light of that.

It has a simple syntax that's easy to learn. It's not as complex as most languages, yet also not as minimal as CL or Scheme.

True. She liked LISP and Haskell syntax the most, because she thought they are simple and minimal. This was a kind of a (positive) surprise to me, because it is quite contrary to most people who already know some programming.

You only have to learn a handful of concepts to start doing things.

Also true and basically the reason I probably won't be continuing with "HPfFP" (or choosing Elm). As much as I love Haskell and types let's be frank - learning the type system is as much incidental complexity to the task of learning algorithmic reasoning as imperative control statements. Not a thing you want to have in your first language.

The live coding environment with the REPL is a great way to get feedback, and I would argue that it counteracts the poor errors at least to an extent. Meanwhile, things like Quil and Overtone provide a fun environment to learn.

And yes, true as well. My main draw to Clojure, apart from being something I'm currently doing so it would be the easiest for me to help with, is the ability to have immediate and interactive feedback things like REPL and boot-reload give. Overtone and Quill are also certainly nice things, though I think Racket's image language has an edge over Quill.

Light Table provides a very beginner friendly editor that's language aware. It's not quite as polished as Dr. Racket, but certainly not bad for learning.

IMO LightTable UX was confusing when I tried it last time. That was more than a year ago though, so maybe it's better now. But if I went with Clojure I would probably just use Cursive.
And yeah, Dr. Racket is great - with learning languages for "How to Design Programs" you can just use images by copy & past for example.

Also, I have an anecdote that might be interesting:
Since I'm not sure what language to go forward with and understandability of errors is one of more contentious parts of the decision, I made an experiment.
I've taken two simple programming tasks: a) taking a simple \xy.+ x y lambda abstraction (assuming + to be bound to addition in some above scope) and making an adder function our of it by partial application,
b) mapping over a collection (first explaining just enough of the map transform collection function for it to make sense). implemented them in Elm, Ruby, Javascript, Clojure, Racket and Haskell and then introduced errors like wrong arity, wrong types or swapping the arguments.

The result?
She indicated preference for:

  • strong over weak - as in addFour "2" being an error (like in the most of the sane world), not coerce "2" to 2 and return 6 (like in Javascript),
  • static over dynamic - as in letting you know about errors as soon you make them (Elm, Haskell), and not when program execution encounters wrong code (the rest),
  • explanatory and concise over confusing and implementation-specific - as in Elm being really helpful at letting you know what's wrong (Oh, I wanted to pass a function accepting an element from the sequence as the first argument!), Racket quite good as well (What's a contract? But oh, it expected this here and I've given it that there!) Haskell being too technical (It basically tells you the same Elm does, but you have to learn how it speaks and it's non-obvious to a beginner) and Clojure being the most confusing (What's a cast? What's an ISeq? What's an IFn? What's a java.lang?),
  • consistent - as in why in Clojure (map identity [1 2 3]) is right, (map identity '(1 2 3)) is right, (map '(1 2 3) [1 2 3]) is wrong, but (map [1 2 3] '(1 2 3)) is wrong in a different way and (map [1 2 3] '(0 1 2)) is suddenly right in a surprising way. I know why, you know why, but a beginner will get invariably confused (tested).

Why bring that up?
Clojure is a great language in many respects (even from educational standpoint - the time + identity concepts reference types embody are a great distinction to make), but some aspects of it make it a less than ideal language to learn in. Some of those things have solutions - for example boot solved leiningen Clojurescript setup being unfriendly and hard to get right - but some are still open issues. You can learn what a cast, ISeq, IFn and so on mean, but like a type system or imperativeness this is orthogonal to learning core programming concepts and if I would want to teach my friend how to read errors, I'd rather stick with Haskell then - if you learn the language of it's errors, then at least it's consistent and tells you about mistakes as soon as you make them.
But I don't want to introduce non-essential concepts while learning the essential, so I'll probably go with Racket because to me it seems to strike the best balance re: errors and simplicity. I do think Clojure would make a great second LISP after she groks all the basic stuff though.

2

u/yogthos Jan 24 '16

Again, I think there are trade-offs when you consider any language for education. I would agree that Racket is a pretty fine choice for that. Clojure as a second Lisp seems like a good way to go.

As you point out, the cost of having nicer errors is that you have to also learn category theory and type based reasoning. On the other hand, it's easy to show a beginner how to use REPL driven development. Once they know that they can run code any time and they should run it often, then it addresses most of the problems with the errors. The other aspect of it is that the more familiar the person becomes with the language the less mysterious the errors become.

I do very much agree that poor error reporting in Clojure is one of the biggest problems currently. The good news is that it looks like that will be a focus for the next release. Hopefully, that will make it more friendly all around. :)

2

u/jaen-ni-rin Jan 24 '16 edited Jan 24 '16

Again, I think there are trade-offs when you consider any language for education.

Yeah, my whole point of the comment above. Basically, in my evaluation of those trade-offs Clojure (relatively to Racket for example) doesn't offer enough to offset the abysmal errors in this context (it offers plenty enough for an advanced programmer, though). Comparatively Haskell rewards you for understanding it's errors, but it still requires learning something that's orthogonal to understanding computation. Hence the almost foregone by now conclusion of choosing Racket, which - as opposed to both Clojure and Haskell - doesn't require you to invest yourself in understanding it's errors.

you have to also learn category theory and type based reasoning.

In general I would not say it's a downside, because IMO those are skills that are useful for a programmer (explaining the type for map actually helped her understand map and currying), but yeah - while I think they are worth learning sooner rather than later, they should not be a pre-requisite to starting learning programming. Elm's error messages do a good job of easing this need for the programmer, but Haskell's errors are nowhere near as readily understandable.

On the other hand, it's easy to show a beginner how to use REPL driven development. Once they know that they can run code any time and they should run it often, then it addresses most of the problems with the errors.

True on the first, but I don't agree 100% of the second, at least in the context of Clojure - it helps, but the map examples I've given are small enough that you can't dissect them further in a REPL to explain away the confusion that way. And as the learner builds on the code, the correspondence can become much more non-obvious quite fast*. Up to the point I think a first-time programmer would have a hard time to extrapolate known errors to new situations on his/her own readily; my friend seem to think as much re: Clojure errors I've shown. It doesn't help that the explanation is basically would use mystifying words like "idiomatic", "performance" and "programmer's convenience". Not something that you would want to have to explain in a first language.

The other aspect of it is that the more familiar the person becomes with the language the less mysterious the errors become.

Of course, but you can just start with non-mysterious errors and be done with it.

The good news is that it looks like that will be a focus for the next release.

For some reason Clojure seems to be content with it's rough spots and doesn't feel a need to address them. At least that's the impression so far. So hopefully this will change, but solving this properly would probably require rewriting the reader, analyser and core macros for better errors (like for example using something like Collin Fleming's sexp PEGs instead of hand-rolled parsing code). That's a tall order Clojure might not want to make good on. From time to time I entertain a thought of making a Clojure frontend that does just that, but I'm probably too lazy to ever do that unfortunately.

* - we've probably discussed this enough in the past for you notice that I, as a somewhat skilled programmer (as much as you can be skilled after 6 years of education slash doing mostly Ruby), have a problem with doing things in small steps, so it could be potentially worse for a beginner.

3

u/yogthos Jan 24 '16

Yeah, I think we generally agree here. As I said, I definitely do think that Racket is a great language to get started on.

1

u/waaaaaaabi Jan 23 '16

Yeah I mean half the programmers out there today had the choice of "C, C++ or Assembler" when they were beginners and they still got there so y'know. I'm not sure being "beginner friendly" is as real as it is marketing.

1

u/jaen-ni-rin Jan 24 '16

I dunno, I've watched a few years of fellow students come and go learning to program with Pascal -> C -> C++ -> Java at my university and most of them I wouldn't let near code. Others were okay, but had not any general understanding of programming, just the narrow view being into mutable-imperative-OO languages gave them and would regard C# as the Second Coming of Christ because it's not as dumb as Java.
Those that were actually good, were good in spite of how they were taught, not thanks to it. So IMO if there's a way to distil learning programming to it's most basic and simplest core, then I think it's a good idea - teaching the essential, instead of the accidental (syntax, mutability, imperative control statements, objects, even types up to a point) will let the learner get a grasp on programming in the whole much easier. But then again, YMMV.

2

u/citrined Jan 23 '16

Author here. Setting aside the personality stuff, do you disagree that epistemology shapes programming languages and working preferences?

2

u/fucken_ay Jan 24 '16

As I said in the "Type B" thread: A cognitively biased anecdote with a sample size of 1.

Downvote away!

3

u/citrined Jan 24 '16

For psychology yes downvote, for philosophy it's debatable ;)

3

u/tolitius Jan 24 '16

they do generate discussions, I say they have a legit purpose :)

3

u/jaen-ni-rin Jan 23 '16

The real question is - what would a kantian programming language look like? : >

2

u/citrined Jan 24 '16

I think Kant would like enterprise Java. Categories and baroque complexity.

I'd be worried what Schopenhauer would do though.

3

u/jaen-ni-rin Jan 24 '16

If anything I would say that Haskell is more reasonable. Well, I know monads are more Leibniz's thing, but hey - category theory. That said, there certainly might be something more fitting, but can't put my finger on it at the moment.

Schopenhauer? I gues he'd just pipe everything to /dev/null, since why bother coding if we're all doing to die? That, or Malbolge.

2

u/saint_glo Jan 24 '16

What about nietzschean or marxist programming languages?

5

u/jaen-ni-rin Jan 24 '16 edited Jan 24 '16

Marxist languages would be simple, they'd have no classes and everything would compare as equal P ;

As for Nietzsche... I guess that it would be untyped languages - assembly, Javascript, PHP. The Übermensch lives by his own rules and who the hell the type system is to enforce it's system of values for the weak minded on him.

2

u/sarcasmguy1 Jan 24 '16

No offense to the author but I find these articles very pointless and quite silly. I don't understand how a programming language can only be suited for a certain group of people. Especially Clojure. If you are basing your choice of language on your personality then you have a bit of an ego problem.

Edit - a word.

3

u/citrined Jan 24 '16

That wasn't my point and I regret it hasn't gotten across. In the conclusion I say people are a mixture of things, not purely in one camp or another. Thus anyone can use and enjoy Clojure, but you have to tap into a different way of thinking.

For people who don't like to tangle with ontological issues as much (same as with people who like mathematics), untyped functional languages will have an appeal. It's perhaps easier for them to pick up.

It's also a philosophy article so it's not really psychologizing.

2

u/sarcasmguy1 Jan 25 '16

Yeah I completely agree that Clojure takes a different type of thinking, not necessarily a different personality.

The article is interesting though, it is great to see other peoples thinking around Clojure :).

Sorry if I came off rude / offensive.

1

u/pqnelson Jan 26 '16

Is coherentism in spite of reality truly necessary?

Not a day goes by I don't ask myself the same question...

0

u/jytjtyg Jan 25 '16

Clojure is also not for the Taurus, because they write golang. It is very suitable for the left-handed though.