?
Solved

Project Organization and efficient use of memory

Posted on 2003-12-04
3
Medium Priority
?
248 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 200 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

Technology Partners: 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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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.
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.
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 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