你遇到过的源代码中最好的注释是什么?


当前回答

'I hate nested regions and will delete them along with any code found in them.

其他回答

从/系统/图书馆/框架/ AppKit.framework /版本/ C /头/ NSTextView.h:

- (void)smartInsertForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
- (NSString *)smartInsertBeforeStringForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace;
- (NSString *)smartInsertAfterStringForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace;

/* Java note: The second and third methods are the primitives and are the 
methods exposed in Java.  The first method calls the other two.  All 
Objective-C code calls the first method.  In either Objective-C or Java any 
overriding should be done for the second and third methods, not the first 
method.  This will all work out correctly with the exception of existing code 
that overrides the first method.  Existing subclasses that do this will not 
have their implementations available to Java developers. Isn't Java wonderful? */
#!/usr/bin/sh
#       Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
#         All Rights Reserved

#       THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#       The copyright notice above does not evidence any
#       actual or intended publication of such source code.

#ident  "@(#)false.sh   1.6     93/01/11 SMI"   /* SVr4.0 1.3   */
exit 255

从SunOS 5.9即Solaris 9获取(/usr/bin/false)

  rescue
    # silently, we fail
    # many validations fade
    # like tear drops in rain
  end

这只是众多案例中的一个……

'Major changes: Everthing! - Removed all Cornoud's code !

为了保护有罪的人,价值观被改变了

这是一个承包商留下的,他一直在做一段负责测试电子邮件登录的代码。我们不相信,所以我们试了一下,这是一个有效的登录到他的个人帐户;我们再次检查了修订历史,他有两个签入来编辑它:一个是添加代码,另一个是注释掉它。

我们只添加了美术内容,而不去管其他内容;另一名开发人员认为,用未来的自己给他发电子邮件(游戏邦注:比如《The Office》)会很有趣,他说,在登录停止之前,他每天都要发两周的电子邮件。

'    ROFL:ROFL:LOL:ROFL:ROFL
'        ______/|\____
'  L    /          [] \
' LOL===_      ROFL    \_
'  L     \_______________]
'            I      I
'        /---------------/

'TODO: REMOVE MY INFO AND REPLACE WITH USER CREDENTIALS
'Private TEST_LoginName As String = "DurgshA@Exmaple.org"
'Private TEST_Password As String = "Humsal892"
'Private TEST_Server As String = "imap.secureserver.net"

我最喜欢的部分不是他做了这件事,也不是他不小心把它留在原地等待签到——而是当他再次看到它时,他只是把它注释掉了,而不是删除它。如果我们不知道它在那里,我们就不会去看原始版本:-D