Archive for April, 2009

Learning Java and a Scheme program

Thursday, April 16th, 2009

In answer to my last post I encountered this interesting snippit:

Can you figure out what it does? Why it does it?
  1. (let* ((yin ((lambda (foo) (newline) foo)
  2.              (call/cc (lambda (bar) bar))))
  3.        (yang ((lambda (foo) (write-char #\*) foo)
  4.               (call/cc (lambda (bar) bar)))))
  5.  (yin yang))

In other news, due to this that and the other, I have to learn Java.  So far, I’ve not learnt much.  I’ve found out two interesting things.  First, threads are remarkably easy to make.  Now, I’ve never done threading before, so I’m wondering how easy it is to do in other languages I’ve used.

Second, Java code is far too long.  I’ve always been annoyed with “code generation” features for just this reason.  If you need to generate code, you’re doing something wrong, IMO.  Code completion, (as in function parameters and variable names) is fine since that’s for human legibility and saves typing.  But generating whole skeletons?  Puh-lease.

Kinda turned me off C# before I took a good look at it (one of these days, I tell you).

Reading code

Wednesday, April 8th, 2009

I’ve recently resolved to start reading other peoples’ source code.  However, I’ve noticed that everything I have sitting around falls into four categories.

  1. Stuff I wrote (not much)
  2. Stuff too large to read (i.e. Mozilla, Pidgin, OpenOffice  and most other things I use)
  3. Something closed-source (i.e. mu torrent, K media player, Abyss webserver)
  4. Something I hate (not much I haven’t deleted.  I’m tidy like that.)

So, if anyone has some not-too-big code they recommend I’d love suggestions.  Stuff you wrote is cool.  Stuff you didn’t write is cool.  Open source things you contributed a bit to is cool.  Stuff in C is cool.  Stuff in LISP is cool.  Stuff that’s elegant is cool.  Stuff that’s buggy and kludgy is cool.  Whatever.  As long as I can read it in a few days.