UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C++
  • » How to represt templates in Pseudo code

#1 2004-10-15 12:41 PM

shiva
Member
From: INDIA
Registered: 2002-08-10
Posts: 94

Re: How to represt templates in Pseudo code

How to represent the templates while writing a pseudo code?
Post some examples / any discussions on this topic is highly appreciated.

-Shiva

Offline

#2 2004-10-16 03:00 AM

Nope
Administrator
From: Germany
Registered: 2004-01-24
Posts: 385
Website

Re: How to represt templates in Pseudo code

I really don't understand what you mean exactly....

But, a template, be it a function or a class template is at the end nothing
but a very flexible kind of normal function or class. So you'd represent it
as exactly that?

Offline

#3 2004-10-18 04:55 PM

shiva
Member
From: INDIA
Registered: 2002-08-10
Posts: 94

Re: How to represt templates in Pseudo code

Nope, thanks for yr reply. like conventional pseduo code writers how shall represent templates also in this.

For example, if a variable undergoes ten iterations..then we shall represent like this

int i;

for(i=0; i<10; i++)
 do something with i

like this, if we have template..how shall we represent in the psuduo code. We are preparing coding standard document along with pseduo code writing styles..we need to represent the best way for templates.

Offline

#4 2004-10-18 07:06 PM

Nope
Administrator
From: Germany
Registered: 2004-01-24
Posts: 385
Website

Re: How to represt templates in Pseudo code

I really don't get it. You normally use pseudo code to get away from
implementation specifics, at least that's what I do. So let's say you have a
template class that provides the functionallity of a stack, don't you just
write something like "store value on stack"? If you write the pseudo code
for the template itself you don't use int, uint, struct or string within it but
write for example "add data to linked list". Beside the fact that a template
will be re-written by the compiler during compile time to work with the
datatype in question, it is the same code as a normal function/class.
I'd also never use statements like for or while to represent a loop, I'd use
something like "repeat 10 times", "repeat for all possible cases" or "
repeat ... code ... until condition is reached".

I haven't learned uml, back when I studied we used flow charts and the
like to describe code in an abstract way. But you might want to google for
something like that to get a better idea.

Offline

  • Index
  • » C++
  • » How to represt templates in Pseudo code

Board footer

Powered by FluxBB