你会写代码注释吗?

你会写代码注释吗,看看诚实的人是如何写代码注释的。
/* This is bad. Reaaly bad. It's a really, really bad hack. If you're an employee of
 * Intertrode Communication, then I'm really, really sorry that you have to maintain
 * this. I was honestly planning on removing this tomorrow, but I've been known to
 * forget things like this. It happens.
 *
 * So here's the thing. I can't seem to figure out why the AccountId variable isn't
 * set. I've looked and looked, but I gotta leave now. Anyway, I've found that I can
 * just grab the AccountID from the debugging logs.  I suppose that to fix it, you'd
 * have to locate where it's clearing out the ID.
 *
 * Again, I'm sorry.
 */
 
if ( (AccountId == NULL) || (AccountId == "") ||
     (ServerSesion["AccountId"] == NULL) || (ServerSesion["AccountId"] == "") )
{
  //open session logs
  FileHandle file = f_open(LOG_PATH + "/sessionlog-" + LOG_FILE_DATE + ".log", 1);
  while (file != NULL)
  {
   
    TString line = f_readline(file);
 
    //look for IP and changereg
    if ( (sfind(line,REMOTE_ADDR) != -1) && (sfind(line,"changereg") != -1) )
    {
      //0000-00-00 00:00 /accountmaint/changereg/?AccountId=123456 255.255.255.255 ...
      //                                                    *
      AccountId = substr(line, 52, 6);
    }
 
    if (f_EOF(file)) { f_close(file); file = NULL; }
  }
 
}
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值