code-comments

How to be Specific enough in writing javadoc

半世苍凉 提交于 2020-01-25 18:24:37
问题 I have question related to writing standard javadoc comments. They ask us to be as specific as possible and use predicates to describe the code, but if I have a variable "d" written in my comment, but not indicated in my code, would that pose a problem? Once again, I ask this question because I get confused and my teacher is strict on commenting code. /** * Find the great common divisor between a 2 number. * * @param a number1 * @param b number2 * @return (\max d; ; a % d == 0 && b % d == 0)

How to be Specific enough in writing javadoc

ぃ、小莉子 提交于 2020-01-25 18:24:37
问题 I have question related to writing standard javadoc comments. They ask us to be as specific as possible and use predicates to describe the code, but if I have a variable "d" written in my comment, but not indicated in my code, would that pose a problem? Once again, I ask this question because I get confused and my teacher is strict on commenting code. /** * Find the great common divisor between a 2 number. * * @param a number1 * @param b number2 * @return (\max d; ; a % d == 0 && b % d == 0)

HTML table to “graphical text” for code comments

强颜欢笑 提交于 2020-01-22 15:04:34
问题 Is there a tool (ideally command-line-based) that can help in converting the source to HTML tables into “graphical text” (think perhaps ASCII art for HTML tables) for use in code comments, as show below? For example, given the following HTML table source <TABLE BORDER=1> <CAPTION>A test table with merged cells</CAPTION> <TR><TH ROWSPAN=2><TH COLSPAN=2>Average <TH ROWSPAN=2>other<BR>category<TH>Misc <TR><TH>height<TH>weight <TR><TH ALIGN=LEFT>males<TD>1.9<TD>0.003 <TR><TH ALIGN=LEFT ROWSPAN=2

What is your personal approach/take on commenting?

廉价感情. 提交于 2020-01-12 04:53:27
问题 Duplicate What are your hard rules about commenting? A Developer I work with had some things to say about commenting that were interesting to me (see below). What is your personal approach/take on commenting? "I don't add comments to code unless its a simple heading or there's a platform-bug or a necessary work-around that isn't obvious. Code can change and comments may become misleading. Code should be self-documenting in its use of descriptive names and its logical organization - and its

Why are comments that start with “//!” colored blue in Qt Creator?

为君一笑 提交于 2020-01-04 02:12:27
问题 Qt Creator normally colors comments green, but I saw blue colored comments in the Qt Examples, and Qt Creator seems to color every comment that starts with //! in blue. Here's an example screenshot: Is this some convention? What does the blue signify? 回答1: It's a Doxygen comment. There are multiple styles: Qt block comment: /*! ... text ... */ Qt one-line comment: //! ... one line of text ... JavaDoc block comment: /** * ... text ... */ JavaDoc one-line comment: /// ... one line of text ...

Stripping out comments from the project files just for the release build

﹥>﹥吖頭↗ 提交于 2019-12-24 14:27:58
问题 I work on multiple ASP.NET/SharePoint C# projects. During development we use to put elaborate comments for better understanding. But before i want to give a release build i want to hide all the comments (not to remove them). Is there any VS plugin or some tool to do this? 回答1: Hide from what? Remove from resulting assembly? Release mode removes comments. 来源: https://stackoverflow.com/questions/4214784/stripping-out-comments-from-the-project-files-just-for-the-release-build

Why do /**/ comments work in stylesheets but // comments don't?

南笙酒味 提交于 2019-12-18 03:51:26
问题 Is there a good reason for this? Lame question, but I just wondered if there was a reason why. 回答1: The syntax for comments in CSS is: /* comment here */ The // is not a valid syntax. I guess this allows CSS to work correctly when stripped from whitespace and new line characters during minification. 回答2: Because the specification allows for /**/ but not // :) Seriously, though, CSS treats newlines like all other whitespace, and would not be able to determine the end of the comment without a

Why do /**/ comments work in stylesheets but // comments don't?

前提是你 提交于 2019-12-18 03:51:10
问题 Is there a good reason for this? Lame question, but I just wondered if there was a reason why. 回答1: The syntax for comments in CSS is: /* comment here */ The // is not a valid syntax. I guess this allows CSS to work correctly when stripped from whitespace and new line characters during minification. 回答2: Because the specification allows for /**/ but not // :) Seriously, though, CSS treats newlines like all other whitespace, and would not be able to determine the end of the comment without a

Find multiple Objective-C comments per file, in certain format, with Ruby Regex

旧城冷巷雨未停 提交于 2019-12-14 02:43:28
问题 I'm writing a Ruby script that uses regex to find all comments of a specific format in Objective-C source code files. The format is /* <Headline_in_caps> <#>: <Comment body> **/ I want to capture the headline in caps, the number and the body of the comment. With the regex below I can find one comment in this format within a larger body of text. My problem is that if there are more than one comments in the file then I end up with all the text, including code, between the first /* and last **/

Do php comments take server time?

不羁的心 提交于 2019-12-10 21:28:48
问题 I am working on speeding up the response time of the website I'm currently working on. Can anyone tell me if the php parser takes the time to look at the code within comment blocks, or is it completely ignored? I ask because I'm wondering if removing many large blocks of commented code would do anything to improve page rendering time. Thanks. 回答1: They're ignored. The PHP tokenizer essentially jumps right over them. 回答2: parse rules for "jumping" over comments are well established and