This was my first week in my new job and on an iMac. I was looking forward to trying out OSX, I’ve seen OSX grow in popularity over the last year or two in the development community, a lot of the screen casts are done on Macs.
I was told by others in the office that I’d be sold on Mac within the first day or two because “its much better than Windows”. After a week on it though I still find OSX gets in the way. Read the rest of this entry »
I just found a blog post by Mark Dominus about design patterns being a weakness in a programming languages. I’d not given patterns enough thought to recognise this fact but when reading this it’s obvious.
It’s interesting to learn a little history about where some C based (inc PHP) syntax comes from, namely the $object->method() notation originating from C structs. As well as an example of (what was probably one of the first) design patterns from the 1950′s:
Recurring problem: Two or more parts of a machine language program need to perform the same complex operation. Duplicating the code to perform the operation wherever it is needed creates maintenance problems when one copy is updated and another is not.
Solution: Put the code for the operation at the end of the program. Reserve some extra memory (a “frame”) for its exclusive use. When other code (the “caller”) wants to perform the operation, it should store the current values of the machine registers, including the program counter, into the frame, and transfer control to the operation. The last thing the operation does is to restore the register values from the values saved in the frame and jump back to the instruction just after the saved PC value.
This is describing what we take for granted in every programming language today – functions.