Solved

Project Organization and efficient use of memory

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 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.

707 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