OddThinking

A blog for odd things and odd thoughts.

Old schemes

Alan Green recently wrote about learning the Scheme programming languages. That brings back a few memories of learning Scheme as an undergraduate.

Write-Once Languages

My recollection of Scheme was it was the first of many “write-only” languages I learnt. A write-only language is where you have a stab at writing a function, and if it doesn’t work, you don’t bother trying to debug it. It’s just too hard. You throw it away and start writing it again from scratch. It tends to encourage very short function definitions.

(A few years later, I found myself working at another university, trying to help solve this exact problem – the difficulty in debugging functional languages.)

OO Concepts in Scheme

I was taught Scheme in an attempt to teach Object-Oriented concepts. I still see this as a rather odd choice; it rather felt at the time that the lecturer’s favourite hammer was Scheme and OO happened to be the nail he had been assigned to hammer into us. Scheme (certainly back then) had no language features to encourage any of the key features of Object-Orientation: encapsulation (except by convention), inheritance, defined interfaces.

I don’t think my lecturer’s explanation of OO made it any easier, either.

He described a Bank Account object, which had a balance, that could only be accessed through the Deposit and Withdraw messages. So far, so good. However, he explained that the balance was now secure against tampering because no other part of the system could modify it without going through the appropriate methods.

At the time, I was very confused at this was nonsense! The balance was hardly secure; it was stored in a list where anyone skilled in the art could directly access it and change it! It was much later before I understood the concepts more clearly, and could I understand that that he had confounded the concepts of encapsulation and security in the same example.

Scheme in the Star Wars Project

My favourite comment about the syntax of Scheme… well, LISP… comes from an old Usenet group post.

The post’s author explained that he had hacked into the top-secret computers of the (then topical and controversial) US anti-missile project, Strategic Defense Initiative, and to have seen the source code. Astonishingly, it was written in LISP!

To prove that this was true, and he wasn’t making it up, he posted the last 10 lines of code, as evidence:

)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Add commentCategories: Geek,Humour,Insufficiently Advanced Technology,S/W Dev
Tags: programming language, Scheme, software

No Comments

  1. No comments yet.
  2. Leave a comment

    You must be logged in to post a comment.