|
Can any one suggest what is the best way to write good code that is understandable without a single line of comments?
Started by pang on
, 21 posts
by 21 people.
Answer Snippets (Read the full thread at stackoverflow):
Every time you write a comment, you should grimace are doing it is too complicated....
You find yourself in a position where you need to write a comment, think it through and see whether in code, you should pat yourself on the back.
|
|
Hi I have like 50 pages of code that I should write comments to it ... Can you guys show me the best way. I meant I need you to write me a sample ... the comments should contain nearly everything (classes, constructors, attribute, methods, events, functions...
Started by Tony on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
It's much better to comment the code with a higher-level view of what the code aims to ultimately achieve....
It's largely useless to comment assignments with "assign x to y" or similar.
Good comments will document intent , not function.
|
|
I'm really just curious, but if someone wants to make an argument that one is better than another - go for it!
These are comments for example of writing style only, not meant to be judged by their content!....
First Person "I" comments:
//i'm setting ...
Started by TheSoftwareJedi on
, 13 posts
by 13 people.
Answer Snippets (Read the full thread at stackoverflow):
If it's a group project I'll usually sign that comment so people can come to me.
Logic or pattern.
|
Ask your Facebook Friends
|
I was able to find a page from Safari Books Online that provides a template , but having never written POD comments, I'm not sure how good it is or if it is missing anything that might be considered convention to include.
What are the conventions to follow...
Started by Thomas Owens on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
That's probably your best....
It also talks about CPAN conventions.
The whole of Chapter 7 covers documentation, using POD, and the best approaches to documentation for modules, large projects etc .
There are a set of recommendations in Perl Best Practices .
|
|
Possible Duplicate:
Is it possible to write good and understandable code without any comments?
When coding often I hear that if comments are needed then it means that the code is too hard to understand. I agree that code should be readable but often the...
Started by Zubair on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
So after a while the comment is not simply useless, but it is misleading" is most often not worth documenting....
The main reason why any other kind of comments is not very in the corresponding code.
Implementation details in a comment.
|
|
I'm tired of writing comments that look like this
{ # bla bla blabla bla blabla bla blabla # bla bla blabla bla blabla bla blabla bla blabla bla blabla bla bla # blaaa bla }
I have to manually wrap the lines and take care of the # as well. How do emacs...
Started by Samuel Danielson on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
M-q is generally mapped to fill with comment-auto-fill-only-comments (the latter is from newcomment.el )..
Selecting the comment and hitting M-q will usually reformat it.
|
|
I'm looking for a diff/compare tool that shows differing lines from two text files, and gives me a space to comment on those files. Ideally this application would have three panes, pane one would be file A, pane two would file B and pane three would be...
Answer Snippets (Read the full thread at stackoverflow):
A couple free ones are:
CodeStriker - I've used this ... .
They record diffs in a database and allow comments on those diffs.
It sounds to me like you might want to use a code review tool for this (even if you're not really performing code reviews) .
|
|
When you read a "howto"-style article with a code sample, which do you prefer:
All the code off to the side with very few comments, and a complete line-by-line breakdown in the article OR
All the code off to the side with LOTS of comments, and a complete...
Started by Dave Swersky on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
For an article, it would also probably be helpful to give an overall in the article with... .
For commenting code for an article as I would for any other comments I write in code - ideally the code, then by all means comment it.
|
|
Hi, I'm currently working my way through this book: http://www1.idc.ac.il/tecs/
I'm currently on a section where the excersize is to create a compiler for a very simple java like language. The book always states what is required but not the how the how...
Started by bplus on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
To "remove comments", when you're parsing a token you can have a comment token (the regex to parse a comment, too long to describe in words), and when you finish parsing this comment you just parse a new to the start of a ....
|
|
Public c++ header files must be provided with a lot of comments. It is hard to format and wrap doxygen comments. Does some formatting tool exists?
With features like auto wrap lines on 80th character, easy visual function grouping. Ideally documentation...
Started by m1chael on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You don't say which IDE you're working with - If you're working in Visual Studio, then I've written an addin ( AtomineerUtils ) that might help you - It generates/updates XML or Doxygen documentation in your source... .
Emacs + doxymacs works fine for me.
|