Jocka Posted November 28, 2006 Share Posted November 28, 2006 When creating an application, I catch myself writing numberous comments for small things and nothing for large things.Should I write comments for everything or not write comments at all? I feel that if someone is purchasing my product that they have the right to know where to look for a specific function or area of code.Of course at the same time I don't want to take 100 lines of the php page just to have comments. Quote Link to comment https://forums.phpfreaks.com/topic/28783-comments/ Share on other sites More sharing options...
itrebal Posted November 28, 2006 Share Posted November 28, 2006 If you feel you won't be able to come back and figure out what it means in a month [ie: its purpose is not obvious] then comment it. A recommended method is using the methods for phpDocumentor. Quote Link to comment https://forums.phpfreaks.com/topic/28783-comments/#findComment-131775 Share on other sites More sharing options...
Jocka Posted November 28, 2006 Author Share Posted November 28, 2006 I'm not sure what phpDocumentor is but after looking it up, it creates html chm and other files, correct?Would it be better to just write readme files with each script to let the user know where to look and what does what? That way it doesn't actually take up space in the application.. Quote Link to comment https://forums.phpfreaks.com/topic/28783-comments/#findComment-131781 Share on other sites More sharing options...
neylitalo Posted November 29, 2006 Share Posted November 29, 2006 In my experience with phpDocumentor comments, if you're creating a professional application that could feasibly get very complicated, it's well worth the four or five lines of comments per method. Of course, for simple mutator and accessor methods, you may not want to put much documentation in, as you usually know exactly what it does just by looking at the method's name. Quote Link to comment https://forums.phpfreaks.com/topic/28783-comments/#findComment-131945 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.