Fork me on GitHub
#beginners
<
2015-09-28
>
petrus11:09:53

Need some teaching advice for code. I want to start an initiative at work for everyone to start coding and JavaScript seems like the obvious go-to as the assembly language of the Internet, but it's so badly designed. Is Clojure a good idea as a first programming language?

xlevus11:09:30

people will be put off by braces

xlevus11:09:54

python is commonly used as a first language

xlevus11:09:27

simple, limited punctuation, range of libraries for varying skill levels

petrus11:09:13

You mean braces in JS?

xlevus11:09:22

braces/brackets in clojure

petrus11:09:38

Python has lots of syntax. These are non-coders who have no preconceptions of code, so I'm unsure if the Clj/cljs parens will be an issue.

potetm12:09:55

If they’re just learning for fun, I would absolutely just do clj.

potetm12:09:47

The initial learning curve is pretty steep, but, for an absolute beginner, it always is, so not a real net loss there.

potetm12:09:21

My biggest issues with language advice is when someone wants to make a living doing it. I pretty much gotta say “clj is the way things should be, but, unfortunately, you have to learn these other piles of crap to get a job"

dexter12:09:20

Don’t get put-off by the braces anyway, there aren’t actually more than JS or Java, its just that due to the structure and concise nature, it is a higher percentage of what you write. Actually try taking equivalent Java / JS / Clojure and removing all the code, just leaving braces (assuming the preferred form of using braces, i.e. you can do a single line if without braces, but don’t) you will find Clojure to be no worse than its compatriots. Obviously if you compare to something like python with very little brace usage that is a different story. But I have seen that demo done, and it is a good way to retire those mis-conceptions. In general though what I have learned is that people who start with a functional language like Clojure tend to be able to learn OO and imperative languages easily, however the inverse is not true, starting OO breaks your mind a little bit and makes functional work realllly hard.

rauh12:09:37

@petrus: For absolute beginners it's important to have quicky/easy results early on. For that I think http://processing.org is fantastic. It also comes with an IDE so it's super easy and a lot of fun. Otherwise python, yeah.

dexter12:09:35

Scratch is simple to get going with and give people quick feedback, python is not bad, but personally I think it encourages bad practices, the spacing as code is good for enforcing good presentation, but that’s where it ends, the “idiomatic” way to solve things in python is often horrific practice for example using falsyness to check for if something has been set is fraught with peril, my fianceé for example got caught out by the fact that midnight is also false, or was until recently, so it’s not even consistent, and that is only one of the many cases. I have also found python to be awkward on a Windows environment if you end up with both 2.X and 3.X. It’s certainly a traditional starter, but I’m not sold. Scratch if you want absolute basics, JS tends to be a good starter in that people can be playing quickly and producing fun and useful things like lots of people are up for making a website, as opposed to more scripty or backend languages where people will often get bored of seeing terminal apps very quickly, indeed many of them wont have even seen a terminal. We had a similar initiative at my place, the second we moved from simple JS / HTML our group halved and quickly dropped to 0, people just were not as interested in the backend. Of course Clojure and JS can do both, but it’s still likely too much for your average non-coder

petrus12:09:36

Hmm. Good points, @dexter. What about ClojureScript + figwheel or boot w/reload? That way they learn Clojure and they have immediate feedback w/o JS. There's an extra build step for publishing. The stack traces are hell, though. And I have to explain about Cljs -> JS.

petrus13:09:17

The big downside is that the resources for Cljs are lacking far behind those for JS/Python.

dexter13:09:07

yeah, same problem I think, we scared people off even just with git, build processes will be confusing, lisps with their odd way of even doing a simple add are a bit dodgy (by which I mean the unfamiliar polish notation), dodgy single files or folders are better, we just had people using Brackets which can run your site / has autocomplete etc and python -m SimpleHTTPServer for just simple files / folders. Another good option is http://caddyserver.com/ it will just serve the stuff in the folder.

gadfly36115:09:01

@petrus Do they have a background in Excel? If so, learning clojure isn't a huge transition - functional, prefix notation, etc. I was an analyst heavily using excel and learned clojure as a first language bc it made the most sense to how i was already thinking about problems.