Over all these years of Software development, I came to really value the KISS principle, as the name of the blog suggests. Keeping up with a good programmer tradition of learning a new language every year, my journey took me from Ruby -> Groovy ->Now Scala. I used both Ruby and Groovy for rapid prototyping and where I feel it simplifies things that I am working on. Since I started to wonder in the Scala world, I started to feel strongly that Scala have chosen me over other of my favorites namely Ruby and Groovy, which by the way I still use and love. Writing programs in Scala feels so natural to me now that I really wish it is the only language that I work with. There are lots of Scala tutorials on the web and I won't be starting one. I recently came across an interesting site that talks about 99 things in Scala(http://aperiodic.net/phil/scala/s-99/). Most of problems has solutions in more than one way, which prompted me to blog about writing one and only one simple way of solving them. I will gradually work my way with them as my schedule allows me. Without much rant, here is the simple solution to first problem:
P1: Find the last element of a list
A: scala> List(1,2,3,4,5).last
res0: Int = 5
- P12: Decode run-length encoding
- P11: Modified run-length encoding that includes on...
- Installing Eclipse, Scala and Groovy in Windows 7
- P10: Run-length encoding of a list.
- P09: Pack consecutive duplicates of list elements...
- P08: Eliminate consecutive duplicates of list elem...
- P07: Flatten a list
- P06: Is a list palindrome
- P03 - P05: Find nth element, length, reverse a lis...
- How to simply sum values in a Map in Scala
- Best Note Taking Tools
- P02: Find the last but one element of a list.
- Over all these years of Software development, I ca...
- ▼ October (13)