Reputation: 7783
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?
Upvotes: 2
Views: 1833
Reputation: 11
I used it in the 1980s when I worked in defense. PDL is overkill for a solo programmer's weekend project of 1-1000 lines of code. But if you are developing a 10k-100k line of code system with a team of a dozen software engineers, it is excellent for defining preliminary software designs in a waterfall methodology. Also, it was designed for compliance with MIL-STD software development requirements.
Upvotes: 1
Reputation: 4251
Writing things in pseudocode is very useful and you end up with the documentation already written ;-). It would decouple your intentions from your implementation, that many times is a optimized hack specific for your language or environment. Maintainers in the future or people refactoring your code or translating to other languages would be very grateful to you when you keep that pseudocode in the documentation. I have never called PDL, also because PDL in Perl means Perl Data Language, a very useful package to work with large datasets as vectors or matrices like in R.
Upvotes: 0
Reputation: 11431
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.
Upvotes: 0
Reputation:
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! :)
Upvotes: 0
Reputation: 112150
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.
Upvotes: 1