views:

235

answers:

4

I've been reading code complete, not far in yet but one of the things it talks about is PDL - a higher level design language, which you write each routine in before coding in the language of choice.

I wondered if anyone actually did this in real life? Another thing it says is to leave each line of PDL in the code as comments. Surely that is overly verbose commenting?

I've never used PDL in real life, apart from perhaps something similar called ISWIM for a university class but I've never used it when writing my own code.

Surely if you write every routine/method/whatever in pseudo code first you will end up wasting a lot of time?

+1  A: 

Surely if you write every routine/method/whatever in pseudo code first you will end up wasting a lot of time?

Not at all - planning out what you're going to do beforehand can save time. It forces you to think things through and refactor at the easiest stage (i.e. before you've really done anything).

You don't have to fully write each routine - just the key steps, to give you enough of a mental map of what each part will do, and whether you've planned for everything you need.


I've never heard about PDL (Program Design Language?) specifically though, and - after looking at it - it does seem to be wordy, ugly and too much effort, and I wouldn't recommend using it - stick to concise but readable pseudo-code.

Peter Boughton
A: 

I remember one of my lecturers I had during my Software Engineering degree in first year university refused to help students if they hadn't at least attempted some sort of Pseudo code.

A lot of people used to complain about it, but its a skill I aquired from him I find my self using most of the time while designing software. I always have a pad and pen next to me while coding! :)

Chalkey
A: 

Yes, I do. I did not realize that it is called PDL until I read the book, though. I called it pseudocode. The difference between pseudocode and PDL is not big - PDL avoids using target language constructs, which is not a big deal in practice.

I start with PDL if the routine is less than trivial.

BTW, McConnell uses word pseudocode instead of PDL in the second edition of Code Complete.

buti-oxa
A: 

I have used it occasionally. One reason for using PDL or pseudocode is to communicate an algorithm between analyst and one or more programmers used to different programming languages: it provides a least common denominator. Provided the code is clear I would not leave the pseudocode commented in the program unless the implementation is significantly more complex than the original pseudocode - perhaps if it is in assembler for example.

Piers C