(+ 1 2 3 4 5)Ruby
1 + 2 + 3 + 4 + 5In this example, I have to say Clojure wins on account of simplicity. It is easy to read and write this statement. I don't know if you can get any easier than this.
Enough background, here is how I would have started to learn Clojure:
- Blackstag - It is a really simple guide to get you started. You will not learn everything you need, but it's a good place to start. (I skipped installation because it's already installed on my computer so I'm not sure if it's still relevant.)
- Clojure API - I read most of the methods in here. It will help you become familiar with what Clojure has to offer.
- Roman Numerals Kata - Write your own roman numeral kata. I looked at others to see how they do it. Look up keywords that you don't understand.
- Read other people code. I look at several Clojure implementations of TicTacToe because mainly I have to write it. But it really helps because I have an idea of how the game is suppose to work. That is not to say I read and understand everything I read. Anyway, here's a list of Github you want to checkout:
- Rylan Tic Tac Toe
- Micah
- Colin
- Wai Lee
- Clojure Cookbook - I didn't look at it, but it sounds promising.
- Clojure Docs - This is my best friend once I got an idea of what function I want to call.
Note: I recommend using Emacs with rainbow parenthesis when you write Clojure code. If you are writing in Clojure, it is worth the time and effort to learn how to use Emacs.
I got most of my Clojure Tic Tac Toe code done by reading Blackstag, Clojure API, and others code. I am much more comfortable with the language now.
0 comments:
Post a Comment