CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Complex, Large Project Coding

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

Complex, Large Project Coding
PostPosted: Sun Nov 04, 2007 8:10 pm     Reply with quote

I believe I've finally reached a cranial limitation on project size. I'm up to 11,000 lines (or so the compiler says) and 6 or 7 includes and I can't keep a running tab on what I'm doing and where, etc.

What do the pros use for organization, tracking, etc. Is there a text that presents an approach for project management?

I think most of the problem may have to do with my coding technique... sit in front of the computer and write from scratch, with little if any pre-planning or organization (spaghetti code at its best.)

I understand the basics of either top down or bottom up. But, there's got to be a better way to keep organized.

Thanks,

John
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 04, 2007 9:35 pm     Reply with quote

1. Use some variation of Hungarian notation so you can identify the data
type and the scope of your variables just by looking at them. This will
prevent a lot of mistakes.
http://en.wikipedia.org/wiki/Hungarian_Notation

2. Use a lint program to find coding errors.
http://en.wikipedia.org/wiki/Lint_%28software%29
Guest








PostPosted: Sun Nov 04, 2007 9:36 pm     Reply with quote

Yep - it's just so darn fun to sit down and code! Who needs to think. :-)

Steve McConnell's book Code Complete is the best book ever written on code as far as I have found.

Clearly this is a universal problem (check out the broken updates at CCS)

I also have a program that just went through a revision and I found myself qualifying some data, the same data, in three different ways! Yikes! What was I thinking?! Well I was working on it on and off and I forgot what I had done.

About the only thing I can do to make this situation better is to make include files of canned routines - that I will not touch - then I write a users guide that I can refer to when I need one of those functions.

This is encapsulation and is what Active X, COM and DLL's were all about. Repositories of known working code that don't change (except for bug fixing).

You can also study "refactoring" as a method - this can be a useful way to think about the inevitable - re-coding cuz things got out of hand.

Another problem with maintaining code is - well it grows as it ages - people want this feature and that feature or they don't want this special case, etc. This leads to all sorts of 'if-then-else' statements in the code - even if the maintenance was very well done this happens, because it grows just one feature at a time and this is the fastest way to add or delete a feature.

Eventually you just have to say enough and the - next feature is going to require a large chunk of time to 'refactor' the code to make it understandable again. The boss won't like the extra time, but he will be caught like a Racoon washing a 'shinny object' in a stream when you use big words like re-factoring! ;-)

Well hang in there - we all do this - you just have to decide when it's time to, well.... Start Refactoring.....

;-0

HTH - Steve (Been there, done that) H.
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Mon Nov 05, 2007 10:28 am     Reply with quote

PCM,

Thanks, I'd never heard of Lint. I'm going to spend some time poking around on the links. What Lint software do you use/recommend?

I'd gotten use to Hungarian in VB, mainly because it is usually included in the instructional material. But I have gotten away from it in C. I think I'll make a point to start using it again.



Steve,

I'll get my copy of Code Complete out and dust it off and look through it again. I've heard the term refactoring, but never thought of it as a particular method. I'll do some research.



Thanks,

John



EDIT:

I found your post regarding LINT. Thanks. I'll give it a try.
tavioman



Joined: 22 Feb 2006
Posts: 65

View user's profile Send private message

PostPosted: Wed Nov 07, 2007 1:32 am     Reply with quote

I alwayas use a third party IDE. In fact I use Micr***t Visual Studio as IDE.
You can organize code the best with this IDE. The only draw back is the compiler output format, that is not compatible with VS IDE. Maybe CCS will think on the format posibilities of the output of their compiler.
Hi-Tech's compiler on the other hand has an output that you can format as you wish.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

MS Visual Studio
PostPosted: Fri Nov 09, 2007 3:16 pm     Reply with quote

tavioman wrote:
I alwayas use a third party IDE. In fact I use Micr***t Visual Studio as IDE. You can organize code the best with this IDE. The only draw back is the compiler output format, that is not compatible with VS IDE. Maybe CCS will think on the format posibilities of the output of their compiler.


I like Visual Studio (VS) a lot too. I also think that the CCS compiler lack a lot of productivity features. Thank goodness, at least we should be getting a linker in V4.

How do you hook up the CCS compiler to VS?
How do the incompatibilities in the CCS compiler output manifest themselves?
Were you able to add the debugger to this mash-up?
_________________
Read the label, before opening a can of worms.
tavioman



Joined: 22 Feb 2006
Posts: 65

View user's profile Send private message

PostPosted: Fri Nov 09, 2007 3:36 pm     Reply with quote

Hi.
I have folowed this thread:

http://www.ccsinfo.com/forum/viewtopic.php?t=29216&highlight=nmake

For debug I use Proteus, I don't use hardware debug... For this purpose I'm using a lot of printf in the software.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group