Procedure Function



 DEVELOP > c-Plus-Plus > Procedure Function

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Bryan Parkoff"
Date: 27 Dec 2007 03:45:28 PM
Object: Procedure Function
The C Compiler uses procedure function. It allows the programmers to
define global variables and global functions. They attempt to test using
debuging tools and often bugs are harder to find. If you use namespace, it
would be helpful to isolate global variables and global functions in the
right group.
The C++ Compiler allows local variables and local functions to be bound
inside struct or class. It makes easier to define one object as class so
all variables and functions can be manipulated inside class.
The problem is that this object has a pointer. You define class inside
main() function. You decide to execute an object. The pointer is placed in
the register and then pointer gives the memory address to locate variables
and functions. The procedure function does not need to have pointer.
Without pointer, it improves performance.
Can you please explain? Why do you prefer to design your project by
focusing to isolate variables and functions inside object as class? Why
can't namespace be used? Procedure Functions and OOP allow to be reuseable
if you want to run more than one object at the same time.
--
Yours Truly,
Bryan Parkoff
.

User: "Pavel Shved"

Title: Procedure Function 27 Dec 2007 04:03:36 PM
Bryan Parkoff:

The C Compiler uses procedure function. It allows the programmers to
define global variables and global functions. They attempt to test using
debuging tools and often bugs are harder to find. If you use namespace, it
would be helpful to isolate global variables and global functions in the
right group.
The C++ Compiler allows local variables and local functions to be bound
inside struct or class. It makes easier to define one object as class so
all variables and functions can be manipulated inside class.
The problem is that this object has a pointer. You define class inside
main() function. You decide to execute an object. The pointer is placed in
the register and then pointer gives the memory address to locate variables
and functions. The procedure function does not need to have pointer.
Without pointer, it improves performance.
Can you please explain? Why do you prefer to design your project by
focusing to isolate variables and functions inside object as class? Why
can't namespace be used? Procedure Functions and OOP allow to be reuseable
if you want to run more than one object at the same time.

Hmm... i thought it's my english that's bad... I've understood quite
few things, sorry.
You are curious why do we write
namespace X{
int a;
void f();
}
instead of
class i_wanna_be_a_namespace_X{
int a;
void f();
}
i_wanna_be_a_namespace_X X;
, right? The answer to this is that we're defining class if we want
it to be `instantized'. To be created, to be modified, to be allowed
to hold in hands. Class describes a `kind' and a way that entities of
this `kind' will live. Namespace is (but not `is only') a way to
manage how i access global variables, making it harder to mess
someone's else globals with my own as you (probably) said. We do not
`create' objects whose kind is described by namespace.
.

User: "=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?="

Title: Re: Procedure Function 27 Dec 2007 04:14:02 PM
On 2007-12-27 22:45, Bryan Parkoff wrote:

The C Compiler uses procedure function. It allows the programmers to
define global variables and global functions. They attempt to test using
debuging tools and often bugs are harder to find. If you use namespace, it
would be helpful to isolate global variables and global functions in the
right group.
The C++ Compiler allows local variables and local functions to be bound
inside struct or class. It makes easier to define one object as class so
all variables and functions can be manipulated inside class.
The problem is that this object has a pointer. You define class inside
main() function. You decide to execute an object. The pointer is placed in
the register and then pointer gives the memory address to locate variables
and functions. The procedure function does not need to have pointer.
Without pointer, it improves performance.
Can you please explain? Why do you prefer to design your project by
focusing to isolate variables and functions inside object as class? Why
can't namespace be used? Procedure Functions and OOP allow to be reuseable
if you want to run more than one object at the same time.

Are you asking a question? Because it seems to me like you answer your
questions with the last sentence. Anyway, for questions about OOP in
general groups like comp.object are better suited.
--
Erik Wikström
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER