Solved

Project Organization and efficient use of memory

Posted on 2003-12-04
3
229 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

856 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