miércoles, 22 de abril de 2015

An Introduction to Programming in Go - Book Review

I finished this book a long time ago...but somehow...I never wrote a review for it...sorry about that -:P

This was the first book I read about Go...and I have to say...I totally love it -;)

It's very concise and to the point with only 165 pages...more than enough to get your feet wet and nurture your interest in learning Go -;)

In a fast and nicely explained way, this book guide through Arrays, Slices, Maps, Functions, Concurrency, Pointers, and the Core Packages...

A good programming book doesn't have to be huge...doesn't need to teach you about every single command or technique...a good programming book should give you the basics...the elements that you need to start grasping the language itself and slowly build up so you can gain confidence and the start to move forward on your own...

I totally recommend this book to anyone learning Go...and I wish every programming language had a book like this...it would make beginners life much easier -;)


Development Culture.

The Way to Go - Book Review

I finished this book a long time ago...but somehow...I never wrote a review for it...sorry about that -:P

This book has 629 pages, so it's really big...

The book is really good and it's a really nice and comprehensive guide for anyone learning Go...

It's full...and I mean it...full of examples! -:D

And I might be getting picky here...but I would have appreciate more images -:)

The books of course goes along installing Go, explain it's syntax and touch interesting topics like Interfaces and Reflection, Error-Handling and Testing and hooking up with Google App Engine.

I would like to say more about it...but sadly...it's been a while since I finished it...so my last words are only...if you're new to Go...this is really good book to begin with...if you have some Go experience...it's up to you...


Development Culture.

miércoles, 1 de abril de 2015

LED is my new Hello World - Clojure Time

The more I learn Clojure...the more I like it...and I'm liking it so much that I couldn't help myself and start working on my beloved "LED_Numbers" application...

After making the Fibonnaci Generator app work...this one wasn't as hard as I expected...actually I think I'm slowly getting used to Clojure...which is always nice when learning a new language -;)

Here's the source code...

(def leds {"0" (list " _  " "| | " "|_| ") "1" (list "  " "| " "| ")
           "2" (list " _  " " _| " "|_  ") "3" (list "_  " "_| " "_| ")
           "4" (list "    " "|_| " "  | ") "5" (list " _  " "|_  " " _| ")
           "6" (list " _  " "|_  " "|_| ") "7" (list "_   " " |  " " |  ")
           "8" (list " _  " "|_| " "|_| ") "9" (list " _  " "|_| " " _| ")})

(defn toList [number]
 (map str(seq(str number))))

(defn get_led [x n num]
  (> (count x) 0)
   (concat (nth (get leds (first x)) n) (get_led (rest x) n num))
  (and (= (count x) 0) (< n 2))
   (concat "" "\n" (get_led (toList num) (+ 1 n) num))
  (and (= (count x) 0) (= n 2))
   (concat "" "\n")))

(defn showLED [num]
 (do (print (apply str (get_led (toList num) 0 num))))(symbol ""))

Wanna see it in action? Of course you want to -:)

Well...let's go back and keep learning -:D


Development Culture.

My first post on Clojure

My good friend and Programming Languages adviser Chris Whealy, send me tweet saying this...

I knew then that I needed to learn Clojure...after all...Chris was the one who get me into Erlang -;)

So...I started to read this book Clojure in Action so yes...you can expect a review later on...

I have experience with Functional Programming and specially with Lisp-like languages (Racket) so I guess my Clojure experience was going to be an easy one...nope...it's being fun but not easy as I thought...and not because Clojure's learning path is hard...but just because I keep thinking that it's pretty much like Racket when indeed its not so...

Clojure is a Lisp-like language...but being based on Java (on the JVM to be exact) it has some really "weird" things that take some time to digest and assimilate...but of course...that has never discourage me...I have learned Haskell after all...so no challenge is too big enough for me -;) (Ok...maybe ASM...but I'm planning to learn Fasm one of this days...)

As always...I couldn't get myself happy by just reading the book...I needed to write some code for it...and what better than a Fibonacci generator...

(defn fib [num a b]
  (and (> a 0) (> num 1))
   (concat [(+ a b)] (fib (- num 1) (+ a b) a))
  (= a 0)
   (concat (conj (conj [a] b) (+ a b)) (fib (- num 1) (+ a b) b))))

(defn showFib [num]
  (fib num 0 1))

Here's the screenshot..

Obviously...you can see that I based my code on my previous Racket code...but the only similarities that remain are the parenthesis...being a Lisp-like language...you can't expect no to use parenthesis, right? -:P


Development Culture.