Procedure Function

B

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.
 
P

Pavel Shved

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.
 
E

Erik Wikström

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top