« August 2005 | Main | October 2005 »

September 22, 2005

Talented Friends

One of my friends, Peter, has started selling prints of his photographs online. They are very impressive. I have been to some of the places he has photographed and they don't always look as good as they do in his pictures.

Posted by JohnC at 10:13 PM

September 11, 2005

Hello world. Here is pi. ...or was that Py?

Programming languages are the fundamental tools in a programmer's toolbox. Without them programming computers is next to impossible, requiring the use of machine code. The work I am doing now is mostly in PHP, Perl, and occasionally, Java. I have written a lot of Java code in the past, and Java is my preferred programming language. However, I bump into and ex-colleague, Mick, every few months and, when I do, he badgers me about giving Python a try. This weekend I did.

After the almost mandatory hello world, I decided to write a program to calculate the digits of π. I did something similar to this earlier in the year, when I flirted with Lisp, and I found it useful. It teaches you a lot about how a programming language handles numbers and how easy it is to implement numerical algorithms in that language.

What did I learn? Well, I learned that I like Python. The code (pretty printed here) came to under 70 lines and manipulating numbers was not cumbersome. The numeric operators worked fine with the huge numbers involved, apart from the division operator, /, which returned its results as floats and lost a lot of precision as a result. Fortunately, the integer division operator, //, did what I wanted, so this wasn't a problem. Once I discovered that, writing the program was pretty painless.

The generator feature of Python is really cool. A generator is a function that allows a programmer to lazy instantiate items in a sequence. When called it returns an object that has the iterator interface and calling the next() method on that object gets the next item in the sequence. I used a generator to calculate every second number in the Fibonacci sequence. The same effect could be achieved by creating a class. However, generators are concise, and feel more elegant.

I also discovered that the Python Cookbook is really good. Mick recommended it, so I bought it. I learned lots about generators from Chapter 19 and I expect I will be referring a fair bit to the chapters on XML processing, accessing databases, and string processing, as these activities make up the bulk of my coding tasks at work. I am looking forward to reading Chapter 20, on metaclasses and decorators.

All in all, from this weekend's dabbling, I am impressed with Python. Java might have some competition for my interest. It is a good job the two languages work well together.

Technorati Tags:

Posted by JohnC at 01:34 AM | Comments (0)

September 02, 2005

A Book On Career Development

Scanning through the postings on blogs.sun.com, I came across a review, for My Job Went To India (And All I Got Was This Lousy Book), on Frederic Jean's weblog. Fred's review fired up my interest, so I took a look at the book's webpage, and after browsing the sample chapters, I bought the PDF and dead tree combo. I downloaded the PDF this evening. The physical book will be shipped to me at the end of September.

The book claims to be about what programmers should do to protect themselves from off-shoring. It is so much more than that: it is a very clear and concise book about career development for software professionals. Every page advice that would be useful even if your job wasn't in danger of being sent to India. In fact, programmers in Bangalore would get as much from the book as someone in the USA or Western Europe. There is advice on how to choose which technologies to learn. There is advice on how to develop programming skills. There is advice on how to market yourself. There is even advice on how to manage an off shore team (surprisingly). All the advice is insightful and delivered clearly and briefly. If you are a programmer then My Job Went To India (And All I Got Was This Lousy Book) deserves to be on your bookshelf (when the physical book is actually ready, that is).

Posted by JohnC at 11:15 PM | Comments (0)