babellog

Tuesday, August 31, 2004

LISP - Help

I am trying get myself familiarize with LISP. I have the Little LISPer with me. Downloaded LispWorks personal edition. The problem is getting commands work :-) There is a command "car". The way I am issuing the command is

car ('x 'y 'z) in the prompt

and here is the stack trace

Error: Syntactic error in form ((QUOTE A) (QUOTE B) (QUOTE C)):
Illegal function name (QUOTE A).
1 (abort) Return to level 1.
2 Return to debug level 1.
3 Try evaluating ATOM again.
4 Specify a value to use this time instead of evaluating ATOM.
5 Specify a value to set ATOM to.
6 Return to level 0.
7 Return to top loop level 0.

Type :b for backtrace, :c

Thursday, August 26, 2004

Open Mind?

Python is definitely good, in the days before I knew of Python's existence I used the UNIX utilities but the down side of this was that I needed a *I*X box or cygwin(never used). Python came along and changed everything. I thought Python was the solution to all my problems, cross platform support and only your imagination could limit what you do with it.

I guess that was taking a step in the wrong direction. Restricting oneself to one language IMHO is suicidal. How ever I think most people in Sri Lanka are quite happy knowing just one language either Java or one of the .NET possibilities. Working in the fringes of software development has given me the opportunity to play around with a lot of different things (shell scripts, Awk and sed) out of necessity rather than desire.

What I have realized now is that although Python is really neat and offers most things imaginable its definitely not the best for everything. Therefore now, my personal belief is that there is no best language for everything and furthermore your language choice would be determined by factors such as how fast you need it, level of skill, code maintainability, speed, and maybe platform (to a lesser degree now) .

How fast you need it and the level of skill are related I guess, and in most cases code maintainability is not a factor for sudden ad-hoc scripts.

But then again there is the possibility of becoming a Jack of most languages and a master of none.


Sunday, August 22, 2004

Java & Zero base

I was working on this mediation stuff, where I get a binary file in EBCDIC
format (yes it’s still out there) which contains the call data records, and I was suppose to do some mapping. It became interesting when the Call End Date needs to be calculated, by using the Call Start Date and Call Duration.

So I resorted to GregorianCalendar class in Java where I could add seconds to existing date. So I just passed all the information I had to the constructor to create the date object.

GregorianCalendar(int year, int month, int date, int hour, int minute, int second)

When I looked at the output file even though I was handling a file generated in April, the date was May. Then of course when I looked at the API, it had

month - the value used to set the MONTH time field in the calendar. Month value is 0-based. e.g., 0 for January.

I don’t think programmatically it would have been very difficult for anyone who designed the API to make the months 1 based instead of zero based, but it looks like having zero based months comes from C language time.h library days.

Here is an interesting read on Java & Zero base :A foolish consistency

Thursday, August 19, 2004

good, better, best

Linked from here.

Programming = C
Programming Language = Python
but

Best Programming Language = ?

Read the first comment :)

*disclaimer: this might be altered at future dates. It's a link to Google search results, after all.

Tuesday, August 03, 2004

a mouthful of pie

One year ago, Dan Sugalski bet Guido van Rossum (the creator of Python) that a pure Python benchmark would run faster when executed by the Parrot engine.

He lost.

The result: Pie-ton, Dan submitted to being pie-ed in the face by Guido.

because pie is better than a punch, any day of the week.