
Clojure from the ground up - Adrock
http://aphyr.com/posts/301-clojure-from-the-ground-up-welcome
======
laureny
> I want to convince you that you can program, that you can do math, that you
> can design car suspensions and fire suppression systems and spacecraft
> control software and distributed databases,

I know you are trying to help but you need to realize that the whole section,
and this part in particular, is incredibly condescending and guaranteed to
piss off any female who might be reading you.

You want to help achieve gender equality in the technical field?

Pretend that the gender of your reader is of no consequence and just write
your stuff, period.

~~~
acjohnson55
I agree that the part you quoted could come off condescending, but I disagree
with your prescription. We have plenty of resources for learning how to code
that make no gender assumptions, and yet we still have a glaring disparity. I
see little reason to believe that your suggested solution of writing
dispassionately about coding while avoiding elephant in the room of the gender
disparity, in a piece meant to address that, is the proper remedy.

~~~
devcpp
Agreed, it struck me as unique that the author says anything about women. I
have seen dozens (if not hundreds) of programming tutorials and that was the
first one that said anything about genders. The problem is somewhere else.

------
nicolethenerd
The "who is this guide for?" section seems a bit out of place here in an
otherwise technical document. While I appreciate the sentiment, studies have
shown that girls/women perform worse on tests if they are reminded that
they're female right before they take the test - I would imagine that a
similar effect might occur when learning Clojure (for any of the discriminated
groups mentioned in the welcome message). If someone has managed to find this
page, chances are they already know a bit about programming and don't need a
welcome message - no?

~~~
aphyr
Three reasons. First, I want to justify and contextualize the work in the
hopes of promoting more like it. Second, stereotype threat is ameliorated by
explicit acknowledgement of the effect. Third, I want to challenge implicit
assumptions about the audience of technical writing.

~~~
threeseed
You may have good intentions but this article was condescending, destructive
and self-serving.

You keep reinforcing these stereotypes about IT that (a) women aren't capable,
(b) men are antagonistic towards women (c) they will never be promoted or
accepted amongst their peers and (d) there is rampant sexism. These
stereotypes are not pervasive, not unique to just IT and simply don't exist at
many types of companies in particular many enterprises.

But don't worry women despite all of this you have come to save the day with a
beginner's Clojure article that will gain you the respect of your peers. Give
me a break.

~~~
mythz
Give yourself a break.

If you don't like how others are trying to raise awareness or encourage women
in IT, then get off your high-horse and do something yourself that you do
agree with. Sitting there lambasting others' efforts does nothing to improve
the situation.

~~~
andrewflnr
I'm getting really tired of this "go do something else" argument/excuse. Doing
something constructive yourself is not always a solution for someone else
doing something destructive. It's like the tu quoque fallacy, only good for
getting someone to shut up, proving nothing. Heaven forbid we should try to
prevent something bad from happening.

------
mattdeboard
I know I'm posting this after this article has peaked, but I did that on
purpose. Maybe you won't ever read this. Probably not.

Aphyr I really admired you dude until you decided to post extremely graphic
descriptions of your sexual activities on Twitter. I unfollowed you because of
it, and I assure you it has absolutely nothing to do with your personal
sexuality. I would've unfollowed anyone who posted what you did (hint: it was
the 'toilet-cleaning' tweet last week).

And now this blog post. My god. Assault against women is "routine" in STEM
fields? It's not routine, it's never been routine, it will never be routine.
You live in a social media echo chamber that you need to break out of.

You know what the tech community needs more than anything? Thought-leaders who
can teach the rest of us important, practical things about the technology we
take for granted every day. What we don't need more of: pandering,
condescending horseradish. I honestly will not be surprised if I get attacked
personally because of this post as a woman-hating or homophobic bigot. This is
the level of discourse now, unfortunately. Ergo why I waited until this post
had passed its peak to post.

Break out of your dumb echo chamber, it's decreasing your worth as a teacher.

------
ninetax
I have really really been getting into clojure lately. It's a functional
language that doesn't feel hard to grasp. But it can be way harder to make
sane comparisons between libraries and stuff with a community so small but so
active as clojure's.

My kingdom for a decent comparison between NodeJS+ClojureScript vs vanilla
Clojure (w/Compjure maybe?) for high performance web applications!

~~~
andrewflnr
If you mean a performance comparison, I would be surprised if Node (V8)
outperformed vanilla Clojure (JVM).

~~~
ninetax
Yeah maybe in general but what about a comparison for heavy IO applications?
core.async vs node's system?

I really hope Clojure catches on. It's so fun to write in, I'm never going
back!

~~~
graue
I'm not aware of a good reason to prefer ClojureScript+Node.js in general.
Maybe if you wanted interop with a specific Node library, but otherwise,
Clojure on the JVM will tend to have vastly better performance, and the
tooling is better.

For example, until recently ClojureScript's :keywords were just strings under
the hood and it required a string compare to test equality. Apparently this is
no longer the case due to this commit 2 months ago:
[https://github.com/clojure/clojurescript/commit/2cef52840fcd...](https://github.com/clojure/clojurescript/commit/2cef52840fcd9d88f077d374cc81e50c7e645b9f)
but it shows you the kind of stuff you might run into. In a recent talk I saw
by David Nolen, the lead maintainer of the ClojureScript compiler, he brought
up multimethod dispatch as something that can still be as much as 100 times
slower than the JVM.

As a tooling example, Clojure gives you helpful errors if you initialize
records the wrong way:

    
    
        user=> (defrecord Thing [foo bar])
        user.Thing
        user=> (Thing. 1 2)  ; correct usage
        #user.Thing{:foo 1, :bar 2}
        user=> (Thing. 1)    ; wrong number of fields
        
        CompilerException java.lang.IllegalArgumentException: No matching ctor found for class user.Thing, compiling:(/tmp/form-init7089728177345913731.clj:1:1) 
        user=> (Thing 1 2)   ; forgetting the dot
        
        RuntimeException Expecting var, but Thing is mapped to class user.Thing  clojure.lang.Util.runtimeException (Util.java:219)
    

That's good! Especially if you're new to the language. You see where you
messed up right away.

But ClojureScript just silently gives you nils:

    
    
        ClojureScript:cljs.user> (defrecord Thing [foo bar])
        cljs.user/Thing
        ClojureScript:cljs.user> (Thing. 1 2)  ; correct usage
        #cljs.user.Thing{:foo 1, :bar 2}
        ClojureScript:cljs.user> (Thing. 1)    ; wrong number of fields
        #cljs.user.Thing{:foo 1, :bar nil}
        ClojureScript:cljs.user> (Thing 1 2)   ; forgetting the dot
        nil
    

This should be a bug report against the CLJS compiler (edit: now it is[1]),
and it's probably not that hard to fix. I could fix it. You could fix it. (The
CLJS compiler is very approachable and needs contributors, by the way.) But,
especially as a newbie, this kind of stuff can bite you. JVM Clojure is more
polished.

1\.
[http://dev.clojure.org/jira/browse/CLJS-639](http://dev.clojure.org/jira/browse/CLJS-639)

~~~
masklinn
> JVM Clojure is more polished.

I wouldn't say that. In this case for instance it more or less just shoves
java's error message in your face, you have to translate that back into the
clojure you typed beforehand.

~~~
graue
OK, I can see the case for that nitpick. Perhaps neither implementation is
particularly "polished" in this regard, and the JVM one just happens to fail
faster due to a statically-typed host environment. Polished or not, though,
the end result is Clojure being more helpful when you make typos/newbie
mistakes.

------
WoodenChair
The guide appears to assume one is on Mac OS X or Linux without explicitly
stating as such (unless I missed it, in which case my bad). That's not good
for a world where most people programming on a desktop are on Windows (Mac
user myself).

~~~
aphyr
The linked leiningen page includes detailed installation instructions for all
platforms, including a windows installer.

~~~
makmanalp
Nice guide! Is there more coming? I also loved your explorations on network
partitions, keep up the good work!

~~~
aphyr
Thank you, and yes, there will be more.

------
leephillips
I've been playing around with clojure and clojurescript on my Ubuntu laptop
for a while now, but according to this guide I'm not ready to get started
because I don't have "javac" installed.

~~~
aphyr
It's not necessary for all development, but you'll want a java compiler for
later parts of the guide.

------
wolfeidau
Great tutorial, look forward to the next one.

Clojure, and indeed LISP is one of the things I would really like to learn but
most of the tutorials have been way to academic in there format. This one so
far has been much more focused and clearer on the intent of the language.

Thanks

------
sr-ix
I was just asking a friend of mine for some suggestions for starting up with
Clojure.

I loved your Jepsen series and you communicate on a level that I can relate
to. As such I was thrilled to find your guide at the top of HN.

Keep up the awesome work!

------
jackhammer2022
I love the thorough Guide to Programming in Clojure for Beginners:
[http://blackstag.com/blog.posting?id=5](http://blackstag.com/blog.posting?id=5)

------
mahyarm
Maybe you want to try light table. It's a pure gui experience, and is probably
easier than setting up lein. Currently free.

~~~
danneu
I think all noobs should still get lein. (Install it in 1 second with your
package manager)

That way they can run `lein new <project-name>` to get the app skeleton
created. Then open it with Lighttable.

In fact, anyone that wants to check out the Clojure version of Sinatra/Flask
should run `lein new compojure <project-name>` and it'll create it from a
template. Then run `lein ring server` from the project root to start the dev
server.

Someone happened to tell me those incantations my first day with Clojure and I
was instantly productive.

~~~
mahyarm
If a newbie knows what a package manager is and has it set up on their system,
then they're probably not the level of noob this article is going for.

------
sriharis
This first lesson was quite similar to Clojure in fifteen minutes:
[http://adambard.com/blog/clojure-
in-15-minutes/](http://adambard.com/blog/clojure-in-15-minutes/). I find both
pretty good, although this seems more promising. Waiting for more!

------
shn
IMHO, It would be better to seperate two distinct things into two seperate
articles. Your view in women in computing and intro to clojure.

------
daurnimator
Pointers to a good follow up?

~~~
tazjin
I've been compiling Clojure-resources for learning etc. at
[https://github.com/tazjin/clojure-basics](https://github.com/tazjin/clojure-
basics) \- maybe you find something that works for you?

