Code should comment every line of codes?

Hi

I am totally noob in coding..
So i will require my developer to comment on the codes..
Normally how many lines of codes with one comment is consider reasonable?
note: for objective-c (iphone app)
royalgoldleafAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DmitriyCommented:
I think the more code comments the merrier. The issue here is readability of comments.  I think 1 comment per line is an overkill, so a summary of what is being done in the function plus any tricky spots should be commented, but the rest should assume that the reader knows basic programming.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Daniel Van Der WerkenIndependent ConsultantCommented:
Code should be self documenting.  Therefore, you might do:

bool isFileLoadComplete = false;  // does Objective=C have bools?  LoL

int numberOfLinesInFile;

char* applicationTitle;

etc.

That said:

If the person reading you code can easily figure out what's going on, then documenting it is redundant and unnecessary.  However, if you're doing something that's complex or crazy, you need to document it.  If you set up some weird array to have passed back by a function, you'd want to document the array structure and what each element means, etc.

I would have your programmer use good, descriptive variable names and document functions and tricky areas well just like Dmitriy suggests.


0
jacekmalinowskiCommented:
Description for each class and comment for each method in each class is enough.
Comments format could be prepared for DoxyGen (Source code documentation generator tool).
http://www.stack.nl/~dimitri/doxygen/

DoxyGen can generate nice documentation of Objective-C projects.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.