Hacker News new | ask | show | jobs
by kapv89 3571 days ago
- Read SICP

- Understand how all programs can be written as lists of lists of lists... and so on

- Pick up the language that you work in. Identify what construct of that language allows you to approximate scheme/lisp lists. For me this is objects in java & php, and functions in javascript

- Code your program as a list of lists of lists... in the language of your choice.

- Congrats, you got OOP

1 comments

Doesn't SICP stress closures more than lists? (And this list-heavy approach only really works in a dynamically typed language.)
I have used it just fine in Java. "dependency injection" looks a lot like lists-of-lists...

And SICP talks about a lot more than any particular constructs. Its the sort of book you can come back to, and take what you need to go further.

I've recently actually done the latter, and gone back to SICP. Alas, it shows its age badly: it's too untyped for my tastes these days.

Yes, you can emulate dynamic typing in statically typed languages---but why would you want to if the static type system is expressive enough? (I can see how in Java dynamic typing might be the smaller hassle.)