April 30, 2004

Learn a new language - J

It's good for you to learn a new programming language every now and again and the more you'll learn from it the better, so it's probably best to pick something quite different to any that you already know. Therefore, on the recommendation of Romilly Cocking, I've chosen J, invented by Kenneth E. Iverson - the inventor of APL. Romilly assured me that I'd be able to become proficient in a matter of only 2 or 3 years ;-)

J has really succinct syntax for mathematical things.

Some examples:
a list of the numbers 6, 4 and 9 is 6 4 9
each item in that list squared is 6 4 9 ^ 2
2 to the power of each item in that list is 2 ^ 6 4 9
a list from 0 to 9 is i.10
therefore, a list from 1 to 10 is 1 + i.10

J doesn't just handle one dimensional lists of numbers, but rather multidimensional matrices.
For example:

6 4 9 ^/ 2 3

produces a matrix of 6, 4 and 9 squared and 6, 4 and 9 cubed, i.e.:

36 216
16 64
81 729

that matrix with 1 added to every item is simply:

1 + 6 4 9 ^/ 2 3

produces:

37 217
17 65
82 730

Another cute example is a random lottery ticket generator (thanks to Adewale Oshineye for this):

sort 1 + 6?49

I've been learning by following the tutorials that it comes with - they are very good but sometimes goes off into mathematics that is way beyond anything I understand.

J also comes with graphing and some demo applications including solitaire! There's so much more but I won't be covering it here - find out for yourself.

Posted by ivan at 7:52 PM Copyright (c) 2004-2008 Ivan Moore | Comments (1)

April 23, 2004

Is "doctor" used more often for "bad guys" than "good guys"?

For fictional characters (that don't depend specifically on being medical), the use of "doctor" seems to me to be more associated with "bad guys" than "good guys". Dr Evil, Dr Strangelove, Dr Doom, Dr No, Dr X (from ActionMan!). After talking about this in the office, others have pointed out counter examples: Dr Who, Dr Xavier (X-Men) and Dr Watson, to name a few. This makes me feel slightly less stigmatized, and after all, "I didn't go to Evil Medical School [actually, Evil PhD University] for 6 years to be called Mister."

Posted by ivan at 8:25 AM Copyright (c) 2004-2008 Ivan Moore | Comments (1)

April 7, 2004

Smalltalk: truth and beauty

Last night I co-ran (with Tim Mackinnon and Steve Freeman) an "Introduction to Smalltalk" workshop for some fellow ThoughtWorks colleagues.

It reminded me (as a now sadly ex-Smalltalker) that Smalltalk is Truth and Beauty in a programming language.

There's very little in the language but what there is is great. It's really powerful, productive, terse and readable. Smalltalk is a big improvement over it's successors, such as Ruby and Python. Not only that, but rather than predict the future, Alan Kay invented it (along with the rest of the Smalltalk team at Xerox Parc in the 70's). Windows, networked workstations etc. that are now ubiquitous.

I've been trying out a few implementations: VisualWorks (commercial, multiplatform and very full featured environment and libraries) Dolphin (commercial, windows only and very easy to get on with) and Squeak (free open source, multiplatform and a vibrant community - Alan Kay is the lead of the Squeak team).

Posted by ivan at 12:42 PM Copyright (c) 2004-2008 Ivan Moore | Comments (2)

April 5, 2004

OT2004 : Soft Systems Methodology

Unfortunately, I wasn't able to attend all of Soft Systems Methodology - Learning an Approach to Requirements presented by Debbie Lawther and Rob Day because I had a previous commitment to go to Radical Computing presented by Peter Marks and David Harvey (also a really interesting session), however, the part of the session that I did attend has already had an impact on the way I work - I'm drawing more diagrams to help explain things than I did before the session. Here's quite a nice one page description of Soft Systems Methodology.

Posted by ivan at 1:00 PM Copyright (c) 2004-2008 Ivan Moore

April 2, 2004

OT2004 : Delegation in Java

The session Delegation in Java - presented by Erik Groeneveld and Willem van den Ende was really interesting and thought-provoking - it's about "true delegation" rather than what most people these days think of as delegation (which should possibly be better called "forwarding"). True delegation is where methods can be delegated by one object to another but the receiver (i.e. this) stays bound to the object doing the delegating rather than the object being delegated to.
The consequences of this are that using delegation allows you to do things like multiple implementation inheritance and dynamic inheritance (changing what class an object "inherits" from at run time - very good for implementing the State Pattern).

The presenters have written an open source library for delegation in Java called Delegator which they introduced in this session, and we did some hands-on coding with it during the session. Unfortunately, "true delegation" in Java is rather difficult and doesn't come out very neatly, but it's an interesting concept to get your head around. If you want to try a language that does it really well, have a look at Self

Posted by ivan at 4:47 PM Copyright (c) 2004-2008 Ivan Moore | Comments (2)

Joe introduces Ivan to blogland

Joe has generously set up an account on his server for my blog - many thanks Joe.

See textile for details on how to format this stuff.

Posted by ivan at 1:20 PM Copyright (c) 2004-2008 Ivan Moore