Friday, July 27, 2012

Groovy Vs Python and Ruby - Performance

I just happened to come across this article and I found it really interesting. It was often thought that due to a lot of runtime dynamic invocations made by Groovy it would be a lot slower in comparison to other dynamic languages but after the reading article below Groovy aint that bad after all. In fact it does a pretty decent job!!!

http://keyzero.wordpress.com/2010/05/26/groovy-vs-ruby-vs-python-performance/

Another interesting comparison between Groovy and Python

http://hammerprinciple.com/therighttool/items/groovy/python


Thursday, February 26, 2009

Hello World in Various Languges

C++
----

#include
using namespace std;

int main()
{
cout << "Hello, World!\n";
}

Java
----

class HelloWorld {

public static void main(String [] args) {

System.out.println("Hello World");
}
}

Erlang
------

-module(hello).
-export([hello_world/0]).

hello_world() -> io:fwrite("Hello, world!\n").


Groovy
------

println "Hello, world!"

Ruby
-----

puts 'Hello, world!'

Scala
-----

object HelloWorld with Application {
println("Hello, world!")
}

Even though this is a very simple program in different languages Ruby and Groovy stand out from the rest in terms of language simplicty.

Great Books for Developers

Here are some great books that are a must read for anyone who wants to be a great programmer.

1) Pragmatic Programmer - Dave Thomas and Andy Hunt
2) Refactoring - Martin Fowler
3) Design Patterns: Elements of Reusable Object Oriented Software - Erich Gamma
4) Compilers: Principles, Techniques and Tools - Alfred V. Aho, Ravi Sethi and Jeffrey
5) Effective Java - Joshua Bloch
6) Test Driven Development by Example - Kent Beck
7) Productive Programmer - Neal Ford
8) Smart and Gets Things Done - Joel Spolsky
10) Programming Pearls - Jon Bentley
11) The Art of Computer Programming, Volume 1 - Fundamental Algorithms

I have personally read all of them but they are certainly in my To-Read list.If I have missed out any great books please feel free to add them.

Tuesday, December 9, 2008

Spring Acquires G2One (Company behind Groovy and Grails)

I happened to stumble across this and I thought I would post it here for my blog readers.

Spring Getting into Groovy


Happy Reading!!

Friday, December 5, 2008

Checked Exception Vs Unchecked Exception

How do you decide what type of Exception to throw? Should you throw a Checked Exception or Unchecked Exception? Well here are a few questions to consider whenever you come across such a situation which will help you make a better decision

1) Does your code have to handle the errors or report the error according to a specific custom error defined by your application?

2) Is the error recoverable ? Do you have an alternate way of recovering from the error?

3) Are you designing an API ?

If your answer to the above questions is "YES" then you definitely need to work with checked exceptions.Simply put Unchecked exceptions are generally used to determine programming errors or situations where it simply makes no sense to recover from an error situtation. Unchecked exceptions are also used when you are working with third party API's where you really have no control over them.

One more thing there are situations which will justify both scenarios in that case I generally follow this rule "When in doubt go with Unchecked Exceptions".

Thursday, December 4, 2008

Guice - A Lightweight IOC Container from Google

Guice is pronounced "Juice" and yea its a lightweight dependency injection framework for Java 5 and above brought to you by Google. Now why would anyone ever think of coming up with another IOC container when an awesome IOC container like Spring is around ? Hmm.. Good question aint it :) This time I want my readers to post their thoughts and opinions on this before I give away my thoughts on "Why Guice".

You can download Guice from Guice

Will share my thoughts in my next post until then I will looking forward for some responses.

Wednesday, December 3, 2008

Learning a new programming language

Hmm... Frankly I believe that there is no ONE way to learn a new programming language in fact it differs from person to person according to their programming styles and intellect. Some like to get hands on right away and some like to read a book before they get hands on and there are some who read and write code parallely.

Personally I believe in learning by example via Unit Tests. So if I decide to learn Ruby then I would go ahead and start writing programs in Ruby by writing unit tests.
After working with JUnit and being a Java developer I have understood the importance and value of Unit testing. Unit testing is a neat way of knowing that your programs work and also it is the best form of feedback one can get about their code.

When you are learning a new language by writing unit tests you are actually building a knowledge base that you can always look back to refresh your knowledge and understanding at any given point of time. So cool aint it :)

Simply put get hold of a Pragmatic Book on a programming language of your choice and start learning by writing tests and you will find yourself at ease very soon with the new programming language.