Solved

Project Organization and efficient use of memory

Posted on 2003-12-04
3
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

732 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