comments

What are The Valid & Readable approaches to Commenting in PHP5?

时间秒杀一切 提交于 2019-12-04 04:13:05
In the past 2 months that I have been learning PHP, I have identified more than two styles people use to comment code! I haven't seen much consistency... which I think usually means artists at work . So I wondered: what are the valid ways to comment which are still readable/practical? Seeing all the valid possibilities in 1 place side by side will provide the overview that I am looking for to improve commenting /* | This is what I now use (5chars/3lines) I name it star*wars \* Quoting the Manual on Comments: PHP supports 'C', 'C++' and Unix shell-style (Perl style) comments. For example: <?php

Setting the comment of a column to that of another column in Postgresql

大憨熊 提交于 2019-12-04 03:15:47
问题 Suppose I create a table in Postgresql with a comment on a column: create table t1 ( c1 varchar(10) ); comment on column t1.c1 is 'foo'; Some time later, I decide to add another column: alter table t1 add column c2 varchar(20); I want to look up the comment contents of the first column, and associate with the new column: select comment_text from (what?) where table_name = 't1' and column_name = 'c1' The (what?) is going to be a system table, but after having looked around in pgAdmin and

SASS: How to remove /*# sourceMappingURL Comment

流过昼夜 提交于 2019-12-04 02:56:58
I'm starting SASS watch from Windows command line. And FireFox developer Toolbar (with Show Sources) to see the .scss files. Everything works fine, but I realized my final .css output file was added an extra final line like: /*# sourceMappingURL=index.css.map */ As in my company i'm not allowed to leave this comment I'd like to know If I have to manually remove it everytime or is there any way to automatically remove it when I stop SASS Watch. Issue, other than the manual removal of the line, is that I'm working with Git for version control, so just by starting SASS (--sass watch...) will make

CSS refer to every odd nested child?

狂风中的少年 提交于 2019-12-04 01:42:11
问题 I'm trying to make a comment system where nested comments have zebra background colors. (Blue bg replies to white bg replies to blue bg...) Instead of referring to these as .comment, .comment .comment .comment, .comment .comment .comment, .comment, .comment ......, is there a way to refer to these nested children? ***I only have access to the stylesheet, so html, php, and javascript are out of the question. 回答1: You could add an alternating class to accompany .comment that's applied

TODOs in Xcode: How to make them stand out?

三世轮回 提交于 2019-12-03 23:56:45
I am aware of the method of making them warnings, but I want to keep my legit warnings separate from my todos. I'm also have yet to see xcode 4 highlight the todos like everyone seems to think it does. And xcode's todo support only works on todos outside of functions... The build phase script that is outlined here is wonderful, but it makes the TODOs into warnings, and Objective C creates enough legitimate warnings that I don't want my todo's clogging up the list. Is there a way to make the todo's a different build result, like an info result or something? Something that will not make Xcode's

doxygen comment multiple variables at once

微笑、不失礼 提交于 2019-12-03 23:50:01
If I have the following: /** * @brief (x,y,z) points for block */ int x, y, z; It will only generate that documentation for x, is it possible in doxygen to get it to comment all x, y and z with one comment? EDIT Following the suggestions of envu I now have the following (based off http://www.doxygen.nl/manual/grouping.html#memgroup ) //@{ /** some documentation here */ int x, y, z; //@} or //@{ /** * @brief some documentation here */ int x, y, z; //@} However both of these still only document x. Trying it with different forms I have yet to get the same documentation string to span multiple

Do you use special comments on bug fixes in your code?

不羁的心 提交于 2019-12-03 23:01:55
Some of my colleagues use special comments on their bug fixes, for example: // 2008-09-23 John Doe - bug 12345 // <short description> Does this make sense? Do you comment bug fixes in a special way? Please let me know. I don't put in comments like that, the source control system already maintains that history and I am already able to log the history of a file. I do put in comments that describe why something non-obvious is being done though. So if the bug fix makes the code less predictable and clear, then I explain why. Over time these can accumulate and add clutter. It's better to make the

In Visual Studio, is there a way to word-wrap ONLY comments?

眉间皱痕 提交于 2019-12-03 22:24:38
I've looked, but it doesn't look like you can apply specific formatting to just comments. Well, there is an Add-In which will automatically format your comments to a given width (as a side feature). It is HyperAddIn - the main feature of which is allowing you to create 'hyperlinks' to other places in your code within comments, like this: // The other half of this logic is in code:ComponentManager.Initialise() With HyperAddIn installed, the code:ComponentManager.Initialise() becomes a clickable link. I have it installed, it works OK, but I must admit that most of the time I don't have the

Are there multiline comment delimiters in SQL that are vendor agnostic?

ぐ巨炮叔叔 提交于 2019-12-03 22:03:47
While editing, building up, or cherry picking from SQL statements I can find myself interacting with one of four popular database tools. I have been resorting to single line commenting for DB2 and Informix. I have created macros in vim to make this slightly more efficient but I was wondering if I am working too hard. Jonathan Leffler C style comments are standard in SQL 2003 and SQL 2008 (but not in SQL 1999 or before). The following DBMS all support C style comments: Informix PostgreSQL MySQL Oracle DB2 Sybase Ingres Microsoft SQL Server SQLite (3.7.2 and later) Teradata and Aster That is not

How do I comment in Power Query M?

一世执手 提交于 2019-12-03 22:03:30
Is there a way to comment M code / comment out lines or blocks of code? Alejandro Lopez-Lago - MSFT M supports two different types of comments: Single line comments can be started with // You can comment out multiple lines or comment out text in the middle of a line using /* */ (e.g. = 1 + /* some comment */ 2 ) Comments might seem to disappear in the formula bar if they are at the end of the line, but they are still there. You can verify this by looking at your code in the Advanced Editor. 来源: https://stackoverflow.com/questions/31569679/how-do-i-comment-in-power-query-m