评论源代码。 [英] Commenting the source code.

查看:97
本文介绍了评论源代码。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述






我知道这不是主题。但我不知道

在哪里发布。


您是否在编码或编码后对源代码发表评论。

例如:


你写一个程序,在它工作之后,你会评论它。





你写了一行代码和评论。

感谢Profetas

解决方案

Profetas< xu ***** @ yahoo.com>潦草地写道:


我知道这不是主题。但我不知道在哪里张贴。
您是在编码时还是在编码后对源代码进行评论。
例如:
你写一个程序,在它工作之后,你会评论它。

你写下一行代码和一条评论。




每次我完成一段代码时,我通常会添加一条注释

一些非平凡的任务。我根据实际的LOC

指标没有任何规则,而是在

语义级别上计算我的代码实际执行的操作。有时我会将几段代码写入一个

源文件中,然后才会逐一将它们全部评论。


-

/ - Joona Palaste(pa*****@cc.helsinki.fi)-------------芬兰-------- \

\ ------------------------------------------- -------------规则! -------- /

" Hasta la Vista,Abie! 

- Bart Simpson




" Profetas" <徐***** @ yahoo.com>在消息中写道

新闻:ca ****************************** @ localhost.ta lkaboutprogramming。 com ...




我知道这不是主题。但是我不知道
在哪里发帖。

你是在编码时还是编码后评论你的源代码。




有时我会在编码后发表评论。


编码时有时会发表评论。


有时我会在编码之前发表评论" pseudolanguage"待办事项列表或

提供了对所用算法,陷阱和

解决方案,怪癖,古怪和一般说明的一般解释。


只要有评论......


" Profetas" <徐***** @ yahoo.com>在消息新闻中写道:< ca ****************************** @ localhost.t alkaboutprogramming.com> ... < blockquote class =post_quotes>

我知道这不是主题。但是我不知道
在哪里发帖。

您是否在编码或编码后对源代码发表评论。

例如:

你写了一个程序,在它工作之后,你会评论它。



你写了一行代码和评论。< br $>
感谢Profetas




编写函数时,我会在我认为需要的行上面写注释

。后来我写了一篇评论,描述了整个

函数的用途,但是直到它完成之后我才做到这一点,并且大部分是

集成,因为当这个

发生时,目的通常会略有变化。



Hi,

I know that this is off topic. but I didn''t know
where to post.

Do you comment your source code while coding or after coding.

for example:

you write a procedure and after it is working, you''ll comment it.

or

you write a line of code and a comment following.
Thanks Profetas

解决方案

Profetas <xu*****@yahoo.com> scribbled the following:

Hi, I know that this is off topic. but I didn''t know
where to post. Do you comment your source code while coding or after coding. for example: you write a procedure and after it is working, you''ll comment it. or you write a line of code and a comment following.



I generally add a comment every time I finish a piece of code that does
some non-trivial task. I don''t have any rules based on actual LOC
metrics but instead count the things that my code actually does, on a
semantic level. Sometimes I write several pieces of code into a single
source file, and only later comment them all, one by one.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"Hasta la Vista, Abie!"
- Bart Simpson



"Profetas" <xu*****@yahoo.com> wrote in message
news:ca******************************@localhost.ta lkaboutprogramming.com...


Hi,

I know that this is off topic. but I didn''t know
where to post.

Do you comment your source code while coding or after coding.



Sometimes i''ll comment after coding.

Sometimes ill comment whilst coding.

Sometimes i''ll comment before coding as a "pseudolanguage" to-do-list or
providing a nice general explaination of the algorithm(s) used, pitfalls and
solutions, quirks, oddities and general notes.

As long as the comments are there...


"Profetas" <xu*****@yahoo.com> wrote in message news:<ca******************************@localhost.t alkaboutprogramming.com>...

Hi,

I know that this is off topic. but I didn''t know
where to post.

Do you comment your source code while coding or after coding.

for example:

you write a procedure and after it is working, you''ll comment it.

or

you write a line of code and a comment following.
Thanks Profetas



When write a function I write comments above lines that I think need
them. Later I write a comment that describes the purpose of the whole
function, but I don''t do that until after it''s done and mostly
integrated because the purpose normally changes slightly when this
happens.


这篇关于评论源代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆