Tuesday, February 2, 2010

6 Things I Want to Learn This Year


In the last few years I have found that software developers generally come in only three flavors:

1)The Rockstar:
In this case, I am not talking about the standard definition, I'm talking about the programmers who get by on talent alone. They come to a job and they know about as much as they are going to know. They may pick up a few tricks here and there, but they are good enough that they don't have to work at it.

2)The Jazz Man:
The Jazz man may not have been born with the most talent, but they never let that stop them. They continually work on their craft and try to be creative and inventive in everything they do.

3)The Pop Singer:
Everything they write is terrible and full of bugs. The UI may look nice on the outside, but on the inside, it's mayhem and confusion. This code will be impossible to maintain and they will usually only be around for a short period of time.

Since, I like to think of myself as a Jazz Man (programatically speaking), I decided that this year I was going to find 6 ways to become a better programmer. As a way of helping me along, I am going to blog about them as well. Along the way I will pass along the Websites I found useful (or not useful), the books I read, and some examples of the work I did.

While reading The Pragmatic Programmer , I came across a few ideas as to how I can become a better programmer and I decided that, every two months, I would actively try to take my knowledge of a subject to the next level. Here is my List:

January & February: Emacs
March & April: Bash Scripting
May & June :The LISP Programming Language
July & August : Regular Expressions
September & October : The C Programming Language
November & December : JavaScript

These are all tools/languages/ideas if which I have at least a fundamental knowledge. I am going to attempt to delve deeper and increase my comfortability with them in order to become a faster, more efficient programmer. This shouldn't be that difficult for me because I really do enjoy programming and I think that this will be a fun way to also help me reduce my addiction to TV!
Join me if you like, follow along and of course feel free to suggest some alternative methods/books/sites etc.

Labels:

Below is my New IGoogle Gadget, add it to your Home Page and keep up with all my latest Blog Posts!

Thursday, August 6, 2009

Feelin' Groovy

For the last six months or so, I have been spending some quality time with Groovy. For those of you who may not already know, Groovy is awesome! Groovy is a programming language that is an extension of the Java Platform. It is a scripting language that is similar to Ruby. Groovy uses a lot of the standard Java syntax and since it compiles down to Java bytecode, it can be used in any Java project and can supplement any Java applications that you may be working on. Groovy has been around, in one form or another, since it was created by James Strachan in August of 2003. Since then it has become part of the java standard (JSR 241).

The JSR describes Groovy’s place in the Java world as:

Currently the Java community does not have a standard JCP-sanctioned agile programming language for writing scripts and applications that interoperate with the entire J2SE platform.

Groovy makes writing scripts and applications for the Java Virtual Machine fast and easy. Groovy includes language features found in Python, Ruby, and Smalltalk, but uses syntax natural to developers that use the Java programming language. Because Groovy is based on J2SE, applications written in Groovy can use the full complement of J2SE APIs, and work seamlessly with other packages and applications written in the Java programming language

Groovy is a dynamically typed language that is not compiled until runtime. It's this reason that many Java developers use Groovy to build prototypes of thier programs. This speeds up development and because Groovy is a part of the JVM, it can easily be translated into Java. You don't even have to translate the Groovy code. You could just utilize it as part of a Java project:

Now there is even a project called Groovy Runner that will let you run any Groovy file on an Apache server the same as you would PHP. This lets you avoid the Java Web server all together!

The downside thus far has been the difficulty rating in Eclipse. I love Eclipse but using the Groovy plug in is buggy at best. However, you can save a lot of time over the life of a project, by using Groovy. Just something as simple as adding two random numbers together takes 50% less work and lies of code:

Java Example:

import java.util.Random;


public class AdditionFlash{

public static void main (String args[]) {

Random rnd = new Random();
int[] numbers = {0,1,2,3,4,5,6,7,8,9};
int random1 = rnd.nextInt(numbers.length);
int random2 = rnd.nextInt(numbers.length);
int addNums = random1 + random2;

System.out.println(" " + random1);
System.out.println("+ " + random2);
System.out.println("_____");
System.out.print(" " + addNums);

}//end main
}//end class


Groovy Example:

import java.util.Random;

def list = [0,1,2,3,4,5,6,7,8,9]

random = new Random()
random1 = random.nextInt(list.size)
random2 = random.nextInt(list.size)
addNums = random1 + random2

println " " + random1
println "+ " + random2
println "_____"
println " " + addNums

As you can see most of the boilerplate code that is commonplace in Java is unnecessary with Groovy. If you want to save time on your next Java project, perhaps you should give Groovy a try! There are plenty of resources to help you get started with Groovy, such as Groovy Podcasts, Groovy Books, Groovy Zone, and Groovy Overflow.

Labels: , , , ,

Below is my New IGoogle Gadget, add it to your Home Page and keep up with all my latest Blog Posts!