21.08.2013 Views

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

396 Chapter 32 ■ Conclusion<br />

may have written some time ago that is in some way similar to the new program. They<br />

retrieve the listing and copy those parts that are useful. Another similar approach is to<br />

use memories of old programs. Experienced developers build up Aladdin’s caves of<br />

memories of the designs that they have created. The provision of catalogs of reusable<br />

design patterns explicitly exploits this approach.<br />

No review of approaches would be complete without a mention of hacking. As we<br />

have seen, this term has two distinct meanings. One meaning describes the act of getting<br />

admittance to a secure computer system in order to steal money or secrets or to<br />

cause mayhem. The other meaning, used in this book, describes a style of programming.<br />

Hacking means plunging into a solution to a problem without any design whatsoever.<br />

A hacker takes the program specification and immediately starts to write down<br />

programming language instructions. Probably the hacker will not even pause to write<br />

them down – they will immediately start to key in instructions to the computer.<br />

Hacking makes use of intuition, creativity and individuality. It dates from the early days<br />

of programming, when programming was regarded as an individual creative act and<br />

when there were no well-established design methods. Nowadays hacking is often<br />

frowned upon as being unsystematic and undisciplined. So hacking is either famous or<br />

notorious, depending on your point of view. One of the places where hacking still has<br />

some credibility is in open source development (Chapter 25).<br />

LISP programmers have long championed a design strategy which lies somewhere<br />

between hacking and the disciplined approaches described in this book. Perhaps this is<br />

because the application areas in which LISP is used (such as artificial intelligence, AI)<br />

demand an exploratory approach in which programs may be written in order to try to<br />

demonstrate a theoretical premise. Thus AI tries to solve “ill-<strong>for</strong>med problems” – it is<br />

difficult to determine when (or if) we have solved such problems, because they are only<br />

partially understood. Moreover, LISP programmers regularly embark on the design and<br />

construction of programs they don’t know how to write. This kind of exploratory programming<br />

clearly requires a great deal of help from the language and its programming<br />

environment, and a flexibility in the way in which ideas can be expressed which is not<br />

found in such languages as Java and C.<br />

For example, in LISP you can use variables without declaring their type, or define<br />

functions which can take arbitrary numbers of arguments. You can define and use functions<br />

which call other functions that haven’t been written yet. You can edit, test and<br />

debug a program incrementally even while the program is running. And, very importantly,<br />

LISP blurs the distinction between program and data – which is the reason <strong>for</strong><br />

LISP’s much maligned bracketed syntax. It is this dynamic, rather than static, approach<br />

to program construction which enables and supports exploratory programming. Erik<br />

Sandewall has described this method of program development as structured growth:<br />

“An initial program with a pure and simple structure is written, tested, and then<br />

allowed to grow by increasing the ambition of its modules. The growth can occur both<br />

horizontally, through the addition of more facilities, and vertically through a deepening<br />

of existing facilities”. Sandewall argues against the view that this could be considered<br />

as hacking under another name, on the grounds that “even if some kinds of<br />

program changes are dangerous and/or bad, that does not prove that all of them are”.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!