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


当前回答

在OLTP数据库事务的主要触发代码中找到:

-- This line negates the @inverseqty, which is the
-- negative of the @insertedquantity.  This works through the
-- magic of the trigger.  In fact, this code is a lot like
-- the bermuda triangle!
@negquantity = -1 * @inverseqty

其他回答

我不知道这是有趣还是悲伤..但是和我一起工作的一个实习生有这个小宝石来计算每个单位的价格

...

// get the units from the form 
int numUnits = Integer.parseInt(request.getParameter("num_pieces")); // this break at random times

//price 
float price = Float.parseFloat(request.getParameter("price")); // same as above

// Under certain conditions the following code blows up. I don't know those conditions.
float pricePerUnit = price / (float)numUnits;

...
//There can Only Be one HIGHLAN....err..Singleton
public class SomeSingleton
{
...
}
catch (Exception ex)
{ 
    // just die already.
}
Exception up = new Exception("Something is really wrong.");
throw up;  //ha ha

这是在PHP代码中找到的

$s=2; // chicken and bacon wrap for lunch

多么有用,幸运的是$s是不言自明的