[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 571: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 627: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 1075: Cannot modify header information - headers already sent by (output started at [ROOT]/config.php:17)
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 1075: Cannot modify header information - headers already sent by (output started at [ROOT]/config.php:17)
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 1075: Cannot modify header information - headers already sent by (output started at [ROOT]/config.php:17)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5336: Cannot modify header information - headers already sent by (output started at [ROOT]/config.php:17)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5336: Cannot modify header information - headers already sent by (output started at [ROOT]/config.php:17)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5336: Cannot modify header information - headers already sent by (output started at [ROOT]/config.php:17)
Epitaph • Code Comments
Page 1 of 1

Code Comments

Posted: Fri Sep 07, 2012 1:52 pm
by drakkos
'Comments are a form of code repetition'

Discuss.

Re: Code Comments

Posted: Sat Aug 03, 2013 10:05 pm
by karras
You're a form of code repetition.

Re: Code Comments

Posted: Sat Aug 03, 2013 10:14 pm
by drakkos
Crikey!

Sent from my GT-N7000 using Tapatalk 2

Re: Code Comments

Posted: Sun Aug 04, 2013 12:00 am
by hugo
All right, settle down you two.

Re: Code Comments

Posted: Thu Aug 15, 2013 6:59 pm
by ror

Re: Code Comments

Posted: Thu Aug 15, 2013 8:29 pm
by mercutio
Code tells you what's going on, Comments tell you why

Re: Code Comments

Posted: Tue Aug 27, 2013 10:24 am
by drakkos
That's certainly an ideal case, but in my experience all comments really do in the end is tell you whyv code that doesn't work that way any more worked the way it did. Comment discipline is very low, with myself especially, and it tends to be the case I find that code changes and comments don't.

That's what I mean by code reputation... they double the number off places you need to make changes in code, and mismatching comments can lead to add much confusion as any code mismatch.

Sent from my GT-N7000 using Tapatalk 4

Re: Code Comments

Posted: Sun Aug 03, 2014 8:29 pm
by howando
I think there are two types of comments.

The "bad" ones are like pencil notes in the margin of a book where the printed text can be edited with no regard for the handmade marks. Stuff like "// max width" should probably be dealt with using descriptive variable names. A lot of "// centre the box with respect to the container" type of thing can also be rendered moot by descriptive variable names and good organisation/whitespace. The chances are that a bugfix or a rewrite will render these comments meaningless or even counter productive when encountered in the future.

There is a place for comments as definition of functions or blocks, like chapter summaries. Even though the code can change a little, the summary or abstract shouldn't be effected unless the purpose of the function or code block actually changes. If the purpose is changed then the comments become useless unless updated, but that's also true of any documentation you may have. If you assume that there ought to be at least some documentation on the code function and purpose, including these signposts in the code can allow the actual code makes sense.

Definitely "comment-as-you-go" leads to a lot of entropy, but including some comment on the code can make it a hell of a lot easier to understand what is supposed to be happening when you're updating or debugging.