Solved

Project Organization and efficient use of memory

Posted on 2003-12-04
3
216 Views
Last Modified: 2010-04-02
I have a good foundation in programming and am currently working on a large win32 program complete with user interface, etc.  That said, my code is very unorganized and (my guess would be) inefficient as I am a self taught programmer.  I can always get things to work, but usually it usually involves creating large numbers of global variables.  Where can I learn to be more efficient with memory use and how to use object oriented programing more effectively?  I would prefer a free source such as an interent tutorial, but book titles would also be appreciated.

Thanks
EM
0
Comment
Question by:eamarks
3 Comments
 
LVL 2

Expert Comment

by:sin_
ID: 9880466
hi,
You are facing a quite general problem since you started your programming with C.
C++ gives you the objects, which are easy to use and organize.

You asked about the global variables.  C++  doen't have much of extern variables. Instead, it prefers making a class variable as static.

If you want the tutorials' links, I would suggest you to have a look at google with search params as "C vs. C++". You can also read "Design Patterns" by GOF.

If you have any specific questions , please ask.

-sin
0
 
LVL 1

Expert Comment

by:Hoegje
ID: 9880964
And maybe you could take a look at this site, to download a free electronic version of Bruce Eckel's book(s) Thinking in C++ (and Thinking in Patterns if needed)

http://mindview.net/Books/DownloadSites
0
 
LVL 2

Accepted Solution

by:
MattWare earned 50 total points
ID: 9884981
Absolutely grab the Design Patterns book, but I also recommend ANY book by Booch, Jacobsen, Rumbaugh, and Krutchen (yes, the rational team).  Specifically:

Object-Oriented Modeling and Design by James R Rumbaugh
Object-Oriented Analysis and Design with Applications (2nd Edition) by Grady Booch

If your issue is trying to organize your software better - both at the architectural AND at the coding levels - you need to focus more on design analysis than coding practices.  Iterative development strategies prevent you from making major design decisions once you've passed the coding "point of no return" where you are unable to spend the time on a different design.  Divide your project into small isolated components and begin the design and coding of the most difficult first.  This will help force out design issues before you've already invested and committed a large amount of time down a path you took before you really were able to see the whole problem.  Also, keeps you from having to throw in hacks like globally scoped variables to solve problems that would have been more cleanly dealt with iterations.

As one who also was a self-taught (and not well-organized) programmer and who now works as the chief software architect for a telecom company, I would advise strongly that you avoid looking to solve problems with your C++ and instead focusing on solving your problems with good OO design.  You'll be amazed when you begin to reimplement the same design again and again to solve common problems efficiently regardless of the platform you may be operating on.

Finally - get a CASE tool.  A model is anything that makes a complicated problem simple.  UML design documents not only allow me to organize our systems before coding begins, it also allows us to quickly and easily support (god forbid bugs sneak through ;P) as well as put us in a position to easily locate what needs to change for version 2.

Cheers.
--M
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now