Diary 3rd Day of Clojure

 

Yesterday I paired with Priya working on the 4Clojure challenges. I found the pairing extremely beneficial as we are both early on Clojure journey so we naturally questioned every aspect of the code.

I found it interesting how we both read the code in different ways but reached the same result. Unlike Java or Ruby where I’m comfortable reading, Clojure has me in a uncomfortable state where I’m questioning myself all the time. This is good, as it means I’m learning and surely improving. Although I’m now only my 3rd day, I am starting to see some improvements, hopefully there’s more to come.

Here are a few things I’ve learnt in my sure time with Clojure

This is a string

"a string"

Makes sense, almost the same in most languages

This is a keyword, reminds of Ruby’s symbol but with a different name

:keyword

I found this confusing at first because it’s different in ruby but I’m sure I’ll get used to not putting a colon in fron of a symbo, this is a symbol in Clojure

'symbol

You can use Java like methods within Clojure too, like this little gme

(string/split-lines “1\n2\n3”)

splits the string on new line, I can see that this may come in handy.

You also have other methods from the string namespace, such as join, reverse, trim and more.

My big achievement today was that I printed out a board to the screen, completed TDD. This was challenging and I don’t think I wouldn’t have done it without Daniel’s help.  We did the game of life together, it taught me a lot as I saw how he approaches problems in Clojure. He kept saying to me list list list. I’m learning quickly that lists are important in the world of Lisp based languages.

Off the back of that I was able to finally start my Tic Tac Toe game, really happy with the progress I’ve made today. The language still feels strange, but I’m happy it feels less strange than yesterday, I consider that a win.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s