jump to navigation

Program Development By Step-wise Refinement 26 April 2009

Posted by Oliver Mason in Apple, iphone, objective-c, programming.

DAY 5, and I’m making my first steps in Objective-C, other than keying in sample programs and trying little things out. It’s been such a long time since I had to worry about memory management, though it looks relatively easy, compare to original C. Still, would be better if one didn’t have to worry about it.

After I got into the Erlang mind-set with my most recent programming, I need some time to get back into C. I’m following a methodology I picked up more than 20 years ago, Wirth’s 1971 Paper on Program development by stepwise refinement, at least as much as I remember it. I haven’t read it since about 1990 I think. Basically you formulate your program in pseudo-code, and step-by-step get closer to actual code.

My first refinement step was to create a Stack class, which is little more than a wrapper around a NSMutableArray with just three methods: push, pop, and isEmpty. Trivial, but useful to practice getting used to the way things work in Objective-C. There is a lot which seems to be based on conventions, such as the names of mehtods which get called under the hood at various stages. Luckily there is plenty of material on the web to help you pick those things up!

As for my first app-project, a morphological analyser, I’m slowly getting there. The main part is probably about 50% coded, and the lexicon-lookup routine is still missing. I guess I’ll opt for a sqlite database here, seems like the most effective way to access that kind of data. But I’ll cover that in a later post.

Oh, and here is the reference for the Wirth paper:

  • Wirth, Niklaus (1971) Program Development by Stepwise Refinement, in Communications of the ACM, Vol. 14, No. 4, April 1971, pp. 221-227.


1. Program Development By Step-wise Refinement - 26 April 2009

[…] Original post by ojmason […]

2. » Program Development By Step-wise Refinement - 26 April 2009

[…] Go here to read the rest:  Program Development By Step-wise Refinement […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: