您遇到的源代码中最好的评论是什么?

时间:2008-10-08 20:08:08

标签: comments

您遇到过的源代码中最好的评论是什么?

518 个答案:

答案 0 :(得分:1463)

我对此特别内疚,在我的大多数项目中嵌入了非建设性的评论,代码诗和小笑话(虽然我通常有足够的意识在发布代码之前删除任何直接令人反感的内容)。这是我特别喜欢的一个,远远落后于一个设计不佳的“上帝对象”:

/**
* For the brave souls who get this far: You are the chosen ones,
* the valiant knights of programming who toil away, without rest,
* fixing our most awful code. To you, true saviors, kings of men,
* I say this: never gonna give you up, never gonna let you down,
* never gonna run around and desert you. Never gonna make you cry,
* never gonna say goodbye. Never gonna tell a lie and hurt you.
*/

我很抱歉!!!! 我无法自救.....!

另一个,我承认我实际上还没有真正释放,即使我非常想要在我不那么直观的课程中这样做:

// 
// Dear maintainer:
// 
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
// 
// total_hours_wasted_here = 42
// 

答案 1 :(得分:1056)

Exception up = new Exception("Something is really wrong.");
throw up;  //ha ha

答案 2 :(得分:1052)

//When I wrote this, only God and I understood what I was doing
//Now, God only knows

答案 3 :(得分:1049)

stop(); // Hammertime!

答案 4 :(得分:1033)

这似乎阻止了笨蛋弄乱我的代码......

// Autogenerated, do not edit. All changes will be undone.

答案 5 :(得分:946)

// sometimes I believe compiler ignores all my comments

答案 6 :(得分:931)

// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets 
// released into the public.

答案 7 :(得分:913)

//Code sanitized to protect the foolish.
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Web.UI;

namespace Mobile.Web.Control
{
    /// <summary>
    /// Class used to work around Richard being a fucking idiot
    /// </summary>
    /// <remarks>
    /// The point of this is to work around his poor design so that paging will 
    /// work on a mobile control. The main problem is the BindCompany() method, 
    /// which he hoped would be able to do everything. I hope he dies.
    /// </remarks>
    public abstract class RichardIsAFuckingIdiotControl : MobileBaseControl, ICompanyProfileControl
    {
        protected abstract Pager Pager { get; }

        public void BindCompany(int companyId) { }

        public RichardIsAFuckingIdiotControl()
        {
            MakeSureNobodyAccidentallyGetsBittenByRichardsStupidity();
        }

        private void MakeSureNobodyAccidentallyGetsBittenByRichardsStupidity()
        {
            // Make sure nobody is actually using that fucking bindcompany method
            MethodInfo m = this.GetType().GetMethod("BindCompany", BindingFlags.DeclaredOnly | 
                BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
            if (m != null)
            {
                throw new RichardIsAFuckingIdiotException("No!! Don't use the fucking BindCompany method!!!");
            }
            // P.S. this method is a joke ... the rest of the class is fucking serious
        }

        /// <summary>
        /// This returns true if this control is supposed to be doing anything
        /// at all for this request. Richard thought it was a good idea to load
        /// the entire website during every request and have things turn themselves
        /// off. He also thought bandanas and aviator sunglasses were "fuckin' 
        /// gnarly, dude."
        /// </summary>
        protected bool IsThisTheRightPageImNotSureBecauseRichardIsDumb()
        {
            return Request.QueryString["Section"] == this.MenuItemKey;
        }

        protected override void OnLoad(EventArgs e)
        {
            if (IsThisTheRightPageImNotSureBecauseRichardIsDumb())
            {
                Page.LoadComplete += new EventHandler(Page_LoadComplete);
                Pager.RowCount = GetRowCountBecauseRichardIsDumb();
            }
            base.OnLoad(e);
        }

        protected abstract int GetRowCountBecauseRichardIsDumb();
        protected abstract void BindDataBecauseRichardIsDumb();

        void Page_LoadComplete(object sender, EventArgs e)
        {
            BindDataBecauseRichardIsDumb();
        }

        // the rest of his reduh-ndant interface members
        public abstract string MenuItemName { get; set; }
        public abstract string MenuItemKey { get; set; }
        public abstract bool IsCapable(CapabilityCheck checker, int companyId);
        public abstract bool ShowInMenu { get; }
        public virtual Control CreateHeaderControl()
        {
            return null;
        }
    }
}

更新:代码has outed himself的原始作者,所以我必须在到期时给予信任。 Dan McKinley在我开始后不久离开了我所在的公司,他更多地谈论了代码,解释了一些背景以及“理查德”写的更多“WTF”。

答案 8 :(得分:827)

// somedev1 -  6/7/02 Adding temporary tracking of Login screen
// somedev2 -  5/22/07 Temporary my ass

答案 9 :(得分:727)

// drunk, fix later

希望我在开玩笑。并且知道编写代码的开发人员,我认为他的确是字面意思。

答案 10 :(得分:719)

// Magic. Do not touch.

答案 11 :(得分:701)

#define TRUE FALSE //Happy debugging suckers

答案 12 :(得分:640)

// I'm sorry.

答案 13 :(得分:636)

return 1; # returns 1

答案 14 :(得分:592)

/* This is O(scary), but seems quick enough in practice. */ 

后跟四个嵌套的for循环

答案 15 :(得分:589)

// Replaces with spaces the braces in cases where braces in places cause stasis 
   $str = str_replace(array("\{","\}")," ",$str);

答案 16 :(得分:542)

当谈到“最佳评论”时,我们大家都在谈论我们的专业,我们都回答了我们能找到的最糟糕的评论......

答案 17 :(得分:526)

long john; // silver

答案 18 :(得分:508)

Catch (Exception e) {
 //who cares?
} 

答案 19 :(得分:496)

/**
 * Always returns true.
 */
public boolean isAvailable() {
    return false;
}

永远不要依赖评论......

答案 20 :(得分:457)

/*
 * You may think you know what the following code does.
 * But you dont. Trust me.
 * Fiddle with it, and youll spend many a sleepless
 * night cursing the moment you thought youd be clever
 * enough to "optimize" the code below.
 * Now close this file and go play with something else.
 */ 

答案 21 :(得分:431)

try {

} finally { // should never happen 

}

答案 22 :(得分:412)

来自:https://github.com/zepouet/Xee-xCode-4.5/blob/master/XeePhotoshopLoader.m#L108

// At this point, I'd like to take a moment to speak to you about the Adobe PSD
// format. PSD is not a good format. PSD is not even a bad format. Calling it
// such would be an insult to other bad formats, such as PCX or JPEG. No, PSD
// is an abysmal format. Having worked on this code for several weeks now, my
// hate for PSD has grown to a raging fire that burns with the fierce passion
// of a million suns.
//
// If there are two different ways of doing something, PSD will do both, in
// different places. It will then make up three more ways no sane human would
// think of, and do those too. PSD makes inconsistency an art form. Why, for
// instance, did it suddenly decide that *these* particular chunks should be
// aligned to four bytes, and that this alignement should *not* be included in
// the size? Other chunks in other places are either unaligned, or aligned with
// the alignment included in the size. Here, though, it is not included. Either
// one of these three behaviours would be fine. A sane format would pick one.
// PSD, of course, uses all three, and more.
//
// Trying to get data out of a PSD file is like trying to find something in the
// attic of your eccentric old uncle who died in a freak freshwater shark
// attack on his 58th birthday. That last detail may not be important for the
// purposes of the simile, but at this point I am spending a lot of time
// imagining amusing fates for the people responsible for this Rube Goldberg of
// a file format.
//
// Earlier, I tried to get a hold of the latest specs for the PSD file format.
// To do this, I had to apply to them for permission to apply to them to have
// them consider sending me this sacred tome. This would have involved faxing
// them a copy of some document or other, probably signed in blood. I can only
// imagine that they make this process so difficult because they are intensely
// ashamed of having created this abomination. I was naturally not gullible
// enough to go through with this procedure, but if I had done so, I would have
// printed out every single page of the spec, and set them all on fire. Were it
// within my power, I would gather every single copy of those specs, and launch
// them on a spaceship directly into the sun.
//
// PSD is not my favourite file format.

答案 23 :(得分:387)

const int TEN=10; // As if the value of 10 will fluctuate... 

答案 24 :(得分:365)

    #Christmas tree initializer  
    toConnect = []  
    toRead =   [  ]  
    toWrite = [    ]   
    primes = [      ]  
    responses = {}  
    remaining = {}  

答案 25 :(得分:362)

关于30页xslt

的中间部分
<!-- Here be dragons  -->

答案 26 :(得分:355)

long long ago; /* in a galaxy far far away */ 

答案 27 :(得分:354)

完全没有注释的2000行方法

{ 
  { 
    while (.. ){ 
      if (..){
          }
      for (.. ){ 
          }
         .... (just putting in the control flow here, imagine another few hundred ifs)
      if(..)   {
            if(..)     {
                   if(..)   {
                ...
                (another few hundred brackets)
                       }
                  }
         } //endif

(我实际上有一天只是为了看看它有多糟糕而把所有的括号都弄出来了,并且没有格式化,得到了这个:

{{{{}}{}{}{}{}}{{}{{}{}{}{}{}{}{{}{}}{}{}{{}{}{}{}{}{}{}{}{}{}{}{{}}}{{}{{}}{{{}}}{{}{}{}{}{}{}{}{{}}{}{{{}}{}{{}{}}{{{}}{}{}{}{}}{{}}}{}{{}{}{}{{}{{}}{}}{{}}}{{}}{{}}{{}}{}{{}}{{}}{{}}{{}{}{}}{}{}{{{}}{{}}}{}{}{}{}}{{{}{{}{}{}{{}{}{}{}{}{}}{}}{{}}{{}{}}}{{}}{{}}}{{}}{{}}{}{}{}{}{{}}{{}{}{}{}}}}{}{}}{{}{{{}{}{}{}}}}{{}{{{}}}}{{}{{{}{{}}{}{{}}{}{{}{}}{{}}{}{{}}}{{}}}}{{}{}{}{}{}{{{}    {{{{}}{}{}{}{}}{{}{{}{}{}{}{}{}{{}{}}{}{}{{}{}{}{}{}{}{}{}{}{}{}{{}}}{{}{{}}{{{}}}{{}{}{}{}{}{}{}{{}}{}{{{}}{}{{}{}}{{{}}{}{}{}{}}{{}}}{}{{}{}{}{{}{{}}{}}{{}}}{{}}{{}}{{}}{}{{}}{{}}{{}}{{}{}{}}{}{}{{{}}{{}}}{}{}{}{}}{{{}{{}{}{}{{}{}{}{}{}{}}{}}{{}}{{}{}}}{{}}{{}}}{{}}{{}}{}{}{}{}{{}}{{}{}{}{}}}}{}{}}{{}{{{}{}{}{}}}}{{}{{{}}}}{{}{{{}{{}}{}{{}}{}{{}{}}{{}}{}{{}}}{{}}}}{{}{}{}{}{}{{{}{}{{}}{}}}{}}{{}}{{}{}}{{}{{}{{}}}}{{{}{{{}}}}}{{{{{}}}}}{}{}{}{{{{}}}{}{}}{{}{{}}}}{}{{}}{}}}{}}{{}}{{}{}}{{}{{}{{}}}}{{{}{{{}}}}}{{{{{}}}}}{}{}{}{{{{}}}{}{}}{{}{{}}}}

endif出现在第800行附近

答案 28 :(得分:352)

//This code sucks, you know it and I know it.  
//Move on and call me an idiot later.

答案 29 :(得分:325)

// If this comment is removed the program will blow up 

答案 30 :(得分:297)

double penetration; // ouch

答案 31 :(得分:292)

/////////////////////////////////////// this is a well commented line

答案 32 :(得分:269)

// I don't know why I need this, but it stops the people being upside-down

x = -x;

答案 33 :(得分:254)

最经典的一个是Pierre de Fermat关于他着名的“最后定理”的评论:“这个页面的边缘有点太小而无法记下证据”。

在发现证据之前花了350多年......

(根据wikipedia这是原始文本:)

  

Cubum autem in duos cubos,aut   二重奏中的quadratoquadratum   quadratoquadratos,et generaliter   无限超平衡的无限   posstatem in duos eiusdem nominis fas   est dividere cuius rei demonstem   mirabilem sane detexi。 Hanc marginis   exiguitas non caperet。

...并翻译成英文:

  

(分离立方体是不可能的   分成两个立方体,或四分之一的力量   两个第四权力,或一般而言,任何   功率高于第二比二   像权力。我发现了一个真正的   这个的奇妙证明   保证金太窄,不能包含。)

答案 34 :(得分:254)

// I am not sure if we need this, but too scared to delete. 

答案 35 :(得分:233)

来自Java 1.2 SwingUtilities:

doRun.run();  // ... "a doo run run".

答案 36 :(得分:230)

# To understand recursion, see the bottom of this file 

在文件的底部:

# To understand recursion, see the top of this file

答案 37 :(得分:223)

这是我们团队中微观管理效果的生产代码:

// I am not responsible of this code.
// They made me write it, against my will.

...其次是不太理想的代码,由我们敬爱的技术总监构思,他非常喜欢将代码和编码指南强制转化为开发人员的喉咙(*)。

当然,当项目负责人搜索错误的原因,发现它在“不太理想的代码”里面时,他就不会感到好笑......

(*)我当然提到 Mighty VB King ...如果你想评估 Mighty VB King的强大功能,您可以阅读以下SO帖子:What was the strangest coding standard rule that you were forced to follow? ...

答案 38 :(得分:221)

我经历了一次睡眠不足的编码运行,开始只撰写来自搏击俱乐部的评论。

多年后仍在搜索代码我发现一条让我发笑的评论。他们中的大多数只是随意的想法然而,我确实保持我对线条比率的评价非常好!

// This shouldn't happen. The only way this can happen is if the
// <code>JFileChooser</code> has returned a <code>File</code> that doesn't exist
// on the system. If this happens we can't recover, and there is more than likely
// a rip in the space time continuum that the user is too distracted by to notice
// anything else.

 /**
   * This method leverages collective synergy to drive "outside of the box"
   * thinking and formulate key objectives into a win-win game plan with a
   * quality-driven approach that focuses on empowering key players to drive-up
   * their core competencies and increase expectations with an all-around
   * initiative to drive down the bottom-line. I really wanted to work the word
   * "mandrolic" in there, but that word always makes me want to punch myself in
   * the face.
   */
private void updateFileCountLabel() {

答案 39 :(得分:217)

许多年前(大约1994年)我正在为一家大型跨国软件公司开发Oracle PRO * C应用程序,您将听说过它。我正在开发的应用程序是一个庞大的Oracle应用程序,他们有一个实用程序,可以在一夜之间整理数据并进行各种聚合计算。每当需要做任何批处理工作时,它都被推到了这个工具中,你可以想象它变成了一个绝对的怪物。同样值得注意的是,它对这样一个庞大的计划所做的评论很少。

它所做的少数评论之一仍然是我见过的纯粹WTF的最好的评论......我试图找到一个函数的错误,这个函数长达数百行,正好在它的中间是函数中的唯一注释:

/* I did this the other way */

直到今天,它仍然是我见过的最好的评论。

答案 40 :(得分:216)

/* Please work */

答案 41 :(得分:212)

//Dear future me. Please forgive me. 
//I can't even begin to express how sorry I am.  

我今天刚刚发现了这个:

//private instance variable for storing age
public static int age;

答案 42 :(得分:207)

/* You are not meant to understand this */ 

答案 43 :(得分:192)

//I am not sure why this works but it fixes the problem. 

这是在一组代码之前,它在技术上确实解决了它本来应该解决的问题,但又破坏了其他3个......

答案 44 :(得分:187)

// no comments for you
// it was hard to write
// so it should be hard to read

答案 45 :(得分:179)

/* Halley's comment */

答案 46 :(得分:178)

options.BatchSize = 300; //Madness? THIS IS SPARTA!

答案 47 :(得分:173)

// I have to find a better job

答案 48 :(得分:172)

我们的DBA在第三方编写的3000行存储过程中发现了这一点。

/* IF DOLPHINS ARE SO SMART, HOW COME THEY LIVE IN IGLOOS? */

答案 49 :(得分:171)

关于js代码:

// hack for ie browser (assuming that ie is a browser)

答案 50 :(得分:155)

/* Emits a 7-Hz tone for 10 seconds.
  True story: 7 Hz is the resonant frequency of a
  chicken's skull cavity. This was determined
  empirically in Australia, where a new factory
  generating 7-Hz tones was located too close to a
  chicken ranch: When the factory started up, all the
  chickens died.
  Your PC may not be able to emit a 7-Hz tone. */

main()
{
    sound(7);
    delay(10000);
    nosound();
}

(Turbo C 2.0版参考指南中的声音功能)

答案 51 :(得分:150)

...或死//婊子

答案 52 :(得分:147)

尝试将您最喜爱的亵渎语言输入google code search,然后输入许多沉闷的小时。我最喜欢的一些例子:

/* These magic numbers are fucking stupid. */

/* Dear free software world, do you NOW see we are fucking
   things up?! This is insane! */

/* We will NOT put a fucking timestamp in the header here. Every
   time you put it back, I will come in and take it out again. */

# However, this only works if there are MULTIPLE checkboxes!
# The fucking JS DOM *changes* based on one or multiple boxes!?!?!
# Damn damn damn I hate the JavaScript DOM so damn much!!!!!!

/* TODO: this is obviously not right ... this whole fucking module
   sucks anyway */

/* FIXME: please god, when will the hurting stop? Thus function is so
   fucking broken it's not even funny. */

和我个人最喜欢的

 # code below replaces code above - any problems?
 # yeah, it doesn't fucking work.

答案 53 :(得分:146)

初始化链表时:

last = first; /* Biblical reference */

简洁而有趣。

答案 54 :(得分:145)

有人抱怨“最好的”评论提出了最糟糕的评论。恕我直言,他们更有趣,所以“更好”,但这是我曾经read的诚实最佳评论:

/*
Major subtleties ahead:  Most hash schemes depend on having a "good" hash
function, in the sense of simulating randomness.  Python doesn't:  its most
important hash functions (for strings and ints) are very regular in common
cases:

>>> map(hash, (0, 1, 2, 3))
[0, 1, 2, 3]
>>> map(hash, ("namea", "nameb", "namec", "named"))
[-1658398457, -1658398460, -1658398459, -1658398462]
>>>

This isn't necessarily bad!  To the contrary, in a table of size 2**i, taking
the low-order i bits as the initial table index is extremely fast, and there
are no collisions at all for dicts indexed by a contiguous range of ints.
The same is approximately true when keys are "consecutive" strings.  So this
gives better-than-random behavior in common cases, and that's very desirable.

OTOH, when collisions occur, the tendency to fill contiguous slices of the
hash table makes a good collision resolution strategy crucial.  Taking only
the last i bits of the hash code is also vulnerable:  for example, consider
[i << 16 for i in range(20000)] as a set of keys.  Since ints are their own
hash codes, and this fits in a dict of size 2**15, the last 15 bits of every
hash code are all 0:  they *all* map to the same table index.

But catering to unusual cases should not slow the usual ones, so we just take
the last i bits anyway.  It's up to collision resolution to do the rest.  If
we *usually* find the key we're looking for on the first try (and, it turns
out, we usually do -- the table load factor is kept under 2/3, so the odds
are solidly in our favor), then it makes best sense to keep the initial index
computation dirt cheap.

The first half of collision resolution is to visit table indices via this
recurrence:

    j = ((5*j) + 1) mod 2**i

For any initial j in range(2**i), repeating that 2**i times generates each
int in range(2**i) exactly once (see any text on random-number generation for
proof).  By itself, this doesn't help much:  like linear probing (setting
j += 1, or j -= 1, on each loop trip), it scans the table entries in a fixed
order.  This would be bad, except that's not the only thing we do, and it's
actually *good* in the common cases where hash keys are consecutive.  In an
example that's really too small to make this entirely clear, for a table of
size 2**3 the order of indices is:

    0 -> 1 -> 6 -> 7 -> 4 -> 5 -> 2 -> 3 -> 0 [and here it's repeating]

If two things come in at index 5, the first place we look after is index 2,
not 6, so if another comes in at index 6 the collision at 5 didn't hurt it.
Linear probing is deadly in this case because there the fixed probe order
is the *same* as the order consecutive keys are likely to arrive.  But it's
extremely unlikely hash codes will follow a 5*j+1 recurrence by accident,
and certain that consecutive hash codes do not.

The other half of the strategy is to get the other bits of the hash code
into play.  This is done by initializing a (unsigned) vrbl "perturb" to the
full hash code, and changing the recurrence to:

    j = (5*j) + 1 + perturb;
    perturb >>= PERTURB_SHIFT;
    use j % 2**i as the next table index;

Now the probe sequence depends (eventually) on every bit in the hash code,
and the pseudo-scrambling property of recurring on 5*j+1 is more valuable,
because it quickly magnifies small differences in the bits that didn't affect
the initial index.  Note that because perturb is unsigned, if the recurrence
is executed often enough perturb eventually becomes and remains 0.  At that
point (very rarely reached) the recurrence is on (just) 5*j+1 again, and
that's certain to find an empty slot eventually (since it generates every int
in range(2**i), and we make sure there's always at least one empty slot).

Selecting a good value for PERTURB_SHIFT is a balancing act.  You want it
small so that the high bits of the hash code continue to affect the probe
sequence across iterations; but you want it large so that in really bad cases
the high-order hash bits have an effect on early iterations.  5 was "the
best" in minimizing total collisions across experiments Tim Peters ran (on
both normal and pathological cases), but 4 and 6 weren't significantly worse.

Historical:  Reimer Behrends contributed the idea of using a polynomial-based
approach, using repeated multiplication by x in GF(2**n) where an irreducible
polynomial for each table size was chosen such that x was a primitive root.
Christian Tismer later extended that to use division by x instead, as an
efficient way to get the high bits of the hash code into play.  This scheme
also gave excellent collision statistics, but was more expensive:  two
if-tests were required inside the loop; computing "the next" index took about
the same number of operations but without as much potential parallelism
(e.g., computing 5*j can go on at the same time as computing 1+perturb in the
above, and then shifting perturb can be done while the table index is being
masked); and the dictobject struct required a member to hold the table's
polynomial.  In Tim's experiments the current scheme ran faster, produced
equally good collision statistics, needed less code & used less memory.

Theoretical Python 2.5 headache:  hash codes are only C "long", but
sizeof(Py_ssize_t) > sizeof(long) may be possible.  In that case, and if a
dict is genuinely huge, then only the slots directly reachable via indexing
by a C long can be the first slot in a probe sequence.  The probe sequence
will still eventually reach every slot in the table, but the collision rate
on initial probes may be much higher than this scheme was designed for.
Getting a hash code as fat as Py_ssize_t is the only real cure.  But in
practice, this probably won't make a lick of difference for many years (at
which point everyone will have terabytes of RAM on 64-bit boxes).
*/

答案 55 :(得分:128)

if(m_measures =/*=*/ --index)
{
    ....

答案 56 :(得分:128)

int MyFunction()
{
    // There once was a man named Dave
    int Result = 0;

    // Whose code just wouldn't behave
    MyObject *Ptr = new MyObject();

    // He left to go to a meetin'
    Result = Ptr->DoSomething();

    // And left his memory a leakin'
    return Result;
}

C ++评论

答案 57 :(得分:126)

/*
This isn't the right way to deal with this, but today is my last day, Ron
just spilled coffee on my desk, and I'm hungry, so this will have to do...
*/

return 12; // 12 is my lucky number

答案 58 :(得分:118)

  mov si, pCard      ; captain?

答案 59 :(得分:109)

// I know the line below is wrong, but it came that way from our IP vendor, and 
// the driver won't work if you "fix" it. I've had to revert this change 4 times
// now. Leave it alone, or I will hunt you down and hurt you
if (r = 0) {
    /* bunch of code here */
}
else
{
   /* even more code here */
}

答案 60 :(得分:109)

从2004年的Windows漏洞中,

__inline BOOL
SearchOneDirectory(
                  IN  LPSTR Directory,
                  IN  LPSTR FileToFind,
                  IN  LPSTR SourceFullName,
                  IN  LPSTR SourceFilePart,
                  OUT PBOOL FoundInTree
                  )
{
    //
    // This was way too slow. Just say we didn't find the file.
    //
    *FoundInTree = FALSE;
    return(TRUE);
}

答案 61 :(得分:108)

// this comment included for the benefit of anyone grepping for swearwords: shit.

答案 62 :(得分:106)

} catch (PartInitException pie) {
    // Mmm... pie

答案 63 :(得分:105)

不是评论,而是转到标签

ICantBelieveImUsingAGoto:

答案 64 :(得分:105)

我在某人的代码上看到了这条评论:

// This comment is self explanatory.

我猜他的意思是'变量',但这个错误引起了一个有趣的评论......想想这里的循环逻辑,以及编写它是徒劳的。

答案 65 :(得分:104)

class Act //That's me!!!
{

}

答案 66 :(得分:104)

try {

}
catch (SQLException ex) {
    // Basically, without saying too much, you're screwed. Royally and totally.
}
catch(Exception ex)
{
    //If you thought you were screwed before, boy have I news for you!!!
}

答案 67 :(得分:102)

在必须声明的局部变量旁边,只是将常量传递给库函数:

// This only exists because Scott doesn't know how to use const correctly

答案 68 :(得分:102)

virgin = 0;     /* you're not a virgin anymore, sweety */

答案 69 :(得分:101)

public boolean isDirty() {
    //Why do you always go out and
    return dirty;
}

答案 70 :(得分:97)

 * ...and don't just declare it volatile and think you've solved
 * the problem. You young punks think you know what volatile
 * means... why in my day we had to cast it volatile uphill
 * both ways, and the code still didn't work! Whippersnappers...

答案 71 :(得分:94)

原来的末日有一个静止墙无法移动的发动机;结果是所有门都垂直打开;什么都不能横向移动。在源代码发布后,我突然笑了起来,我正在查看代码并在源文件中看到这个处理门,在一大块注释掉的代码的开头:

// UNUSED
// Separate into p_slidoor.c?

#if 0           // ABANDONED TO THE MISTS OF TIME!!!
//
// EV_SlidingDoor : slide a door horizontally
// (animate midtexture, then set noblocking line)
//

答案 72 :(得分:94)

从Quake III源代码中,我在一些随机的slashdot帖子中偶然发现了这一点。可以找到该文件的完整来源here。这是计算平方根的一种特别快速的方法。至于最好的评论?这是一个常见的确定,但鉴于它附加到线上,魔术是什么使它伟大。

float Q_rsqrt( float number )
{
  long i;
  float x2, y;
  const float threehalfs = 1.5F;

  x2 = number * 0.5F;
  y  = number;
  i  = * ( long * ) &y;  // evil floating point bit level hacking
  i  = 0x5f3759df - ( i >> 1 ); // what the fuck?
  y  = * ( float * ) &i;
  y  = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
  // y  = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed

  #ifndef Q3_VM
  #ifdef __linux__
    assert( !isnan(y) ); // bk010122 - FPE?
  #endif
  #endif
  return y;
}

答案 73 :(得分:92)

// John! If you'll svn remove this once more,
// I'll shut you, for God's sake!
// That piece of code is not “something strange”!
// That is THE AUTH VALIDATION.

你觉得怎么样?下面的代码被安全'删除'。

答案 74 :(得分:92)

def format_ticket_content(text, recursive = true)
  if text.is_a?(TicketNote)
    note = text
    text = note.content
  else
    note = nil
  end

  ## Safety pig has arrived!
  text = h(text)
  ##                               _
  ##  _._ _..._ .-',     _.._(`))
  ## '-. `     '  /-._.-'    ',/
  ##    )         \            '.
  ##   / _    _    |             \
  ##  |  a    a    /              |
  ##  \   .-.                     ;  
  ##   '-('' ).-'       ,'       ;
  ##      '-;           |      .'
  ##         \           \    /
  ##         | 7  .__  _.-\   \
  ##         | |  |  ``/  /`  /
  ##        /,_|  |   /,_/   /
  ##           /,_/      '`-'
  ## 

答案 75 :(得分:78)

这已经在我自己的代码中出现了几次。显然我不止一次触及它:

// TODO: Fix this.  Fix what?

答案 76 :(得分:76)

//MailBody builders for two outgoing messages
StringBuilder hanz = new StringBuilder();
StringBuilder franz = new StringBuilder();

当我读到那个时,我还是笑了一下......

答案 77 :(得分:74)

Repeat
    ...
Until (JesusChristsReturn) ' Not sure

答案 78 :(得分:74)

离开我的上一份工作时,我将一些ascii艺术嵌入到源中......


                                      ,_-=(!7(7/zs_.             
                                   .='  ' .`/,/!(=)Zm.           
                     .._,,._..  ,-`- `,\ ` -` -`\\7//WW.         
                ,v=~/.-,-\- -!|V-s.)iT-|s|\-.'   `///mK%.        
              v!`i!-.e]-g`bT/i(/[=.Z/m)K(YNYi..   /-]i44M.       
            v`/,`|v]-DvLcfZ/eV/iDLN\D/ZK@%8W[Z..   `/d!Z8m       
           //,c\(2(X/NYNY8]ZZ/bZd\()/\7WY%WKKW)   -'|(][%4.      
         ,\\i\c(e)WX@WKKZKDKWMZ8(b5/ZK8]Z7%ffVM,   -.Y!bNMi      
         /-iit5N)KWG%%8%%%%W8%ZWM(8YZvD)XN(@.  [   \]!/GXW[      
        / ))G8\NMN%W%%%%%%%%%%8KK@WZKYK*ZG5KMi,-   vi[NZGM[      
       i\!(44Y8K%8%%%**~YZYZ@%%%%%4KWZ/PKN)ZDZ7   c=//WZK%!      
      ,\v\YtMZW8W%%f`,`.t/bNZZK%%W%%ZXb*K(K5DZ   -c\\/KM48       
      -|c5PbM4DDW%f  v./c\[tMY8W%PMW%D@KW)Gbf   -/(=ZZKM8[       
      2(N8YXWK85@K   -'c|K4/KKK%@  V%@@WD8e~  .//ct)8ZK%8`       
      =)b%]Nd)@KM[  !'\cG!iWYK%%|   !M@KZf    -c\))ZDKW%`        
      YYKWZGNM4/Pb  '-VscP4]b@W%     'Mf`   -L\///KM(%W!         
      !KKW4ZK/W7)Z. '/cttbY)DKW%     -`  .',\v)K(5KW%%f          
      'W)KWKZZg)Z2/,!/L(-DYYb54%  ,,`, -\-/v(((KK5WW%f           
       \M4NDDKZZ(e!/\7vNTtZd)8\Mi!\-,-/i-v((tKNGN%W%%            
       'M8M88(Zd))///((|D\tDY\\KK-`/-i(=)KtNNN@W%%%@%[           
        !8%@KW5KKN4///s(\Pd!ROBY8/=2(/4ZdzKD%K%%%M8@%%           
         '%%%W%dGNtPK(c\/2\[Z(ttNYZ2NZW8W8K%%%%YKM%M%%.          
           *%%W%GW5@/%!e]_tZdY()v)ZXMZW%W%%%*5Y]K%ZK%8[          
            '*%%%%8%8WK\)[/ZmZ/Zi]!/M%%%%@f\ \Y/NNMK%%!          
              'VM%%%%W%WN5Z/Gt5/b)((cV@f`  - |cZbMKW%%|          
                 'V*M%%%WZ/ZG\t5((+)L\'-,,/  -)X(NWW%%           
                      `~`MZ/DZGNZG5(((\,    ,t\\Z)KW%@           
                         'M8K%8GN8\5(5///]i!v\K)85W%%f           
                           YWWKKKKWZ8G54X/GGMeK@WM8%@            
                            !M8%8%48WG@KWYbW%WWW%%%@             
                              VM%WKWK%8K%%8WWWW%%%@`             
                                ~*%%%%%%W%%%%%%%@~               
                                   ~*MM%%%%%%@f`                 
                                       '''''                     

答案 79 :(得分:72)

/*
after hours of consulting the tome of google
i have discovered that by the will of unknown forces
without the below line, IE7 believes that 6px = 12px
*/
font-size: 0px;

答案 80 :(得分:71)

不记得我在哪里见过这些:

long time; /* know C */

和(在代码中创建某种UNIX守护进程):

/* Be a real daemon: fork myself and kill my parent */

答案 81 :(得分:70)

在头文件的顶部:

/* Project : XYZ (Please somebody shoot me!)
 *
 * File : $Id: defs.h,v 1.1 $
 *
 * Purpose : Create havoc rather than peace among many nations
 *
 * History : Back-ported changes that were not in CVS.  Please somebody,
 *  shoot us and put us all out of our misery.
 */

“XYZ项目”(名称已更改)是一项为期七年的考验。最后一条评论是由从一开始到最后参与的一个坚强的灵魂写的。

答案 82 :(得分:67)

// Catching exceptions is for communists

来自Mike Duncan's page on SQLite

答案 83 :(得分:67)

在drivers / net / sunhme.c(Linux内核)中:

/* Welcome to Sun Microsystems, can I take your order please? */
if(!hp->happy_flags & HFLAG_FENABLE)
        return happy_meal_bb_write(hp, tregs, reg, value);

/* Would you like fries with that? */
hme_write32(hp, &tregs->frame,
            (FRAME_WRITE | (hp->paddr << 23) |
             ((reg & 0xff) << 18) | (value & 0xffff)));
while(!(hme_read32(hp, &tregs->frame) & 0x10000) && --tries)
        udelay(20);

/* Anything else? */
if(!tries)
        printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixed\n");

/* Fifty-two cents is your change, have a nice day. */

答案 84 :(得分:66)

//
//3.4  JeK  My manager promised me a lap dance if I can fix this release
//3.5  JeK  Still waiting for that dance from my manager
//3.6  JeK  My manager got changed, the new manager is hairy, dont want the dance anymore
//3.7  Jek  Got that dance, yuck!
//

答案 85 :(得分:63)

    /* Mark: If there's one thing you learn from this code, it is this...
   Never, ever fly Air France.  Their customer service is absolutely
   the worst.  I've never heard the words "That's not my problem" as 
   many times as I have from their staff -- It should, without doubt
   be their corporate motto if it isn't already.  Don't bother giving 
   them business because you're just a pain in their side and they
   will be sure to let you know the first time you speak to them.

   If you ever want to make me happy just tell me that you, too, will
   never fly Air France again either (in spite of their excellent
   cuisine). 

   Update by oej: The merger with KLM has transferred this
   behaviour to KLM as well. 
   Don't bother giving them business either...

   Only if you want to travel randomly without luggage, you
   might pick either of them.
   */

答案 86 :(得分:58)

我添加到PHP CMS中的评论我正在讨论。

if (/*you*/ $_GET['action']) { //celebrate

答案 87 :(得分:58)

有一次我在另一次讨论中看到这样的事情:

// I can't divide with zero, so I have to divide with something very similar
result = number / 0.00000000000001;

聪明的解决方案,不是吗:)? (如果有人不确定,这是一个笑话)

答案 88 :(得分:56)

一个经典案例,说明为什么你不应该放弃软件开发:

public class Contact
{
    //...    

    /// <summary>
    /// Gets or sets the name of the first.
    /// </summary>
    /// <value>The name of the first.</value>
    public string FirstName
    {
        get { return _firstName; }
        set { _firstName = value; }
    }
}

答案 89 :(得分:56)

// If you're reading this, that means you have been put in charge of my previous project.
// I am so, so sorry for you. God speed.

答案 90 :(得分:56)

在大学的家庭作业中为一位特别坚持我们对我们的代码发表评论的老师:

//I wonder if she actually reads these.

当作业被退回时,在评论旁边的红色笔旁边写着“是的,我愿意”

答案 91 :(得分:55)

来自泄露的Windows 2000源代码的好消息:

  

!!!!!!!如果你改变空间,你将被杀!!!!!!!! *
  !!!!!!!!!!!!!!这样做他妈的   处理!!!!!!!!!!!!!!!! *
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!

http://www.kuro5hin.org/story/2004/2/15/71552/7795

答案 92 :(得分:54)

// The ratio of a circle's circumference to its diameter.  Remember to change
// this to 3.0 if you move to a site in Indiana.

#define Pi                                      3.1415927

答案 93 :(得分:54)

我一直很喜欢Paul DiLascia在他的文件标题中写的内容:

// If this code works, it was written by Paul DiLascia. If not, I don't know
// who wrote it

答案 94 :(得分:53)

// human madable inconvenient. Way too sucks.

我仍然不完全明白这意味着什么,但我发现很多代码都是如此。

答案 95 :(得分:53)

// error codes
#define ERROR_SUCESS 0
#define ERROR_SUCCESS_IS_MISSPELLED 1

未定义其他错误代码。

答案 96 :(得分:53)

从嵌入式系统中的电池监控模块:

// batmon.c drives the rastamobile

答案 97 :(得分:52)

从泄露的Win2K源代码:

// The magnitude of this hack compares favorably with that of the national debt.

答案 98 :(得分:51)

Donald Knuth的另一个经典之作:

谨防上述代码中的错误; 我只是证明它是正确的,没有尝试过。

答案 99 :(得分:50)

// Any maintenance developer who can't quote entire Monty Python
// movies from memory has no business being a developer. 
const string LancelotsFavoriteColor = "$0204FB"

答案 100 :(得分:49)

//There can Only Be one HIGHLAN....err..Singleton
public class SomeSingleton
{
...
}

答案 101 :(得分:49)

// if i ever see this again i'm going to start bringing guns to work

答案 102 :(得分:49)

// I put on my robe and wizard hat...

答案 103 :(得分:48)

// The following strings are meant to be funny.  Do not edit these strings
// unless you are funny, too.  If you don't know if you're funny, you're
// not funny.  If fewer than 2 people unrelated to you have told you that 
// you're funny, you're not funny.

答案 104 :(得分:47)

在linux 1.0内核调度程序(sched.c)上:

  

Dijkstra可能讨厌我。

/*
 *  'schedule()' is the scheduler function. It's a very simple and nice
 * scheduler: it's not perfect, but certainly works for most things.
 * The one thing you might take a look at is the signal-handler code here.
 *
 *   NOTE!!  Task 0 is the 'idle' task, which gets called when no other
 * tasks can run. It can not be killed, and it cannot sleep. The 'state'
 * information in task[0] is never used.
 *
 * The "confuse_gcc" goto is used only to get better assembly code..
 * Dijkstra probably hates me.
 */
asmlinkage void schedule(void)

(...)

答案 105 :(得分:47)

//uncomment the following line if the program manager changes her mind again this week

答案 106 :(得分:46)

using namespace std;            // So sue me

答案 107 :(得分:46)

//Abandon all hope ye who enter beyond this point

答案 108 :(得分:46)

// This procedure is really good for your dorsolateral prefrontal cortex.

对于那些由于某些特殊原因而不知道DPC的人,当你深入学习新事物时,你的大脑就会变亮。

答案 109 :(得分:46)

//I'm sorry, but our princess is in another castle.

答案 110 :(得分:44)

//ALL YOUR BASE ARE BELONG TO US

......这让我的老板觉得有人入侵了。他不知道这个笑话。

答案 111 :(得分:44)

sqlite源文件的顶部:

/*

** The author disclaims copyright to this source code.  In place of             
** a legal notice, here is a blessing:                                          
**                                                                              
**    May you do good and not evil.                                             
**    May you find forgiveness for yourself and forgive others.                 
**    May you share freely, never taking more than you give.

*/

答案 112 :(得分:44)

/**
 * If you don't understand this code, you should be flipping burgers instead.
 */

答案 113 :(得分:42)

大约10年前,我在图像处理,扫描显微镜视频帧以检测细胞运动。我在一个特殊的复杂功能工作,并决定出去和朋友一起喝酒。当我回到家时,我工作了一点但不是太多,因为我喝醉了。早上我发现一个10行完全混乱的功能,并带有以下评论(显然是由我自己写的):

/* Ah ah ah! You'll never understand why this one works. */

最奇怪的是它甚至工作

答案 114 :(得分:42)

我在我发布的WordPress模板中发布了此“许可声明”。无论如何,我觉得这很有趣。

/* The License:
You (from this point on referred to as The You) are hereby 
granted by me (from this point on referred to as The Me) 
license to knock yourself silly with this template. 
By using this template The You implicitly accepts this 
license and pledges solemnly to never claim creative 
ownership of any graphics, code, concepts, eggs, bacon, ideas, 
colors, shapes, hypertext-transfer protocols or other conduits 
of the visual splendor thatis this template. 

The Me, in turn, pledges equally solemnly to be far too 
lazy to ever check up on you, so if you do manage to pull 
some chicks The Me won't have a cow. 
However The Me would be sorely disappointed if The You 
were to try and sell or distribute this work without 
acknowledging The Me. Seriously. The Me will come down on 
The You like a large quantitiy of hard and heavy objects 
that in large quantities may be harmful and possibly even 
lethal to The You; So don't even think about it, The Buster.
*/

答案 115 :(得分:41)

答案 116 :(得分:41)

简单但有效的评论,在某些C ++代码中不太安全的黑客之前

// yikes

答案 117 :(得分:41)

来自我们的一个项目。
某个源文件末尾的某处。

/*@                                    /\  /\
 * @                                  /  \/  \                        ----- |   | ----      |---\ |    | /--\  --- |   |  ---- /--\ /--\
 *  @                                /        --                        |   |   | |         |   / |    | |      |  |\  |  |    |    |
 *   \---\                          /           \                       |   |---| ----      |--/  |    |  \     |  | \ |  ----  \    \
 *    |   \------------------------/       /-\    \                     |   |   | |         |  \  |    |   -\   |  |  \|  |      -\   -\
 *    |                                    \-/     \                    |   |   | ----      |---/  \--/  \--/  --- |   \  ---- \--/ \--/
 *     \                                             ------O
 *      \                                                 /                 --- |   | ----  /--\        |--\   /--\   /--\
 *       |    |                    |    |                /                   |  |\  | |    |    |       |   | |    | |
 *       |    |                    |    |-----    -------                    |  | \ | ---- |    |       |   | |    | | /-\
 *       |    |\                  /|    |     \  WWWWWW/                     |  |  \| |    |    |       |   | |    | |    |
 *       |    | \                / |    |      \-------                     --- |   \ |     \--/        |--/   \--/   \--/
 *       |    |  \--------------/  |    |
 *      /     |                   /     |
 *      \      \                  \      \
 *       \-----/                   \-----/
 */

答案 118 :(得分:40)

我不止一次使用过这个,当我对数学公式进行某种非显而易见的简化时,我不想记录:

//this formula is right, work out the math yourself if you don't believe me

答案 119 :(得分:40)

在GIGANTIC 800系列“切换”声明中,位于中间位置:

// Joe is sorry

几百行后......

// Harry is sorry too

答案 120 :(得分:39)

.class {border:1px solid gold;} /* I pitty the fool */

答案 121 :(得分:38)

// Caveat implementor

答案 122 :(得分:37)

这是我曾经不得不支持的实际代码。在努力理解AstaSaysGooGoo和AstaSaysGaaGaa(其中宣布和使用了更多astaTempVars)的逻辑之后,我已经准备好放弃了。我终于抬头看到了“@author”评论,整个事情开始变得有意义了。

/*

* @author Andrew Asta
*/
public class AstaClass{

    private String astaVar1;    
    private String astaVar2;    
    private String astaVar3;    
    private String astaVar4;    
    private String astaVar5;    
    private String astaVar6;    
    private String astaVar7;    
    private String astaVar8;    
    private String astaVar9;    
    private String astaVar10;   

    public void AstaSaysGetData(){
        //JDBC statement to populate astavars 1 through 10
        //...
        String astaSqlStatment = "Select astaCol1, astaCol2, astaCol3... From AstaTable Where...";
        //..
        //...
    }

    //Perform data manipulation on astavars...
    public void AstaSaysGaaGaa(){
          [removed for sake of brevity]
    }


    //Perform more data manipulation on astavars...
    public void AstaSaysGooGoO(){
        [removed for sake of brevity]
    }

    public void AstaSaysPersist(){      
        //JDBC statement to save astavars to DB 
        String astaSqlStatment = "Update AstaTable set astaCol1 = @astaVar1
                                                  , set astaCol2 = @astaVar2
                                                  , set astaCol3 = astaCol3... 
                                                  Where...";
    }
}

PS我改变了实际作者的真实姓名,以避免我遇到任何争议......

答案 123 :(得分:37)

从Netscape网页浏览器的UNIX风格的源代码,大约1997年:

/* HP-UX sucks wet farts from dead pigeons' asses */

在Moz开源之前,不幸删除了这些珍珠......

答案 124 :(得分:37)

//Mr. Compiler, please do not read this.

答案 125 :(得分:36)

'NO COMMENT

答案 126 :(得分:36)

long time; /* just seems that way */

答案 127 :(得分:35)

aComment = 'this is not aComment' # this is aComment
class T(object):
    def f(this):
        this is not aComment

答案 128 :(得分:35)

此评论位于包含接口的单元中,这些接口用于绑定主应用程序与各种第三方驱动程序之间的通信。

//**************************************
// Dear code maintainer:
//
// This source contains COM interfaces, not to be confused with interfaces 
// of any other sort, please do not just willy-nilly add additional methods 
// to these interfaces as they are truely immutable, unlike the interfaces 
// that other software vendors like Microsoft maintain.  IF you need to add 
// new functionality, then go thru the trouble of creating a NEW interface 
// and implement this functionality on only the objects you need.  
//
// While the money is good for fixing all of the problems caused by not 
// following the rules, I would rather work on things which actually have
// an impact on the future of the product rather than curse and yell 
// obsenities at the screen because someone didn't bother to understand the
// true meaning of IMMUTABLE.  
//**************************************

答案 129 :(得分:34)

-- Comment this later

这是4000多行PL / SQL程序的第2行。唯一的评论。在该程序开发4年后,后来仍未来......

答案 130 :(得分:34)

有一些旧的javascript代码,写得很好。然后是评论专栏

// and there is where the dragon lives

接下来是一个功能4人花了一天时间来了解它在做什么。最后,我们意识到它甚至没有使用,也没有做任何事情。

答案 131 :(得分:34)

我曾经想出了一个我认为是一个特别棘手的问题的优雅解决方案,回想起来它有点令人费解并且大量使用宏程序。多年后,我从维护程序员那里找到了这条评论

/*
    Description: The Total Perspective Vortex derives its picture of the
                 whole Universe  on the principle of extrapolated matter
                 analyses.

                 To  explain  -  since every piece of matter in the Universe
                 is in some way affected by every other piece of matter in
                 the  Universe,  it  is  in  theory possible to extrapolate
                 the whole of creation - every sun, every planet, their
                 orbits, their composition and their economic and social
                 history from, say, one small Macro.

                 The man who invented the Total Perspective Vortex did so
                 basically in order to annoy the IT department.

                 Steve Weet - for that was his name - was a dreamer, a
                 thinker, a speculative philosopher or, as some would have
                 it, a slacker.

                 And they would nag him incessantly about the utterly
                 inordinate amount of time he spent staring out into space,
                 or mulling over the mechanics of Chelsea FC, or doing
                 spectrographic analyses of macros.

                 "Have  some  sense  of  proportion!"  they would say,
                 sometimes as often as thirty-eight times in a single day.

                 And so he built the Total Perspective Vortex - just to show
                 them.

                 And into one end he plugged the whole of reality as
                 extrapolated  from one  macro, and into the other
                 end he plugged the IT department: so that when he turned it
                 on they saw in one instant the whole infinity of creation 
                 and theirselves in relation to it.

                 To  Steve Weet's horror, the shock completely annihilated '
                 their brains; but to his satisfaction he realized that he
                 had proved conclusively that if life is going to exist in a
                 Universe of this size, then the one thing it cannot afford
                 to have is a sense of proportion.

*/

答案 132 :(得分:33)

catch (Ex as Exception)
{
     // oh crap, we should do something.
}

没有什么比空的catch块更能让人觉得代码很健壮......

答案 133 :(得分:33)

为了保护罪名,价值已经改变

这是一个承包商留下的,他一直在处理一大堆负责测试电子邮件登录的代码。我们难以置信,所以我们尝试了,这是他个人帐户的有效登录;我们仔细检查了修订历史记录,并且他有两个签到它来编辑它:一个用来添加代码,第二个用来注释它。

我们添加了艺术品,剩下的就是其他人;另一位开发人员认为从他未来的自己(ala 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

答案 134 :(得分:32)

我看到这个很多

// TODO make this work

答案 135 :(得分:32)

陈述明显的?

/** Logger */
private Logger logger = Logger.getLogger();

答案 136 :(得分:31)


$you = live("free") or die("hard");

答案 137 :(得分:30)

多年前写一些Perl时,我在顶部和底部添加了这些注释:

# <magic type="voodoo">

...

# </magic>

下一个看待它的人在Perl上并不那么热门,花了一段时间搜索文档,了解“魔法”和“伏都教”的作用。从那以后,我试图添加更多有用的评论......

答案 138 :(得分:30)

来自Google代码项目:

# This job would be great if it wasn't for the fucking customers.

答案 139 :(得分:29)

when :orientation
## Avoid matching gay people with straight people - they hate it, they do, they really do.
query_parameter = "(users.orientation = 'Bi' OR (users.orientation = 'Straight' AND users.gender IN ('#{user.opposite_genders.join('\',\'')}')) OR (users.orientation = 'Gay' AND users.gender IN ('#{user.same_genders.join('\',\'')}')))"

来自约会网站......

答案 140 :(得分:28)

问:“您遇到过的源代码中最好的评论是什么?”

A:简单 - 帮助我解决当时遇到的任何问题的那个,而且有很多这些问题!

第二好的是帮助指导新发展避免已知陷阱的那些。

答案 141 :(得分:28)

//The following 1056 lines of code in this next method 
//is a line by line port from VB.NET to C#.
//I ported this code but did not write the original code.
//It remains to me a mystery as to what
//the business logic is trying to accomplish here other than to serve as
//some sort of a compensation shell game invented by a den of thieves.
//Oh well, everyone wants this stuff to work the same as before.
//I guess the devil you know is better than the devil you don't.

答案 142 :(得分:28)

//        .==.        .==.          
//       //`^\\      //^`\\         
//      // ^ ^\(\__/)/^ ^^\\        
//     //^ ^^ ^/6  6\ ^^ ^ \\       
//    //^ ^^ ^/( .. )\^ ^ ^ \\      
//   // ^^ ^/\| v""v |/\^ ^ ^\\     
//  // ^^/\/ /  `~~`  \ \/\^ ^\\    
//  -----------------------------
/// HERE BE DRAGONS

我无法访问原始文件,因为我不再在那里工作,但它与此图片非常相似。它总是在文件的顶部引起麻烦,我们不得不修复但不允许花时间来真正解决问题。 (大学政治)

答案 143 :(得分:27)

//Visual Studio Bug Workaround:
//http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101677

//To fix 'CJumpToHelper::GetInstance()' : undeclared identifier compiler errors, change the number lines below
//until the file compiles correctly. (This needs to be done anytime a change is made to this file)

    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines
    //////////////////////////////////////: There should be 1-10 of these lines

答案 144 :(得分:26)

/// <summary>
/// The possible outcomes of an update operation (save or delete)
/// </summary>
public enum UpdateResult
{

    /// <summary>
    /// Updated successfully
    /// </summary>
    Success = 0,

    /// <summary>
    /// Updated successfully
    /// </summary>
    Failed = 1
}

答案 145 :(得分:26)

//  If you delete the credits, I will fucking kill you.

在joomla模块中找到。

答案 146 :(得分:25)

//Woulda
if(x) {}
//Shoulda
else if(y) {}
//Coulda
else {}

答案 147 :(得分:24)

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

...

// 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;

...

答案 148 :(得分:23)

生产源代码:

// Remove this if you wanna be fired

答案 149 :(得分:23)

//If you're reading this, then my program is probably a success

答案 150 :(得分:23)

我的一位老板总是在谈论我们如何在内部使用我们自己的产品,即“吃我们自己的狗粮...”

多年以后,我发现某个临时工友已经完成了某些来源的嵌入,他触摸的每个功能都被标记为:

/* NOT FIT FOR HUMAN CONSUMPTION */

答案 151 :(得分:22)

经典ASP:

'Is it worth it, let me work it'
'I put my thing down, flip it and reverse it'
'Ti esrever dna ti pilf, nwod gniht ym tup I'

NextIP = StrReverse(UserRecordset.Fields.Item(0))

答案 152 :(得分:22)

//open lid


//take sh!t


//close lid

文件打开,数据转储,文件关闭的评论......

答案 153 :(得分:22)

$this->getSelect()->where ('main_table.product_id = -1'); // Mom, Dad... sorry

答案 154 :(得分:22)

年龄前我碰到了这个:

/***************************************************************************/
/*  deep wizardry. do not touch.                                           */
/*                                                                         */
/*  no seriously.  XXXXXX I'm looking at you. If you screw with this again */
/*  I will kill you with my swingline stapler.                             */
/*                                                                         */
/* ...                                                                     */

然后继续描述一种特别毛茸茸的算法。

答案 155 :(得分:22)

// (c) 2000 Applied Magic, Inc.
// Unauthorized use punishable by torture, mutilation, and vivisection.
啊,我一直很喜欢那个......

答案 156 :(得分:22)

前段时间我遇到过:

raise InvalidChild() # e.g. no legs

这是怪诞的,因为“ inwalida ”在波兰语中,意味着残疾人。愚蠢的我:)

答案 157 :(得分:22)

public GetRandomNumber()
{
    // Chosen by a fairly rolen dice
    return 12;
}

答案 158 :(得分:21)

目前为止最好的一个:

"This code makes baby Jesus very sad!". 

它引用了一个String初始化,如下所示:

String blankSpaces="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "+ //100 whitespaces
                   "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "+ //200 Whitespaces
                   ...
                   "                                        " //100 whitespaces

嗯,你明白了。

答案 159 :(得分:20)

我告诉受指导者至少做一些异常处理。这就是我在每次数据库调用时获得的回报......

Catch (Exception e) {
    //eat it
}

答案 160 :(得分:20)

对上帝诚实:

// This is crap code but it's 3 a.m. and I need to get this working.

答案 161 :(得分:19)

在众所周知的商业DOS电子表格应用程序中:

/* This comment was just added in order to check-in a file that was last 
checked in by [Insert Programmer FirstName] "Back-to-the-Future" [Insert 
Programmer LastName]. While testing for year 2000 problems, he accidentally 
checked-in this file while his machine clock was set forward to the year 2000. 
This meant that the source code was always newer than the object file and 
compiled every time the code was built. I'm checking this file in again to 
fix that. */

答案 162 :(得分:19)

// Houston, we have a problem

答案 163 :(得分:19)

当我在路透社工作时,我们的一位饲料处理人员发表评论,让一些人认为全能者正在帮助我们......

// Jesus told me to skip to the end of the message here

我们后来发现有一个名为耶稣(HeyZus)的拉丁美洲联系人。

答案 164 :(得分:19)

我写过的最喜欢的评论:

//the XML returned from this request is *mind-bogglingly* bad. Terrifyingly bad.
//a completed batch looks like this:
//<Batch>batchid=363777811 status=Done dateandtime=09/18/2007 09:53:10 PDT activateditems=335 numberofwarnings=0 itemsnotacivated=17 </Batch>
//and an incomplete batch like:
//<Batch>batchid=363778361 status=In Progress </Batch>
//so we'll just parse each item as a regex. Thanks Amazon.

是的,亚马逊实际上会像这样返回XML。

答案 165 :(得分:19)

//  Hey, your shoe's untied!

后面是一些可疑的代码,并且在该代码中,

//  Keep looking!  I think it was the other shoe!

最后,

//  How strange -- I must be seeing things.  Anyhow, I'm going to go take a shower, now...

答案 166 :(得分:19)

在可以踩到这个物体的游戏中,或者:

stepOff(); //bitch

答案 167 :(得分:19)

// This should fix something that should never happen

答案 168 :(得分:19)

我最喜欢的是来自已故的伟大的Paul DiLascia:

// Author: If this code works, it was written by Paul DiLascia. If not then I don't know who wrote it.

答案 169 :(得分:18)

  

David S. Miller添加的所有错误   

答案 170 :(得分:18)

  

/ *现在,让所有这些看起来   在缓慢的步骤中一半体面   哥哥   浏览器系列,Internet   他妈的探险家* /

答案 171 :(得分:18)

# There is a bug in the next line.  $searchParameters != {} will always return true, because {} is creating
# a new hash reference on the fly, and the inequality operater is comparing the memory location of it
# to the memory location of $searchParameters, and they will always be different. 
# This means that the following code will always get executed as long as $nodes is defined.
# I'm leaving it there because it has always been there, and although I'm sure it was originally meant to
# mean %$searchParameters (essentially "is this hash not empty"), I'm afraid to change it.
if ( $nodes && $searchParameters != {} )
{

答案 172 :(得分:18)

// some sport psychology
if (!focused)
    Focus();

答案 173 :(得分:17)

// This is a walkaround for bug #7812

由我们的一位中国程序员撰写,英语不是他的第一语言。

我真的很喜欢这个。我碰巧认为“walkaround”几乎是一个比“解决方法”更好的术语。

答案 174 :(得分:17)

// For the sins I am about to commit, may James Gosling forgive me

答案 175 :(得分:17)

我在遗留代码中注意到的修改日志

  

05/17/99 D JONES 评论出来   BLOODY AUZIES CODE(02/19/99)

     

05/17/99 K ROBINSON BLOODY TEXAN   不能正确地摧毁AUSSIE(没有代码   改变 - 只是一个评论)

答案 176 :(得分:17)

在VB.NET中使用分号

TextBox2.Visible = True';
For Each row In data.Tables(0).Rows
    If row("Customers.Id").ToString <> customerId Then
        customerId = row("Customers.ID").ToString';
        name = "Customer Name: " & row("Name").ToString & CrLf';
        address = "Address: " & row("Address").ToString & CrLf & CrLf';
        TextBox2.Text += name & address ';s
    End If';
Next';

答案 177 :(得分:17)

//todo: never to be implemented

答案 178 :(得分:17)

回到八十年代初期,我在汇编程序中引用了这个问题(引用了昏暗的记忆):

I don't understand how the following bit works, but it worked in the program I stole it from.

答案 179 :(得分:16)

一些源代码中的德语评论,由机器或非常疲惫的人类+谷歌翻译

; Rechnen ja ; have faith in yes

我想原文的意思是“假设在这里真实”......但自从我把它当作生命的口头禅。

答案 180 :(得分:16)

Linux内核中的一些:

/* Sun, you just can't beat me, you just can't.  Stop trying,
* give up.  I'm serious, I am going to kick the living shit
* out of you, game over, lights out.
*/

-

/* 2,191 lines of complete and utter shit coming up... */

-

#if 0 /* XXX No fucking way dude... */

答案 181 :(得分:16)

来自Apache Xalan源代码:

/**
 * As Gregor Samsa awoke one morning from uneasy dreams he found himself
 * transformed in his bed into a gigantic insect. He was lying on his hard,
 * as it were armour plated, back, and if he lifted his head a little he
 * could see his big, brown belly divided into stiff, arched segments, on
 * top of which the bed quilt could hardly keep in position and was about
 * to slide off completely. His numerous legs, which were pitifully thin
 * compared to the rest of his bulk, waved helplessly before his eyes.
 * "What has happened to me?", he thought. It was no dream....
 */
protected static String DEFAULT_TRANSLET_NAME = "GregorSamsa";

进一步阅读The Daily WTF

答案 182 :(得分:16)

// A Gorgon class - For the love of Zeus don't look directly at it!

答案 183 :(得分:16)

 /**
   * Returns cookies according to the filters specified.
   * 
   * @return array  Cookies!  Nom nom nom nom nom.
   */
 public function data_getCookies($uid, $name) {

facebook api的某处。

答案 184 :(得分:16)

名为monitoring.sh的文件的前两行:

#!/usr/bin/perl
# perl script disguised as a bash script

答案 185 :(得分:16)

//BELOW IS THE REAL CODE...JABRONI
        //
        // Yeah, but can you play the outtro to Bark At The Moon?
        //

        //|--------------------------------------------------|------------------------------------------------|
        //|--------------------------------------------------|------------------------------------------------|
        //|--17^16-16-16-17^16-17^16-16-16-17^16-17^16----16-|-19^16----16-19^16-19^16---16-19^16-19^16----17-|
        //|--------------------------------------------19----|-------17----------------17---------------17----|
        //|--------------------------------------------------|----------------------------------------------

答案 186 :(得分:16)

Tweet tweet = (Tweet) tweets.get(i); // Poetic.

答案 187 :(得分:15)

// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...

答案 188 :(得分:15)

我发现它在Python 2.5的“扭曲”包中(文件在第371行是tcp.py)

# Limit length of buffer to try to send, because some OSes are too
# stupid to do so themselves (ahem windows)
return self.socket.send(buffer(data, 0, self.SEND_LIMIT))

答案 189 :(得分:15)

// If I from the future read this I'll back in time and kill myself. 

答案 190 :(得分:14)

来自a classic from usenet

  

Teradyne硬件建模代码内部深处的代码是一个例程   整串十六进制数进入SYS $ QIO调用。唯一的评论是   “奇怪的魔法发生在这里”。

答案 191 :(得分:14)

在开发团队中每个人都大量编辑的代码文件的标题中:

'Avert your eyes, it may take on other forms!

好的佛兰德斯。

答案 192 :(得分:14)

//The following code is commented out
//(a load of commented out code followed)

答案 193 :(得分:14)

i++; // increment variable i

答案 194 :(得分:14)

我相信JBoss某处有一行读取

return null; //Not really null

我一直很喜欢这条线。

答案 195 :(得分:14)

有一次,我向同事询问如何使用我们的内部框架做某事(忘记了什么,一些模糊的技术要求)。 他说“简单,看看这里”,然后在他的编辑器中打开一个.java文件,并在几页代码中间显示这条评论:

// HERE

我刚检查过,评论仍然存在于此文件中:)

答案 196 :(得分:14)

来自Xee的图片浏览器

This one

    // At this point, I'd like to take a moment to speak to you about the Adobe PSD format.
    // PSD is not a good format. PSD is not even a bad format. Calling it such would be an
    // insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having
    // worked on this code for several weeks now, my hate for PSD has grown to a raging fire
    // that burns with the fierce passion of a million suns.
    // If there are two different ways of doing something, PSD will do both, in different
    // places. It will then make up three more ways no sane human would think of, and do those
    // too. PSD makes inconsistency an art form. Why, for instance, did it suddenly decide
    // that *these* particular chunks should be aligned to four bytes, and that this alignement
    // should *not* be included in the size? Other chunks in other places are either unaligned,
    // or aligned with the alignment included in the size. Here, though, it is not included.
    // Either one of these three behaviours would be fine. A sane format would pick one. PSD,
    // of course, uses all three, and more.
    // Trying to get data out of a PSD file is like trying to find something in the attic of
    // your eccentric old uncle who died in a freak freshwater shark attack on his 58th
    // birthday. That last detail may not be important for the purposes of the simile, but
    // at this point I am spending a lot of time imagining amusing fates for the people
    // responsible for this Rube Goldberg of a file format.
    // Earlier, I tried to get a hold of the latest specs for the PSD file format. To do this,
    // I had to apply to them for permission to apply to them to have them consider sending
    // me this sacred tome. This would have involved faxing them a copy of some document or
    // other, probably signed in blood. I can only imagine that they make this process so
    // difficult because they are intensely ashamed of having created this abomination. I
    // was naturally not gullible enough to go through with this procedure, but if I had done
    // so, I would have printed out every single page of the spec, and set them all on fire.
    // Were it within my power, I would gather every single copy of those specs, and launch
    // them on a spaceship directly into the sun.
    //
    // PSD is not my favourite file format.

答案 197 :(得分:13)

参展:

return 0; // Happy ending

图表B:

int32_t Interpolate1DSignal(
  Array1D<float64>::Handle hfInputSamples,         // samples to be interpolated
  Array1D<float64>::Handle hfInterpolationFilter,  // polyphase filter coefficients,
  int32_t iFilterInterpolationFactor,              // # of "rows" in polyphase filter
  int32_t iFilterLength,                           // Length of each row in filter
  float64 fInterpolationFactor,                    // Factor to interpolate the
                                                   // signal by
  float64 fTimingOffset,                           // Offset into the signal (units   
                                                   // of samples)
  Array1D<float64>::Handle hfOutputSamples         // left as an exercise for the reader
);

答案 198 :(得分:13)

// This code was written by a genius so don't try to understand it with
// your tiny little brain.

答案 199 :(得分:13)

// this error could never happen

然后 - 客户的电话说他看到一条错误消息,说“这个错误永远不会发生”

答案 200 :(得分:13)

// This will save us ~0.5 sec for every user and please the machine spirits.

在很长的程序之前:)

答案 201 :(得分:13)

else
{
    // rien, c'est parfait.
}

答案 202 :(得分:13)

/**
 * Happy Javadoc haiku:
 *
 * Without Javadoc
 * Builds break in Maven site stage
 * This fixes the build.
 */

答案 203 :(得分:12)

前几天实际上已经看到了这个问题,有些代码是在截止日期之前写的。

//This was clearly written under duress

答案 204 :(得分:12)

// Hard to explain

它最终也被打破了。难怪难以解释

答案 205 :(得分:12)

// Added because boss changed his mind : 20020111,20020501,20020820, ...
// Commented out because boss changed his mind : 20020201,20020614,20020908, ...

在大多数被黑客攻击的RPG数据库和SQL Server数据库之间的ETL脚本中。我有10或20次发表此评论......

答案 206 :(得分:12)

我想我有类似的东西:


if (case1) { // trivial
...
}
else { // we are screwed
 /* fill in later */
}
好的,所以我可能使用了比搞砸的更强的词

答案 207 :(得分:12)

在某些汇编程序中,在包含&h723

的行的末尾
' RIP LVB

(搞定了?)

答案 208 :(得分:12)

/**---------START-----------**/

  //  IMPLEMENTATION GOES HERE

/**---------END-----------**/

但没有代码;)

答案 209 :(得分:12)

我最喜欢的评论是由我的一位同性恋朋友使用的。他喜欢在VB.NET中标记他所有的TODO评论

'TODO: Matt Damon

有时会提供其他信息,但通常不提供。

答案 210 :(得分:12)

当我在Highschool参加CS课程时,我们在普通教室里接受教育 - 没有电脑。我们所有的测试都是在我们递交的纸上完成的 - 每张纸一个类。我们的老师第一次用C ++教课,偶尔会在黑板上切换到Pascal模式。这很尴尬,因为我们很少有兴趣学习Pascal。

对于大于课堂的工作,我们会在家里完成这些工作,并提交代码+输出打印输出进行评分。在提交了一些代码+输出打印输出之后,我们共同意识到老师实际上并没有阅读代码 - 只是打印输出。为了测试我们的理论,我对代码的第3页进行了评论 - 在某些类声明之间:

// If you are reading this, please place a checkmark here [  ]

当然,我在前面拿了一个蓝色的“A”,没有找到勾选标记。

答案 211 :(得分:12)

// BEGIN HACK
...
// END HACK: I feel dirty.

答案 212 :(得分:12)

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

这只是其中之一......

答案 213 :(得分:12)

'Mind boggling, gibberish version of a SQL statement, but it work's, so dont touch it

答案 214 :(得分:12)

在makefile中找到它

# ===== Never edit below this line. Ever. Or I'll kick your ass. ====

答案 215 :(得分:11)

当我实现原型变成真正的代码时,这实际上是由我做的:

// Abandon all hope you who needs to debug this

是的,比我聪明的人事后重构了代码(它必须有一个好的结局)。

答案 216 :(得分:11)

“这永远不会发生”。

着名的遗言我的朋友......

答案 217 :(得分:11)

在XSLT文件的标题中:

DON'T TOUCH THIS SCRIPT -> XSLT is like arcane, black magic

答案 218 :(得分:11)

我不记得确切,但这个想法是这样的:

Person p = new Person("John", "Doe", "male");
Collection women = new ArrayList();
women.insert(p.getTail());

这是脏代码;)

答案 219 :(得分:11)

'Do not optimize these next two lines. Compiler bugs lurk.

他们做到了。将变量压缩到第二行的表达式中导致跳转到堆的中间并尝试执行数据。

答案 220 :(得分:11)

Linux评论

这里有很多好的......

这些都是linux中的评论

http://lwn.net/1998/1015/a/f-word.html

我的最爱:

./arch/sparc/kernel/ptrace.c
/* Fuck me gently with a chainsaw... */

./drivers/scsi/qlogicpti.h
/* Am I fucking pedantic or what? */

答案 221 :(得分:11)

不代码注释,但SVN在同一文件上提交注释:

首次提交(在测试人员返回结果后,其他几十人提交):

Squashed some IPR mod bugs. The were big and juicy ones, too.

第二次提交:

Squashed some more mod bugs. Those are some nasty bugs, them mod bugs...

第三

Squashed some more mod bugs. They are like cockroaches: they'll live through a nuclear war.

第四:

Squashed some more John bugs. They too are like cockroaches: they appear anywhere John goes. Wait. That doesn't sound right.

第五名:

Same John bug. It didn't die, just played 'possum.

是的,我厌倦了“固定的bug”。

答案 222 :(得分:11)

我喜欢GNU binutils中的一些注释。这个来自BFD som.c:

/* You'll never believe all this is necessary to handle relocations
   for function calls.  Having to compute and pack the argument
   relocation bits is the real nightmare.

   If you're interested in how this works, just forget it.  You really
   do not want to know about this braindamage.  */

这也是:

/* Don't ask about these magic sequences.  I took them straight
   from gas-1.36 which took them from the a.out man page.  */

...

/* Keep track of exactly where we are within a particular
   space.  This is necessary as the braindamaged HPUX
   loader will create holes between subspaces *and*
   subspace alignments are *NOT* preserved.  What a crock.  */

另一个:

/* We will NOT put a fucking timestamp in the header here. Every
   time you put it back, I will come in and take it out again. ... */

来自天然气:

/* Yes this is ugly (storing the broken_word pointer
   in the symbol slot).  Still, this whole chunk of
   code is ugly, and I don't feel like doing anything
   about it.  Think of it as stubbornness in action.  */

答案 223 :(得分:11)

我猜它有病毒性,我在守护进程(Linux)中发现以下内容阻止了OOM杀手选择它:

/*
 * Don't OOM me, bro!
 */

这是在mlockall()之后,以防止进程交换,评论:

/*
 * Don't swap me, bro!
 */

答案 224 :(得分:11)

我的最爱(我必须承认我曾多次使用过):

// Yes...I know this is repulsive and stupid.
// But <%CompanyOwnerOrManagerToken%>, not knowing a thing about code,
// demanded I do it anyways. SO, go crap on their desk, not mine.
// K THX BYE 

答案 225 :(得分:11)

/* FIXME This must absolutely be removed before 4.0.7 release
 * TODO really remove this */

我们发布了4.0.7,4.0.8,4.0.9和4.1版本......

答案 226 :(得分:11)

我曾经参与过一个项目,在那里我发现了这个评论:

// Cabbage fart?

我不知道它应该是什么意思。很高兴我的立方体不在谁的旁边。

答案 227 :(得分:11)

/* Here I sit, Joe broken hearted, came to do some sh*t, but only just started. */

关于一些繁重的正则表达式输入验证。

答案 228 :(得分:11)

public function get state( /* of Palestine back */ ):Boolean

答案 229 :(得分:11)

v.bpc     := v.pc;  -- Remember to jump back
v.baccu   := accu;  -- Yo dawg, heard you like runing instructions
                    -- so I took backup of your accu so you can run
                    -- instructions while you run instructions.
v.flags.i := false; -- No more interupts

答案 230 :(得分:11)

在完全任意一行之后的几千行JScr​​ipt文件中......

// The world is a happy place.

答案 231 :(得分:11)

嗯,这是我just committed

/* Every time I re-visit this function, I feel like
 * I need to take a shower.
 *
 * Don't get too used to this function, its days are
 * numbered.
 */

有人可以像greatcodecomments.com一样开始赚钱。然而,那个人不是我。

答案 232 :(得分:11)

// need a coffee to fix this.

答案 233 :(得分:11)

// Singleton object. Leave $me alone.
private static $me;

答案 234 :(得分:10)

int Q13Factor = 8125; // 2^13 for Q13 

答案 235 :(得分:10)

THIS PROGRAM HAS CODE THAT DOES NOT MEET STANDARDS      

这个评论几乎出现在我们这里的所有节目中......

答案 236 :(得分:10)

在JUnit API中找到:

/**
 * ...as the moon sets over the early morning Merlin, Oregon
 * mountains, our intrepid adventurers type...
 */
public Test createTest(Class theClass, String name) {
    ...
}

答案 237 :(得分:10)

在LucasArts的计算机游戏“The Eidolon”的源代码中看到(这本身就很奇怪和古怪)......

// He's dead, Jim!

答案 238 :(得分:10)

// TODO - Comment this function

答案 239 :(得分:10)

  

// Whoever put this here is an idiot...this doesn't work at all !

但代码仍在那里......

答案 240 :(得分:10)

来自一个显然一直在看Monty Python的小伙子:

> // And now, for something completely
> // different:
     

class theLarch {

答案 241 :(得分:10)

// fix for groupid > 9 
// if groupid ever gets to 100 everything will break (again)

if (groupid < 10) {
groupid = "0" + groupid;
}

答案 242 :(得分:10)

今天刚刚添加了这个:

// Hardcoded this for time sake ... will make andrew fix later :)

答案 243 :(得分:10)

此评论来自我必须调试的旧项目:

//Haleluya i can go home!

答案 244 :(得分:10)

在我决定用脚本语言替换它之前,我不得不将这个添加到旧的数据表驱动的规则引擎中。

        /************************************************************
        *                                                           *
        *  .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.       *
        *   |                     ______                     |      *
        *   |                  .-"      "-.                  |      *
        *   |                 /            \                 |      *
        *   |     _          |              |          _     |      *
        *   |    ( \         |,  .-.  .-.  ,|         / )    |      *
        *   |     > "=._     | )(__/  \__)( |     _.=" <     |      *
        *   |    (_/"=._"=._ |/     /\     \| _.="_.="\_)    |      *
        *   |           "=._"(_     ^^     _)"_.="           |      *
        *   |               "=\__|IIIIII|__/="               |      *
        *   |              _.="| \IIIIII/ |"=._              |      *
        *   |    _     _.="_.="\          /"=._"=._     _    |      *
        *   |   ( \_.="_.="     `--------`     "=._"=._/ )   |      *
        *   |    > _.="                            "=._ <    |      *
        *   |   (_/                                    \_)   |      *
        *   |                                                |      *
        *   '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='      *
        *                                                           *
        *      LASCIATE OGNI SPERANZA, VOI CH'ENTRATE               *
        *************************************************************/

答案 245 :(得分:10)

   // Some wanker in ISO got rid of ifstream(int), ofstream(int), and
   // fstream(int).  Twit.

答案 246 :(得分:10)

/**
 * Not even your mum thinks you're special if you call this method
 */    
onlyYourMumThinksYoureSpecialIfYouCallThisMethod() {...}

答案 247 :(得分:10)

从UNIX版本6源代码,大约1975年:

/* You are not expected to understand this. */

答案 248 :(得分:10)

// Fuck.

那,......

// This code worked before, but my cat decided to take a trip across my keyboard...

答案 249 :(得分:9)

// TODO: Implement this function!

答案 250 :(得分:9)

# absolutely foul heuristic code.
# ..it's dirty, but you want it.

# VERY USEFUL DEBUGGING AID, for when the above all goes pearshaped:

答案 251 :(得分:9)

/* My lawyer told me not to reveal */

答案 252 :(得分:9)

不是评论,而是属性

[ThereBeDragons]

我在IHttpHandler的实现中已经看到了

//What is this?
public bool IsReusable
{
    get{return false;}
}

答案 253 :(得分:9)

这是我自己的代码中的一个,但它仍然非常有趣,我想我也可以把它放在一边,因为它是在公共SVN中。

// These were orginally up and down. When it was clear the names were
// inapplicable, they were renamed to retain the joke.
// Sorry if you were hoping for useful variable names.
quantum strange, charm;

答案 254 :(得分:9)

public int hashCode() {
//sucks, but what're you gonna do

/*
int hash = 7;
for (int i = 0; i < array.length; i++)
    hash = hash * 31 * (null == array[i] ? 0 : array[i].hashCode());
return hash;
*/

return 0;
}

答案 255 :(得分:9)

在调试别人的JavaScript时,我看到了以下评论:

// Notice: I feel so dirty doing this, but it's the only way to make it cross browser.

但在阅读Scott Hanselmen的一篇文章时,我发现以下引用与我在代码中发现的评论非常相符:

Every line of code you write that you feel gross about will ultimately come back to haunt you. Therefore, avoid writing code that makes you feel dirty.

这很有趣:)

答案 256 :(得分:8)

// Bad Christian, No cookie

此上下文中的Cookie 是指浏览器Cookie

答案 257 :(得分:8)

这是我最喜欢的评论。

/// I intend to do this as shittily as possible because there are many better products that will totally blow this out of the water
/// and we don't have them so whatever

稍后在文件中我们会有更多的乐趣,比如

/// sidestep a bug in WCF (that we can't send types across)
/// or, depending on how you look at, this issue is a Feature

以后再次

if( where == null)//be nice

答案 258 :(得分:8)

// THE LOOP THAT DO EVERYTHING!!!!!!!

答案 259 :(得分:8)

在一家需要记录和评论所有应用程序中断的大型投资银行中,我看到了

Without a crash 

Or mighty bang 

The sync disk 

Did it's process hang

答案 260 :(得分:8)

catch (Domain.ConcurrencyException)
{
    // somebody changed it between the time we loaded it and now.
    // weird, huh?
}

答案 261 :(得分:8)

我刚刚在一个非常简单的测试C ++程序中遇到过这个问题,为大学里的一个班级。

我正在评论一个班级。

在析构函数中......

// Choose! Choose the form of the Destructor!
// The choice is made! The Traveler has come!

答案 262 :(得分:8)

我在查看an earlier iteration of the TVNZ website的HTML源代码时发现了这个宝石(如果你在家里玩,可以从571行开始):

<!-- Hopfully we can do this otherwise the nav is going to be pretty plain and Hong will go postal. -->

答案 263 :(得分:8)

// TODO: Drive an ashen stake through the foul heart of this function.

这是一个犯规功能。到目前为止,我一直都在做噩梦。

答案 264 :(得分:8)

嗯,这些都是我的,所以WTF就是我,正如CodingHorror所说:

//#region Code for weird cases - do you really want to know?

我曾经在某些ASP中留下了这样的评论:

' Commented out following code, don't delete for when [CustomerName] changes his mind

碰巧,[客户名称]没有改变主意,但他无法访问网络服务器,他找不到那条线......

答案 265 :(得分:8)

// This condition can't happen. Call the police or something.

答案 266 :(得分:8)

var arbitraryNumber = 10;
//I don't know why. Just move on.

答案 267 :(得分:8)

我在Google代码搜索中找到了这个

    // Constructs a tuple with 2 elements (fucking idiot, use std::pair instead!)
    template <typename T0,typename T1>
    inline tuple <T0,T1> make_tuple (const T0& t0,
            const T1& t1) {
            tuple <T0,T1> t;
            t.get<0>() = t0;
            t.get<1>() = t1;
            return t;
    }

答案 268 :(得分:8)

// TODO: not this

由一位同事在一个查询之上撰写,迫切需要优化。在他的辩护中,我们在这一点上已经工作了70个小时几个月......

答案 269 :(得分:8)

/*

 ____________________
/                    \
| Jean-Michel Bechet |
| 2002-2009          |
\___  _______________/
    |/
 (o_
 //\
 V_/_


*/

答案 270 :(得分:8)

// This part is more difficult

在方法的顶部。

这大约是5行。

并不是很困难。

这是唯一的评论。

在整个申请中。

答案 271 :(得分:8)

/**
 * This run through all the guipublisherbuyRecord , the records those have
 * diff. is buytotal and prior to buy isRecommendedBillingClickedWarning flag
 * is set if priously RB ran and this time not.
 * 
 * --What?
 * 
 * @return
 * @throws AppException
 */

答案 272 :(得分:8)

//Dave chapelle reports errors.
function reporterror() {
  davechapelle.trace("FUCK!");
}

答案 273 :(得分:8)

// TODO: Finish.

答案 274 :(得分:7)

我在重新使用我在很久以前写过的PHP类时发现了这一点。我仍然不记得那里发生了什么,我仍然没有找到它...我实际上甚至不记得我写的评论;所以当我找到它时,我大声笑出声。

try
{               
    // Some database logic
}
catch (Exception $ex)
{
    // sure, it looks silly and I honestly cant remember what code used to go here... but i swear i will
    // find a use for this code.... eventually....
    throw $ex;
}

答案 275 :(得分:7)

一个文件中5000多行代码中的一些极少数评论 我实际上与编码人员争论他的编码风格...... 没有评论!
而且没有评论;-)(或很少)
遗憾的是这是生产代码。

offset=1;
for (i=0;i<=len;i++)
    {
    if ((i!=0)&&(i<len)) //-3
        {
        switch(mess[i])
            {
            case ETX:
            case ETB:
            case DLE:
                buf[offset]=DLE;
                offset++;
                break;
            }
        }
    buf[offset]=mess[i];
    offset++;
    }

我喜欢这个开关!

for (n=0;n<offset;n++)
{
    Sleep(TR);  //Modif A
    Sleep(T);//
    FWriteFile(hCom,buf+n,1,&dwMot,NULL);
    if (ECHO)
        FReadFile(hCom,tab,1,&dwMot,NULL);
}

并且没有,没有评论解释标题中的“modif A”。

if (GetFileSize(hSlotFile,NULL)==3600)   //5*720

什么是720?

答案 276 :(得分:7)

在为某个芬兰移动网络设备制造商工作时,通过硬件抽象层进行了搜索我发现了100多个芬兰语单词“puukko”。

'puukko'是每个芬兰人在他们的工具箱或房子周围都有的通用刀。它用于从剥土豆到进行电脑维修(我的观察)的一切。我相信在这种情况下,芬兰语相当于“哈克”这个词。

我的芬兰同事否认了这一点,并表示这意味着更像“外科手术/干预”......我几乎相信它们,直到我找到评论:

/* Perkele ISO Puukko! */ -> Fucking Big Hack!

答案 277 :(得分:7)

一个奇怪合适的有趣拼写错误:

assert(0); // should never shit this point

答案 278 :(得分:7)

不是评论:

DvLog::Log("This silly log message fixes a PSCRIPT5.DLL gpf when printing to Adobe.");

可悲的是,没有评论,PSCRIPT5.DLL确实爆炸了......

答案 279 :(得分:7)

 // WARNING!!!
 // Very perversive code ahead!

... about a 20 lines of "very perversive" code ...

// Now you can call your grandmother back. ;)

答案 280 :(得分:7)

在LKM中:

/*
* Dear Richard Stallman,
*
* This one's for you.
*
* Sincerely,
* Me
*
*/
MODULE_LICENSE( "GPL" );

答案 281 :(得分:7)

i++; //increment i

答案 282 :(得分:7)

// insert comment here

答案 283 :(得分:7)

catch (Exception ex)
{ 
    // just die already.
}

答案 284 :(得分:7)

我最近看到了这个:

  

//你刚刚输掉比赛

如果您不知道游戏是什么: http://en.wikipedia.org/wiki/The_Game_(mind_game) (这很愚蠢,但在某种程度上有点愚蠢)

答案 285 :(得分:7)

// *** drunk -- fix later ***

direct link

使用google code search ...

更有趣

答案 286 :(得分:7)

我在一个显式奇怪的强制转换函数FULL中看到了这段代码:

// Since today's CPUs are really fast, this is dedicated to those who said:
// " You can't use Moore's Law as an excuse to write bad software. "

代码很可怕:)

答案 287 :(得分:7)

我们的应用程序中第一次重新编译FreeTextBox3,因为我们需要IE8支持......看看我发现了什么:

// IE7 update. this is still bad code, but IE8 is probably a long way off :)

答案 288 :(得分:7)

# dont question, i just felt like throwing some globals in
# this is actually quite pointless as youll soon see

稍后在代码中

#draw the circles (complicated)...dont question

甚至更晚......

# complicated process of drawing the circles in a
# somewhat symmetrical, 3-d pattern
# dont question again

甚至更晚......

# will determine if user clicks on die
# i determined these values...dont worry about them

答案 289 :(得分:6)

在向朋友this post from Coding Horror展示几个小时后,我在他的代码中看到了这条评论:

  

// MrValdez是一个暴力的精神病患者。不要惹恼他。

答案 290 :(得分:6)

大学毕业后,我急于弄脏自己的手。我的第一个任务是......“为我评论这段代码”。

笨蛋。

过了一会儿,我厌倦了......

// this function doesn't actually calculated the profit, like it says --it really signals the mothership orbiting saturn that the planet is ripe for takeover

[later]

// I don't think anyone is going to read this

[various permutations on that last one]

答案 291 :(得分:6)

-- Change Log:  Not needed. The code is perfect 'cause I wrote it.
-- If you change it, it will break.

我正在审核一些代码注释以检查它们是否有意义,并且看到了上面的适度行。

答案 292 :(得分:6)

被迫为贫血领域的对象编写单元测试,这些对象只不过是一堆吸气剂和固定剂(我也被迫写作):

// zzzzZZZZzzzz....

答案 293 :(得分:6)

Case 1:
   ...
   break;
   ...
//I don't want do do this but [my coworker] says it's part of the code standard
default:
   break;

答案 294 :(得分:6)

<!-- THIS IS THE MAIN CONFIGURATION FILE FOR THE ENTIRE BLOODY DIRECTORY    -->
<!--    WHATEVER YOU DO, DO NOT EDIT THIS FILE WITHOUT TALKING TO ME FIRST  -->
<!--                                I'M SERIOUS                             -->
<!-- (scroll down) -->

答案 295 :(得分:6)

我没有确切的代码包,但我清楚地记得这个评论。

// The code below needs to be changed immediately.
// I wish I was a little bit taller
// I wish I was a baller
// I wish I had a girl who looked good, I would call her.

答案 296 :(得分:6)

来自C#中的单元测试类:

#region quis custodiet ipsos custodes?

[Fact]
public void TestPositive()
{
    Assert.Equal(4, 2 + 2);
}

[Fact]
public void TestNegative()
{
    Assert.Equal(5, 2 + 2);
}

#endregion

答案 297 :(得分:6)

// I love the smell of dirty XML in the morning
xml = xml.Replace("xmlns=\"urn:bsd.orion/inventory\"", "");

答案 298 :(得分:6)

我曾经研究过Windows 3.0的源代码。 (不是,我赶紧补充一下,作为一名微软员工!)我遇到了一个多次重入的文件加载器,并且有一个令人讨厌的惩罚的例子(只是为了表明作者有多聪明)。

这一堆重入代码是使用英特尔汇编jmp指令(在C代码中间)执行的,该指令转到标签"we_are_not_in_kansas_any_more_toto"

答案 299 :(得分:6)

# Don use this. Never!

答案 300 :(得分:6)

#ifdef TRACE
#undef TRACE     /* All your trace are belong to us. */
#endif
#define TRACE ....

答案 301 :(得分:6)

整个功能非常棒(来自Linux sunhme.c驱动程序,因为Sun的昵称为Happy Meal的网卡。因为之前出现的卡是“大MAC”。获取它?获取它?)

static void happy_meal_tcvr_write(struct happy_meal *hp,
                              void __iomem *tregs, int reg,
                              unsigned short value)
{
    int tries = TCVR_WRITE_TRIES;

    ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value));

    /* Welcome to Sun Microsystems, can I take your order please? */
    if (!(hp->happy_flags & HFLAG_FENABLE)) {
            happy_meal_bb_write(hp, tregs, reg, value);
            return;
    }

    /* Would you like fries with that? */
    hme_write32(hp, tregs + TCVR_FRAME,
                (FRAME_WRITE | (hp->paddr << 23) |
                 ((reg & 0xff) << 18) | (value & 0xffff)));
    while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries)
            udelay(20);

    /* Anything else? */
    if (!tries)
            printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixed\n");

    /* Fifty-two cents is your change, have a nice day. */

}

答案 302 :(得分:6)

// This is confusing, I KNOW, so let me explain it to you.

答案 303 :(得分:6)

// no comment

答案 304 :(得分:6)

# as you can see: I comment the code!

答案 305 :(得分:6)

控制+ A,重写

这是添加到以前项目的源代码管理中的注释,作为签到注释。

答案 306 :(得分:6)

这是针对我们在大学宿舍中使用的自定义DHCP服务器,将计算机放入“干净”或“脏”的IP地址池,具体取决于他们是否注册/安装了补丁和防病毒:

public boolean getDirty (String MAC) // not as fun as it sounds

答案 307 :(得分:6)

// TODO: what the hell is this all about?

然后一些注释掉的代码。

这可以在我们今天早些时候的工作代码中找到。我不确定我是应该笑还是哭...

答案 308 :(得分:6)

// *** AAAAAHAHAHAH!!  What is this??

答案 309 :(得分:5)

我发现了这个:

I'm not sure what I did

答案 310 :(得分:5)

// This code sucks.

答案 311 :(得分:5)

{
This is a gathering place for all unit tests.
Create a TUnitTestWrapper, then call "RunAllUnitTests".

This class will create an instance of each thing to be tested, and call each of
their unit tests.

It does not really do any testing on it's own; it just gives a common place from
which to call everyone else's tests.

This way, one day, we can automate our testing with each build. [Cue laughter]
}

答案 312 :(得分:5)

struct core_unlocker
{
    core_unlocker(lock)
    {
        m_lock = lock
        unlock(lock)  //Abandon All Locks, Ye Who Enter Core!
    }
    ~core_unlocker()
    {
        lock(m_lock)
    }  
    private:
    Corelock m_lock;
}

答案 313 :(得分:5)

在名为“Bar”的类(具有少于描述性名称的UI控件)中,类标题为:

/// <summary>I pity the "foo".</summary>

Remove()方法:

/// <summary>A "foo" and his money are soon parted.</summary>

更糟糕的是,它是业务合作伙伴从生成的文档中指出了它。更糟糕的是,这些可能是我们从这个人那里得到的有用文档中最接近的东西。

答案 314 :(得分:5)

//Iterate by one
$i++;

不幸的是,在我的“必须评论所有阶段”中,这是我的。

答案 315 :(得分:5)

在某些网站上工作时,我在嵌入式JS的开头找到了这个:

  

我觉得这样做很脏,但那个人想要它在.NET中

答案 316 :(得分:5)

来自C#

#region Hack - Shield Eyes Before Expanding

/// <summary>
/// A single uint with all of the bits set to represent the different tracing
/// </summary>
/// <remarks>
/// Ugly I know, so if you can think of a better way, feel free to rewrite.
/// </remarks>
[Browsable(false)]
public uint TraceBitfield
{
    // Snip
}

#endregion

答案 317 :(得分:5)

很久以前我遇到了一些连接脚本,虽然我不记得语法,但我记得这些评论,因为我是Pink Floyd粉丝。

//Attempt Handshake: Hello? This is London calling. Are we reaching you?


//Handshake Failed: I don't understand...he just hung up.

答案 318 :(得分:5)

解码的可怕补丁(意大利语翻译):

/**
*@return the value 
*@param key: the id of the list of instruments
*@PS this function is a violation of all the laws of the 
*software engineering, 
*commons sense, highway code 
*and ONU decision about the coding.
That sh*t...
*/

答案 319 :(得分:5)

那个是众所周知但我喜欢它(在sys / ufs / ufs_vnops.c中):

/*
 * A virgin directory (no blushing please).
 */

在FreeBSD内核源代码树中(甚至在之前,回到4.xBSD)

答案 320 :(得分:5)

在我们的一些PHP代码中找到了这个

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

多么有用,幸运的是$ s是自我解释的

答案 321 :(得分:5)

try {
   doSomething();
} catch(err) {
   // Die quietly
   alert(err);
}

答案 322 :(得分:5)

不在代码中,而是在相关的错误跟踪系统中:

  

这不是我的代码中的错误。我非常仔细地编码。

答案 323 :(得分:5)

我刚刚在自己的一些代码中遇到了这个问题。它是用于选择类别的magento管理模板:

        /*
         * OK; before you read the following code know what I am trying to do.
         * I needed to get the list of child catagories from the root node so that
         * the root node didn't appear in the selection box. But for some stupid
         * fucking reason the stupid fucking DBA wont let me access the items using
         * indicies and I instead have to use their stupid fucking Iterator
         * implementation. So there.
         */
        $firstList = $this->getRootNode()->getChildren();
        foreach ($firstList as $node)
        {
            $nodes = $node->getChildren();
            break;          // wtf?
        }

我将从我们的旗舰产品中删除当然的语言;但我记得我非常沮丧。如果我没有发表评论,我会尝试修改它,但后来遇到了我以前遇到的相同问题。

答案 324 :(得分:5)

// nobody read comments!

答案 325 :(得分:5)

这比您在许多评论标题中看到的可怕的法律声明和免责声明要好得多。来自SQLite

/*
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
*/

答案 326 :(得分:5)

设法将这个不良双关语插入我们的代码

for (bo_thans = 0 ; bo_thans < MAX ; bo_thans++)
{
    if(rs == thing[bo_thans])
    {
       found = true;
    }
}

if(!found)
{
   /* Failed to find rs with bo_thans */
   ...
}

答案 327 :(得分:5)

来自英国银行申请的承包商。

// i don't know how this works but it does so i'll leave it here anyway

他还将BNP(英国非常右翼派对)作为测试中的一个虚拟客户添加......我们的直接老板是亚洲种族。

答案 328 :(得分:5)

<!-- Here it is -->

任何地方都没有其他评论。直到今天,我还不知道它是什么。

答案 329 :(得分:5)

我没有要分享的代码,但想象一下这种情况。在Linux系统管理员离开绿色牧场后大约一两个月,我有幸打开了他写的shell脚本。我不记得为什么我需要编辑它,但这不重要。重要的是剧本大约有40行。我滚过评论(其中有37行)以达到实际工作代码(3行)。代码很棒,但我很好奇 - 为什么有37行评论?所以,我滚动到顶部继续阅读。令我惊讶的是,评论是关于三行代码的作用以及如何改变它的说法。最好的部分 - 这是Dre博士和Snoop D O DOUBLE G的部分内容。感谢Brian!

答案 330 :(得分:5)

/*
* TODO: Remove this function

function remove($customer_id)
    {
        $this->Customer->remove($id);
    }

*/

答案 331 :(得分:5)

我个人最喜欢的是documentation in limerick form

        Subclassing made Zope and TR
        much harder to work with by far.
            So before you inherit,
            be sure to declare it
        Adapter, not PyObject*

这可能会破坏这个笑话,但由于它有点模糊,我会解释:

“TR”在这里指的是“扭曲的现实”。 Zope 2和原始的twisted.reality软件包广泛而不幸地使用了多重继承,这使得在看到方法调用时很难理解发生了什么。 Zope 3,扭曲了自己,twisted.reality的继承者(包括最近的,Imaginary)反而普遍赞成组件构成。

答案 332 :(得分:5)

/**
 * As Gregor Samsa awoke one morning from uneasy dreams he found himself
 * transformed in his bed into a gigantic insect. He was lying on his hard,
 * as it were armour plated, back, and if he lifted his head a little he
 * could see his big, brown belly divided into stiff, arched segments, on
 * top of which the bed quilt could hardly keep in position and was about
 * to slide off completely. His numerous legs, which were pitifully thin
 * compared to the rest of his bulk, waved helplessly before his eyes.
 * "What has happened to me?", he thought. It was no dream....
 */
protected static String DEFAULT_TRANSLET_NAME = "GregorSamsa";

答案 333 :(得分:5)

catch
{     
    // you’re fucked
    // write out the file somewhere and start screaming “Connection down! Connection down!”
}

答案 334 :(得分:5)

许多年前,我接受了这项工作,为一个真实的项目提供支持 在Z80上的时间并在装配(有没有其他方式做Z80 ??) 无论如何,原作者是一个名叫摩西的尼日利亚人。也许我应该 停在那里。 无论如何,分散在整个代码中的是:

XRA A    ;MT

花了一些时间来弄清楚这是什么。指令本身不做什么 比清除累加器。这是一个光滑的方式,虽然我不确定是否有 有利与否。你可以这样做:

LDA 0

但也许

XRA A

保存一个字节或其他内容。什么是独占或累积器本身。 结果当然总是为零。

回到MT - 空(得到它?)

这是我遇到的最好的。

答案 335 :(得分:5)

""".........................:~+?7$$$ZZZZZZZ$$$7I+=:,............................
........................~+7ZZZZZOZZOOZOZZOZOZOOZZZZZ7?~:........................
......................,~7$ZZOOOOOZOZOZOZZOOZZOZOOOOOZ$$I,.......................
...................,=I$OOZOZOZZOOOZZOZOOOOZOZZZOOZZZOZZOZI=:....................
.................:?$ZZOOZZOZOZZOOOZZZOOZOZOZZZZZZZOZZOZOOOZ$I~..................
................IZOOOZOOOZZZOZZZZOZZOZOOOOZOZZZOOZZZZOOZOZZZOZ7=................
...............~ZZOZZOZOOZOOZOZOZZOZOZOZZZZZOZOZZOZOOZOZZOOOOZZ7................
.............:IZOOZOZZZZOZOZZOZOOZOZOZOZZOZOOZOOOOZOZZZZZOZOZZOOI~..............
...........,+$ZOOZZOZOZOZOZOZZOZOZOOZZOZZOZZOZOOOOZOZZOZZOOZOOOOO$?:............
..........:IZZOOOZOZZZZOOZOOZOZOZZOZOZZZZOZOOZOZZOZOZOZOOOOOOOZZZOZ7~...........
..........+$OOZZZOZZOOZOOZZZZOZZOZOZZOZOOOZOZOZZOZOZOZOOOOOZ$$77I77$+:..........
........,?$OOZZZZZZZOZOOOZOZZOZZZOOZOZOOOOZOZZZOOZOOZOOO7?~:,.......,...........
........+ZOOZZZZZOZOOZOOZZZZOZZOOOZZZOZOZOOZZOZOZZZOOO$?........................
........$ZOZZZOZZZZOZOOZZZOZOZZOOOOOOOOOOOZOZOZZOZOO$?,.........................
.......:ZOOZOZOZZOOZZOZOZOZOOOZOOOOOOOOOOOOOOOZOZOOZI:..........................
.......+OOOZOOZOZOZOZZZOOZOOZOOO$I+=~:::~+I$OOOOOOZ?:........,:=,...............
......:7ZOOZOZZOOOZOZOZOOZOOZ$I=............:?$OOZ7:.......:IZOOZ?,.............
......=$OZOZOOZOOOOOZOZZOOZ7=,................:?O$+.......~7OOOOOZ+,............
.....,?$OOOOOZZZZOOOOOOZOZ?,....................ZZ=.......=$OOZOOZ+,............
.....:IZOZZ$777I7$ZOOOOOZ7~.....................$Z=.......~7OOOOO7=.............
.....:+?~:,.......,~IZOO7~........~+II?=........?$?,.......:I$ZZ?:..............
.....................+ZO=,......:IOOOOOZ:.......=7$~............................
.....................:IO~.......=OOZOZOO=,......~7O7~...........................
...........:~:.......:IO~.......+OOOOZOO=.......~78Z?,.................,:.......
..........:IZ7~......+ZO~.......:7OOOOO$,.......+$OOZ7=,.............:?$=.......
...........,,.....,=7ZOO+,.......,=II?=:........7OOOOOOZ=:,.....,:=I$ZOO=.......
....................,:+$7=.....................~OOOZZZOOOZZ$$7$$ZOOOOOOZ=.......
......................:?Z?,...................:?OZOOZOOZOOOOOOOOOOZOZOZO=.......
............,::,.......,OO7:................,+$OOZOZOOZOZZOZOZZOOZOZOZOO=.......
...........~$8OI........$OOZI~,.........,:=IZOOZOZOZOZOOOZOZOZOOOZZZOZOO=.......
...........:??=:.......:OOOOOZZ7+=~~==+?$ZOOOOZOOOZOZOZOOZOZOZZOZZOZOZZO=.......
............::,.......,+OOZOOOOO$7777$$ZOOOOOZOZZZZOZOZZZOOZOZZOOOZOOZOO=.......
.....................=7OOZOOZOOZOOOOOOOOOZZZOZOZZOZOZOZOOOZOZOZZOZOOZOOO=.......
................,:=I$OOOZZOOOZOOOOOZOZOZZZZZOOZZZOZOZZZOOZOOZOZOZOZOZOOZ=.......
...........:~+?7ZOOOOOOZZZOZOOZOZOOZOZOZZOZZOZOZZZZOZOZZOZOZOZZOZOOZOOOZ=.......
........$$ZOOOOOOOOZOZOZZZZOZOZOOOZZZOZZZOZOOZOZZZZZZZZOOOZOOZZZOZOOZOOZ=.......
.......~OOZOOZZOOZZZZZZOOZOZOZOZZOOZOOZZZOZZOZOZZOZZZOZOOOOOZOZOZOOZOOOZ=.......
.......~OOZOOZZOZZOZOZZOZZOZOOZOZOOZOZOZZOZOOZOZZOZOZOZOZOOZOZOOOZOOZOZO=.......
.......~OOZZZOZOOOZOZOZZOZOZOZOZOOZOOZOOOOZOZOOZOOOZOOOZOZZOZOZOOZZOOOOZ=.......
.......~OOZZOZOZZZOOZOOZOZOZOZZOZZZZOZZZZOZOZZOOOOZ$ZZZZZZOZZZOZZOZOZZZO=.......
.......~OOZZOO$??$OOZOOZZOOZOZOZ+~IZOOOZOZOOZZOOZI==IZOZZOZOOZOZZOZI~=7O=.......
.......~OOZO$I:..~IZZZOZOZOZOZ$+...=7ZOOZOOZZOZZ=,..,=$ZZOZZZZZOZI~...,?=.......
.......~OOOZI:....:IZOOOZZOOO$+:....~7ZOZOZOZOZ$,....,=$OOZOOOZOI~.....:~.......
.......~OZI~........~IZZZOZ$?:........=IOOZZZ$+,.......,$ZOOOZZ7................
.......=7~............~IOZI:............7ZO$+:..........,=7ZZ7=,................
.......,,...............=~...............~=:..............,~=...................
                                                               GlassGiant.com""" 
print "Hello World!"

答案 336 :(得分:5)

  

/* This is a replica of a horrible hack - many moons ago, the legacy PortfolioServer was modified to return cash trades in an "optionTrade" block, because the client side developer was too lazy to get their XPaths right. Their laziness echoes through the ages, and means we need a similar hack here...*/

答案 337 :(得分:5)

//Time log says you've been here for 15 hours GO HOME, your code is hobo

答案 338 :(得分:5)

我们有一个小组项目,使用Min-Max树创建Connect 4 AI。在我们的移动评分函数中,我们计算了董事会的分数,并且在该代码块之上有这样的评论:

// This is kind of almost useless

但它变得更好。我们的导师给了我们一些原始人工智能的样本代码,他留下了很好的评论:

// We also add/subtract some points based on what's going on, on the bottom
// row. (I think this is retarded, but apparently when I coded this up 
// back in 1999 I didn't.)

答案 339 :(得分:5)

在一堆剪得不好的&amp;粘贴内容管理Web应用程序的源代码:

// load image 1 - JPEG 240x320
img = f1.getImage();
if (check(img))
{
   load(img, Constants.JPEG_240x320);
}

// load image 2 - JPEG 128x128
img = f2.getImage();
if (check(img))
{
   load(img, Constants.JPEG_128x128);
}

...

// load image 13 - GIF 256x256
img = f13.getImage();
if (check(img))
{
   load(img, Constants.GIF256x256);
}

// loaded all of the f**king images

注意:大致翻译自意大利语: - )

答案 340 :(得分:5)

我最喜欢的是这样的

 # commented out
 ...
 ### end of the formerly uncommented #2001-02-22 John Doe

答案 341 :(得分:5)

// woot, global var. I havent done this for a long time.

答案 342 :(得分:4)

// but the "real" solution is much more complicated

来自jpgraph

答案 343 :(得分:4)

/* logic */
#ifndef TRUE
# define TRUE 1
#endif /* TRUE */
#ifndef FALSE
# define FALSE 0
#endif /* FALSE */
#define EOF_OK TRUE
#define EOF_NOT_OK FALSE

以及mkentry.c页面上光荣的IOCCC的其余部分。每次看完这个来源我都不会笑。

答案 344 :(得分:4)

// set break point here - you'll never reach it

答案 345 :(得分:4)

  

谨防上述代码中的错误;我只是证明它是正确的,没有尝试过。

那是唐纳德克努特。

答案 346 :(得分:4)

' Oh man I'm pissed. I think I better go home.

pissed = drunk

答案 347 :(得分:4)

//Not a bug, parameter position can change..., if you think this is wrong, you are in fact wrong.

答案 348 :(得分:4)

在一个相当漫长且复杂的while循环结束时,如果是块,有问题的开发人员插入了这个最终评论:

else
{
    // wobbly wilson said this would *never* happen!!
}
一个机智和讽刺的简洁混合物:)

答案 349 :(得分:4)

来自传统的Perl CGI脚本:

# This is convoluted and evil, sorry.

答案 350 :(得分:4)

我没有遇到这个第一手资料,但这是一个很好的故事(请参阅我的评论中的解释):

#define MSGTAG_B33R     0x723 /* RIPLVB */

答案 351 :(得分:4)

我曾经看过这个:

//this used to be a comment

答案 352 :(得分:4)

// HACK ! COPY/PASTE this and look for another job

答案 353 :(得分:4)

这个对别人很有趣,但对我来说则不那么有趣。我从一个自己继承它的开发人员那里继承了代码(这是ASP)。第一个程序员创建了一些非常难以理解的代码。第二个开发人员添加了如下注释(名称隐藏以保护不那么无辜):

'This code was written by **************.
'I haven't a clue what it does. He hasn't a clue what it does.
'Nobody else has a clue what it does or how it does it.
'It is something to do with data but **** knows what.
'The ******* still works so please do not change this code,
'even though it is a complete pile of ****.

那为什么我觉得它不好玩?嗯,这是客户内部网的ASP代码。

......正是客户向我强调了评论。

: - (

答案 354 :(得分:4)

见这一个:

'On Error Goto Hell.

答案 355 :(得分:4)

的BerkeleyDB

/*
 * Chaos reigns within.
 * Reflect, repent, and reboot.
 * Order shall return.
 */
return (DB_RUNRECOVERY);

答案 356 :(得分:4)

//FIXME: fix this before the 1.0 release

他们是第4版

答案 357 :(得分:4)

What do you think you're doing, Dave?

答案 358 :(得分:4)

/*
* After 36 hours, 2 holes in my wall and writing my code right beside the API
* this still doesn't work.
* function getMap():void takes in an event object @param: evt:mouseEvent
* I will now retire for the day with a bottle of rum and 2 hours of crying
*/

答案 359 :(得分:4)

从一个绝对可爱的项目到最近我一直工作(是的,我承认,其中一些是我的,但我不会告诉你哪个):

if(FAILED(hr))
{
    char fuck[256];
    sprintf(fuck, "GetBuffer() fucking fucked the fuck: %d", hr);
    MessageBoxA(0, fuck, fuck, MB_OK | MB_ICONERROR);
    return;
}


// This is for Chris, since he gets all hot and horny over "uint" instead of "unsigned int"
// ... or maybe he's just a lazy fuck. Who knows!?
using Ogre::uint; 
// movable texts, fucktory
MovableObjectTextFactory* m_pMovableObjectTextFactory;


// diarrhea... shitting CR from the string. complete run...

他的意思是他通过回车分割字符串以单独渲染。

// unlock shit (duh, this comment is useless)
pixelBuffer->unlock();


// :HACK: remove me after demo is shipped
Of course, it's still in there ;)


// it's 4am and I can't think of a decent error message.
// my lead just fell asleep at his desk, so I can't ask him.
// [name] went home because he didn't want to get divorced.
// and so it's little ol' me, sitting here, comin up with an
// error message for something that should never ever happen.
ASSERT0(in_len == max_in, "http://www.youtube.com/watch?v=oHg5SJYRHA0"); 


// you want hungarian, you GET hungarian!
for(int fcknglpidxcntvrI = 0; fcknglpidxcntvrI &lt; len; fcknglpidxcntvrI++)


bool bKillSomethingAlive = false; // beating the dead horse instead

当然,我们也有很多有趣的方式来说“哈克”:

// HACKOMATIC 
// HMM... HACKXOR?
// HACK'O'ROONY
// AR; yeah I know it's HACKsoup
// HACK SHOT! DOMINATING!
// HACK'KIDO
// HACKku. sepukku. harakiri. kamikaze. ninja.
// HACK'o'NEIL
// HACKsaw

答案 360 :(得分:4)

#!/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)

答案 361 :(得分:4)

var something TBoolean; //Pickins

答案 362 :(得分:4)

// All this code is yours, except gedit()...attempt no modifications there.

答案 363 :(得分:4)

public static final void attachListener(Object listener) {

/* ======================= */

// This does nothing, continue searching

/* ======================= */

...

听众的痛苦!

答案 364 :(得分:4)

/* Only break the connection if it actually exists. It is important to
 * check the timeslot saved in the SOURCE of the disconnect message. */

我写了这篇评论,现在我不记得为什么这很重要......

答案 365 :(得分:4)

//too much log will kill you

这个评论我自己写的,当降低一些日志的优先级时,否则会写出数百MB的垃圾并严重削弱了应用程序的性能。

答案 366 :(得分:4)

BEGIN.
// Here might be dragons
.
.
 IF...
 // Beware of the Jabberwocky
 .//user the force, luke
 .
 .
 ENDIF.
.
END.

答案 367 :(得分:3)

严格来说,这不是评论,而是......

那是在20世纪90年代中期,我正在进行大规模迁移:小型软件供应商,大型客户端,压力很大。我们有很多转移球门柱的东西;该项目很难控制。我是关键的开发人员,但是对系统不熟悉,而另一个开发人员是供应商的所有者/创始人。

经过几个月没有完成截止日期并且不太满意客户,业主/创始人带来了另一位远程工作的开发人员。 (我要站出来说新开发人员的技能和经验比我少。)

好吧,这个新人已经对我已经处理过的代码进行了一些更改,然后一两个月后我回到了代码的同一区域,并且有一些我以前没见过的变量。名称为StupidMark

伙计,那是不对的。我的意思是,有团队合作的考虑因素,但是:在这种环境中,变量名称可以显示在运行时错误消息中。我只是说。

在我看来,当时新人的代码并没有让我们更接近可交付产品,这让侮辱更加刺激。

答案 368 :(得分:3)

If you have reached this part in the code, then this program sucks.

答案 369 :(得分:3)

// this is really complicated

没有其他评论

答案 370 :(得分:3)

在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

答案 371 :(得分:3)

javascript函数的第一行:

// this part is more difficult

WTF?

答案 372 :(得分:3)

几年前,我在一个没有单元测试的大型代码库中工作。

在代码深处埋藏了一种执行某些日历计算的方法。它有点破碎,由于一些不幸的情况,不得不以非常笨拙的方式处理夏令时。

我们不得不修理它几次,而且每次都会在几个月后发现一些破损的东西。

经过一整天的修复和分析后,我将代码放在源代码管理中,并附上一条说明如下内容的评论:

// this code was written after a version trying to do {this} failed because of {reason},
// previously we were doing {this} which failed because of {reason}. This is 
// now written {this} way so that {lots of reasons here}. If you want to touch
// this code, please make sure that it produces the right answers when tested with:
//
// {some sort of unit test}

最终,我的团队外包了。有些日子我想知道这段代码发生了什么:)

答案 373 :(得分:3)

// good luck!

答案 374 :(得分:3)

我刚在.net的自定义Linq提供程序中找到了这个:

//select is a royal pain in the ass where 
//the parameter passed to CreateQuery isn't actually the one that goes in the call
//requiring this workaround.  Not sure how straight Linq to Objects does it.

这一个

//expressions have to be compiled in order to work with the method call on 
//straight Enumerable somehow, LINQ to objects itself magically does this.  
//Reflector shows a mess, so I (Aaron) invented my own way.  God love unit tests!

我刚刚发现了这个......它变得更好了

  //ok, this is a hairy, dirty, and nasty piece of code
  //the alternatives are substantially worse than this though
  //i.e. when you do your own provider, LINQ assumes that
  //you are going to implement your own expression tree visitor and
  //do it all yourself.  Frankly, I still have xmas shopping to do
  //and I really don't want us to be foobared when we get
  //even more extension methods added to LINQ
  //therefore, we are pulling execute based on taking the calling the 
  //standard execute on enumerable, but using our own class
  //
  //optimization can occur from here on an as needed basis, that is
  //check for the value of mex.Method.Name, and write a handler for
  //that method
  //
  //also, it may not be a bad idea to rather than do this reflection 
  //each and every time somehow cache the reflected methodinfos and do 
  //lookups that way that said, we need a complete red/green/refactor 
  //cycle here before I am touching that one

这一个

//Compile that mutherf-ker, invoke it, and get the resulting hash

答案 375 :(得分:3)

这是我们在之前雇主购买的智能卡产品中发现的唯一评论。由一群荷兰密码学博士撰写的嵌入式C和汇编程序的负载

// echt halmaal gek - no way!

(这意味着“真的完全愚蠢”......这对我们也没有帮助)

答案 376 :(得分:3)

# let's pretend we are free, for a while

在课堂前找到这个。接下来是(天真)尝试实现ORM。我仍然不明白为什么他写这个。

答案 377 :(得分:3)

几年前我在.h文件中看到的东西。

// It may be a hack, but it works.

答案 378 :(得分:3)

我在COBOL计划中看到的一些因恐惧而使我瘫痪的事情

* All comments pertain to the lines which follow.

这是什么意思?

  1. 有人对评论他们不得不写一篇元评论感到很不舒服吗?

  2. 有人习惯将评论放在相关代码之下,并被告知将评论置于上方?这是怎么发生的?

答案 379 :(得分:3)

对于一个项目,我们将pwlib作为依赖项,当时它的FreeBSD端口有些搞砸,所以我不得不从源代码手动构建它。它没有立即解决,我不得不查看代码;有一些复杂的类层次结构,其中部分代码由宏生成,其父级calss声明以

开头
// The root of all evil ... umm classes

答案 380 :(得分:3)

对于我编写的memcache包装器/处理程序接口模式类,我实现了以下方法。

/**
*  Do not use, ever - left in place for testing purposes
*/
function  I_David_WillHuntYouDownAndHurtYou_Badly_IfIFindThisUsedAnyWhereInTheAppLibrary(){
...
}

这基本上是一个超级核函数,用于告诉所有单独的memcache服务完全自我冲洗,并从我用于键的个别名称空间计数器开始(例如{_ counter_key value} _。{_ counter_key value})< / p>

我写的另一个小小说是一个数据供应商的自动下载器,详细说明了我多么讨厌这个供应商并且花了很多时间假设他们的基础设施的批处理系统是由沙鼠运行,在轮子上运行之后轮子的许多转数将开始下一个排队的任务。它是在添加额外异常处理的6个月的过程中编写的,例如,如果我们得到了768字节的\ s字符,这意味着对其数据库的查询超时,并且空格是空故障打印语句的结果。

答案 381 :(得分:3)

try
{
...
}
catch(Exception ex)
{
//if this happens the world is going to end...
}

现在猜猜发生了什么......

答案 382 :(得分:3)

//If the Current Record is Getting End Dated, We should not create New History Entry. 
//We Just need to Update the Previous History Entry
//If the History is already End Dated and the New Record is now removing End Date, Then 
//We should not update the Previous History End Date. 
//We Just need to Create the New History Record Only.
//Alright.. 
//Alright.... 
//Enough Comments. Code it. :-)

答案 383 :(得分:3)

#define SHIT_HAPPENED (BASE + 1)   /* generic shit happened */

答案 384 :(得分:3)

// Empty constructor to satisfy the stupid compiler
 Public ServletHandlerClass () { } 

答案 385 :(得分:3)

//marco 2007.1.23
//I didn't do it

答案 386 :(得分:3)

// haack, phil haack

/* hack, hack, hack, hack, hack hack, hack, hack
 * hackity hack, oh wonderful hacks
 * wonderful hacks, oh wonderful hack, hack, hack
 * hack hack hack... and spam 
 */

编辑:刚刚在我的一些代码中找到了这个(该项目希望保持匿名):

// yikes, we need to:
/*
 *       o
 *      -|-     < US CROSSING PLATFORM
 *       |\ 
 ************************************************
 *       |          ^ PLATFORM           |
 *       |                           T   |
 *       |                      TROLL^   |
 */
// right now:
/*
 *   o ./_  | 
 *  -|-[]\  |  (_'_) () (\) | ) \|/ (S) < WALL
 *   |\     |    ^ FRIENDLY MESSAGE FROM YOUR FRIENDS AT MICROSOFT
 *  ***********************************************
 *        | ^PLATFORM                       |
 *      ^ SPRAY CAN (IN HAND)
 */
public static class DefaultFonts
{
    public static string SansSerifPath
    {
        get { return @"C:\Windows\Fonts\arial.ttf"; }
    }
    public static string SerifPath
    {
        get { return @"C:\Windows\Fonts\times.ttf"; }
    }
    public static string MonospacePath
    {
        get { return @"C:\Windows\Fonts\courier.ttf"; }
    }
}

我多么喜欢双关语。

答案 387 :(得分:3)

On error resume next 'because nothing will ever go wrong!

答案 388 :(得分:3)

private static final Logger lager = new Logger();

答案 389 :(得分:3)

/*
* Wirzenius wrote this portably, Torvalds fucked it up :-)
*/

答案 390 :(得分:3)

//If only humans could leave things be.

//Please do not edit this code, 
//if you do you wont go to jail, you wont go directly to jail, 
//you wont pass go, you wont collect 200 dollars

答案 391 :(得分:3)

int main(void)
/* Program starts here */

答案 392 :(得分:3)

当我在一个我要维护的项目中读到这篇文章时,我哭了。

//Write Code Here

我仍然畏缩:)

答案 393 :(得分:3)

// The freshest corpse at the back please.
m_DeadCharacters.push_back( std::make_pair(character, 0.0f) );
// Get rid of the rotting surplus
while( m_DeadCharacters.size() > 3 )
    m_DeadCharacters.pop_front();

答案 394 :(得分:3)

//ha, you thought I was lazy didnt ya?!

答案 395 :(得分:3)

#define FUCK_VS6_CANT_COMPILE_TEMPLATES_WITHOUT_HANDHOLDING ((float*)0)

... 

SetPinsFromChannels`<float`>(&pinbuf, streambuf, &inmapper, FUCK_VS6_CANT_COMPILE_TEMPLATES_WITHOUT_HANDHOLDING);

答案 396 :(得分:3)

今晚,我们的团队发布了一个新版本的CSS文件,该文件删除了文件中的注释,其结构如下:

@charset "UTF-8";
/* Who knew comments here could COMPLETELY ruin our page in Safari? */
body {
        /* Really important stuff here */
        /* Of course, comment or not, this will all get ignored by Safari because 
           its the first rule after the comments which break everything.
           see http://www.w3.org/International/questions/qa-css-charset for the exact details!
        */
}

有趣的是在网上你会发现人们的解决方案就是输入一个虚假的元素作为charset语句下面的第一条规则被忽略并按正常方式进行......

深思熟虑:人们在哪里发表评论不发表评论?

旁注:我知道由于标题,元规则等原因不应该这样做。不幸的是我们需要它作为一个全部:(

答案 397 :(得分:2)

Get This hack!

在一行汇编代码上,在未注释代码的页面之后。

答案 398 :(得分:2)

评论我们用于政府目的的企业级系统

'RH 5/24/06 burn me if this dosn't work.. :)

Good ole RH .....公司Prez / Lead Developer

答案 399 :(得分:2)

Gosling's Emacs来源中的ascii-art骷髅和交叉骨(这里很难再创造)(警告他写的超热门管理包不容易理解)。

答案 400 :(得分:2)

/*************************** Drag And Drop Section - Start (you should be me to mess with this section)*********************************************/

答案 401 :(得分:2)

// Jay knows what's going on here, but will he remember in a year? Not very likely, this code sucks, but it works so do not change it.

此评论发布在一个巨大的if-if-for块上面......哦,它操纵了一个对象数组的对象数组,这些对象数组可以是字符串或数字,具体取决于至少3个因素。 (是的,我必须调试此代码并更改它,我写了评论,但是我没有写原始代码)。 ;)

答案 402 :(得分:2)

// No women, no children... What movie???

答案 403 :(得分:2)

在拍卖初期的SJ CA中,我和一个叫Rick Dorin的人合作过。当你不得不整天捅卡片时,他写了编辑器。他的一条错误消息是

  

错误太多......减少错误!

答案 404 :(得分:2)

'""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
'
'  NOTE: DON'T SCREW WITH THIS CODE UNLESS YOU REALLY UNDERSTAND IT!
'
'""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

答案 405 :(得分:2)

1983年在某些COBOL中看到:

   C   I don't know what this next bit does so I'll jump around it
       GOTO DONE.

答案 406 :(得分:2)

来自Joomla!源:

// this is daggy??

答案 407 :(得分:2)

Dennis M Ritchie有一个关于一些古老的UNIX评论的页面here

答案 408 :(得分:2)

我刚刚检查了这一天......

/// <STERNLY-WORDED-WARNING>
/// Pay attention to this or I will hunt you down.
/// ...
/// </STERNLY-WORDED-WARNING>

哪里(“......”==“我不能发布的专有内容”)。我只是喜欢我的STERNLY-WORDED-WARNING元素。

答案 409 :(得分:2)

-- Beyond this point, there'll be dragons

我觉得用更长的说法^^

更令人愉快

答案 410 :(得分:2)

一旦我找到了这个:

// I wish (boss name) could do this by him self.

答案 411 :(得分:2)

// barcore.cpp - MFC

//.....
HBRUSH CControlBar::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    LRESULT lResult;
    if (pWnd->SendChildNotifyLastMsg(&lResult))
        return (HBRUSH)lResult;     // eat it

//......

// Eat it - just like eat this.

答案 412 :(得分:2)

// Iced odnako
bool Iced{get;set;}

答案 413 :(得分:2)

这是我今天在重构一些代码时发现的评论

if( year < 100 ): year += 2000 #lol, Y2K

答案 414 :(得分:2)

回到Hitchhiker's Guide游戏新手的时候,我有一个案例,我正在测试某些东西是否可滚动以及用户是否试图以限制可变长度的语言滚动。所以:

if (scroll and noScroll) # or tea and no tea

答案 415 :(得分:2)

// The hackiest hack that ever did hack

它位于WordPress博客引擎(wp-admin / includes / user.php - 如果有人真的想看到hacky hack本身)。

答案 416 :(得分:2)

刚刚在一些Actionscript中找到了这个我必须更新......

/*
* spaghetty code in this module.
* hardcoded variables for load paths for the content window.
* Needs (vast) improvement.
*/

..很棒:(

答案 417 :(得分:2)

来自旧的netscape mozilla代码的

Classics。我个人喜欢

  只是不能乱搞。哦,无论如何,移动记忆也会毁了我们                                                          这一切都太难以弄清楚了。所以,我放弃了Mac                                                      完全彻底吮吸完整的岩石

但还有很多其他有趣的事情。

答案 418 :(得分:2)

回到大学:

//why the f*** we have to move this here to make it work

当我们与教授一起审查时,它在印刷资料中突出显示。

原因:一些与缓冲区溢出相关的非常讨厌的错误,它在代码的其他位置影响了与文件处理程序无关的变量。移动变量会使其再次起作用。

答案 419 :(得分:2)

在艺术资产出口工具中,我偶然发现了一个完整的翻译器,从数字(阿拉伯语)数字到罗马数字。它看起来像这样:

/*
//You can tell I was bored
//I wanted to do this for a long time
char* ConvertToRoman(int number, int base)
{
... whole code here
}
*/

写这段代码的人的团队已经捣碎了很长时间,我想这影响了他们的理智。

答案 420 :(得分:2)

// Keep prozac ready if things get ugly!

答案 421 :(得分:2)

我见过的最好的评论是

/* 
  There is no accounting for pointers 
*/

答案 422 :(得分:2)

def leppard
# what, i cant have my own convention?
end

答案 423 :(得分:2)

switch(value)
{
   [...]
default:
   ASSERT(**true**); // if this is triggered, something really bad is happening.
}

答案 424 :(得分:2)

我最热门的点击汇编:

// Thats the end of the While loop
// Clean up last row.  I really must program better than this.

// Note: You can't immediately tell if the line below works.

// Rounding - blech.  It's assumed that all .5s are rounded up.

// Sort out predictions first.  Seems like the right place for a prediction, 'first'.

// Let's interpret!

答案 425 :(得分:2)

在一些非常糟糕的vb代码中(我知道这很糟糕但是)我在一个空的if控件块中发现了这个注释,它说的是:

If bFound Then
     'I love it when I write kick ass code like this
Else
  .
  .

答案 426 :(得分:2)

/* Jeez, this is an ugly mess */

...comment from the X11R6 internals source code circa 1991.

答案 427 :(得分:2)

private int mousycounter = 0; //Not really a counter

答案 428 :(得分:2)

答案 429 :(得分:2)

//Please comment on your source code

答案 430 :(得分:2)

//Do not continue reading if you dont want to die.

这个几乎杀了我。

答案 431 :(得分:2)

/*
    FIXME:  why the fuck did anyone ever think this kind of expensive iteration
                    was a good idea?

答案 432 :(得分:2)

来自sendmail配置文件。在页面和页面看起来像简单的线路噪音。我找到了这个宝石。

# insert this handy debugging line wherever you have problems
#R$*                $:$>99$1

答案 433 :(得分:2)

DataRow[] foundrows = FilterCalendarEntriesBecauseDotNETIsFuckedUp(tbtemp,CalDate);

不是评论,而是有趣的功能名称

答案 434 :(得分:2)

我发现了这个

// This is a kind of magic...

答案 435 :(得分:2)

我经常发现这个

// fix it!

答案 436 :(得分:2)

// TODO: Delete

答案 437 :(得分:2)

我曾经在使用Paradox 3.5编写的大型预算系统上接到了客户的电话 -

“我们在调试中遇到了一些评论” -

// This shouldn't happen, if it does, then the bits that automagically 
// worked when I wrote it have stopped working

......!

答案 438 :(得分:2)

// for 8 or 12 threads this does not affect much.
// Strange are the situations if not understood properly.
// Yoda strikes again

在多线程模块中! :)

答案 439 :(得分:2)

// simply copied from another code

答案 440 :(得分:2)

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

答案 441 :(得分:2)

找到复杂的代码 -

//耶稣和这段代码有一个共同点:两者都被复活了

答案 442 :(得分:2)

// if the resultMap size is less than or equal to zero
// then the product is added
if (resultMap.size() <= 0)

答案 443 :(得分:2)

%%return_median
hit_the_sweet_spot(Arg)->
.
.

答案 444 :(得分:2)

  

//以下代码需要注释掉。

答案 445 :(得分:2)

在PeopleSoft Financials PeopleCode的早期版本中:

/* I don't know how you can ever get here so I'll have to fix it later */

答案 446 :(得分:2)

// now that's compact!
list->insert(list->end(),**pitch)->IdxOfSample=(pitch->pos-Offset)*SamplingRate;

答案 447 :(得分:2)

来自Python / ceval.c:

/* This is gonna seem *real weird*, but if you put some other code between
   PyEval_EvalFrame() and PyEval_EvalCodeEx() you will need to adjust
   the test in the if statements in Misc/gdbinit (pystack and pystackv). */

答案 448 :(得分:2)

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

答案 449 :(得分:2)

以下代码见于Python的模拟教程。

# This is my rifle.
def rifle(type='hunting'):
    print('This is my (%s) rifle.' % type)

# This is my gun.
def gun(type='hand'):
    print('This is my (%s) gun.' % type)

# This is for fighting.
def fighting(type='illegal'):
    print('This is for (%s) fighting.' % type)

# This is for fun.
def fun(type='gaming'):
    print('This is for (%s) fun.' % type)

作者一定是Family Guy的粉丝。 ^ _ ^

答案 450 :(得分:2)

我刚刚完成了一个日志框架(使用Trace,为什么我不知道这样的存在)。我创建了一个继承自TraceListener的便捷基类。它会覆盖所有TraceListener方法并将它们路由到一个方法中 - 因此需要进行大量的文档注释:

// TODO: Need some codemonkey to doc comment this class.

答案 451 :(得分:2)

// The following array may contain either TexturedObjects or ColoredObjects.
// I know, it sucks.

答案 452 :(得分:1)

这里是4,无序:

// Father, forgive me, for I am sinning

// heaven help me

// horse string-length into correctitude 
(from a textbook)

// what, me worry?

答案 453 :(得分:1)

if(count<0) count=0;    //don't get me wrong but this has to be done :p

答案 454 :(得分:1)

try {
  dataSource.close();
}
catch (SQLException ex) {
  // Do nothing, since we're going to trash this anyway
}

当然,这种事实上是JDBC中的wtf(或者至少是Oracle的JDBC驱动程序),因为它可以在关闭连接时抛出SQLExceptions ...

答案 455 :(得分:1)

我今天早上遇到的VB.NET中的一个好笑,笑了......

''' <summary>
''' Represents an exception that was logged.  Since System.Exception implements IDictionary, it can't be
''' serialized, so I had to write this.  Pretty fucking stupid thing to have to do, System.Exception should
''' be serializable right out of the box, IMHO.
''' </summary>
''' <remarks></remarks>
Public Class LogException

答案 456 :(得分:1)

我刚刚发现自己正在写这个

// not brilliant solution, but fair enough heh.

答案 457 :(得分:1)

我继承了一个没有任何UAT就已交付给客户的项目。它被围在篱笆上,并要求提供资金。

他们第一次使用它时,自然会爆炸。它是一个插入库,它覆盖了将文件名作为参数而不是文件描述符的任何系统调用。

许多系统调用都被遗忘了。

当我登机时,代码中包含如下宝石:

/* core dumps around here but this is hardly ever called */

/* don't know why this works but it seeems to be ok */

哦,没有单元测试。一位同事开始添加缺少的系统调用和单元测试。

那些编写代码的混蛋仍然在团队中并且根本不关心已经交付的垃圾!

答案 458 :(得分:1)

的Sanitized:

//Forward declarations:

class X {}; // TODO: Remove {}  ! When we get X defined....

答案 459 :(得分:1)

Fix problem where Nulls don't work properly.  Stupid Microsoft!

代码以迂回方式逐行将Null转换为零长度字符串,因为愚蠢的程序员不了解Null是什么,也从未听说过Nz()函数。

答案 460 :(得分:1)

// GK Experimental

(GK是编码员的首字母)

用于表示代码的某些部分,实际上是一种实验性的。 :)

一个很棒的旗帜,知道当你在调试过程中遇到它时,你可能正忙着为即将到来的几个小时修复黑客攻击..;)

答案 461 :(得分:1)

我刚刚发表了这条评论:

// this control (Resistance) is FUTILE! 

答案 462 :(得分:1)

我参与的一个大项目在自动构建中使用了StyleCop和FXCop,并使用规则来阻止人们使用未注释的字段,方法,属性等来检查代码。

有人因为必须在 FullName 这样的自我记录属性中添加“获取或设置全名。”之类的评论而感到很生气,他们去了编写宏来绕过规则的努力。

宏为方法,属性等插入XML摘要标记,使用单个非显示的Unicode字符作为标记内容,这将欺骗构建规则,同时打击他的轻微打击,反对盲目坚持评论的东西为了它...

...至少在他们引入另一条规则来检查评论中的Unicode字符之前。

答案 463 :(得分:1)

靠近单位的顶部:

// Oh what a tangled web we weave
// When first we practice to deceive
// ASTA

答案 464 :(得分:1)

/* Hammer Time! */

我不知道他为什么或是否在编写代码时穿着防撕裂尼龙降落伞裤

答案 465 :(得分:1)

在20世纪80年代早期的某个时候,我们正在为PL / I中的公用事业编写财务建模代码。来自客户的电话,在评论后发现代码正在爆炸

/* Honest this works */

这家伙采用了我们标准的金融方程组,并完成了大约15页的代数,将一堆代码组合成一个方程式。在三里岛之后公用事业不得不以巨额成本注销他们的核电站时,这个等式因为固定BIN 15(整数)溢出而失败,如果代数没有发生就不会发生。

答案 466 :(得分:1)

  

// Description : !!! TODO

答案 467 :(得分:1)

在拉丁语中,来自但丁的“神曲”的Abandon hope all ye who enter here

答案 468 :(得分:1)

来自Joomla!源:

// fudge the group stuff

答案 469 :(得分:1)

我曾经使用MS SQL Server Developer 2000(人工工作流程)实现了一些文档工作流程。

它由一系列触发器组成,这些触发器将被添加到数据库中以使其遵循工作流规则。

在其中一个触发器中,微软的某个人写了一些东西:

//Determine if the database has been "Grizzlified"

(产品的内部名称是“Grizzly”,所以我觉得这很有趣)。

答案 470 :(得分:1)

// StupidCompilerDontInline(SCDI), in the test project where
// allcode was in a single cpp the compiler had inlined nearly
// everything which lead to nice stackoverflow.
// To prevent this the metods are made virtual
#define SCDI virtual

答案 471 :(得分:1)

最近在我们的代码中发现了这一点(我们开发了企业软件):

// Instance of excel
Excel excel = this.CreateExcelInstance();
excel.Open(stream); // how to close it?!

在此之前,我确信我们已经摆脱了这种“有趣的东西”,我们正在以正确的方式正确地做到这一点......

答案 472 :(得分:1)

有一个程序员为我工作过一次,在他的代码中加入了“风格”评论,在那里他编写了关于特定实现细节的内部辩论,并在他被推翻特定编码决策时分开拍摄。

示例:

“风格     '有争议哪个更好,但我传递图像处理而不是简单     '传递缩放值以保持调用代码更简单(通过     '几个声明声明)。或者,我可以传递这些数据     '成员直接来自调用代码,但这会违反封装。

“风格 “正如我在其他地方所做的那样,我将注册我的官方抗议(只是给我一个 关于注释序列化实现的“表格填写” '属性而不是一对加载/保存方法。再次,这可能是一个 “风格问题,非常值得商榷。

答案 473 :(得分:1)

'this next if statement - just how it is. don't try to understand it because you won't. :)

那就是工作保障。

答案 474 :(得分:1)

在eMule,Preferences.cpp中,强制最低上传速度限制的方法与下载速度限制成比例:

uint16 CPreferences::GetMaxDownload(){
//dont be a Lam3r :)
    uint16 maxup=(GetMaxUpload()==UNLIMITED)?GetMaxGraphUploadRate():GetMaxUpload();
    if( maxup < 4 )
        return (( (maxup < 10) && (maxup*3 < prefs->maxdownload) )? maxup*3 : prefs->maxdownload);
    return (( (maxup < 10) && (maxup*4 < prefs->maxdownload) )? maxup*4 : prefs->maxdownload);
}

答案 475 :(得分:1)

// Sorry dirty code

答案 476 :(得分:1)

我们有一个文件,其中一半程序员试图理解混乱,将所有无意义的代码移到底部,并留下了类似的评论:

I have no idea what this stuff does below here.

另一位程序员留下了一系列嵌套的命名空间,这些命名空间就像是一本书,所以你可以钻进想法中的命名空间并选择你的行动。

答案 477 :(得分:1)

else
{
    //error situation
}

答案 478 :(得分:1)

#pragma region Crap that is kept for temporary reasons

    //  Huge chunk of commented code

#pragma endregion

答案 479 :(得分:1)

当我正在评论代码块时,我 THINK 不再有用,但我可能错了(因此不会删除它们)我有时会用它们作为前言

// Wilted celery?

这个想法就像芹菜一样枯萎了,但无论如何你还是把它放回冰箱里。我才知道,从现在起10年后,别人会发现这些评论并说出WTF?

答案 480 :(得分:1)

map(TimeZoneId.Romance, "Romance Standard Time"); //LULZ.

答案 481 :(得分:1)

// This interface defines method signatures<br>
interface IWhatever { ... }

答案 482 :(得分:1)

以下是我在不同时间放入代码的一些内容。有些不是技术评论,但它们是相同的概念。

在仅在一个平台上需要一些特殊代码的跨平台项目中:

//If defined, will include all the Windows-specific code.
#define LOSE

#ifdef LOSE
#include <windows.h> //WIN32. Duh.
#endif


---------------------------------------------------


//Stolen from other_project_name.cpp


---------------------------------------------------


/*
 * These comments have been lifted from propagate() and, though they no longer apply to the code, they may still be of value somewhere. Original tabbing and structural elements have been preserved.
 */
    //CAUTION: This has a major Bobby Tables risk. Even if a rulebuilder is used, there's still the risk of something getting corrupted in the database itself.
    //Reading text from anywhere and simply slotting it into an SQL statement is a major security risk. (With thanks to xkcd for the name "Bobby Tables".)
    //Requirement: Eliminate one Bobby Tables by changing [redacted] to be not just straight SQL.
[lots more comments that are not as funny]
/*
 * End of lifted comments. There should not be any executable code between these markers.
 */


---------------------------------------------------


        /*
        Okay. It's unrecognized. Why is this a fatal error? It's actually very closely akin to the miswart of botched #includes being a fatal. When writing a C/C++
        program, you need your headers, and if you don't have one, chances are there'll be a million cascaded errors; so by making "unable to open asdf.h" a fatal,
        the compiler suppresses all those errors about undefined symbols and potentially misspelled type names.
        */


---------------------------------------------------


    //If someone tries to import 'id' as a field name, it won't work. (We already have our own id.) But I think the probability is so low that I can afford to be funny.
    if (!stricmp(ptr,"id")) {warn(0,"Import","","'id' is a reserved word and cannot be used as a column name. (Try 'ego' or 'superego'.)"); return;}


---------------------------------------------------


//Need a place to squirrel away SQL statements somewhere
char *uts[1024]; //Unified Temporary Storage. (Why? Because I said so.)
int nuts=0; //What is it that squirrels keep? Ha!
int utsid[sizeof uts/sizeof *uts];


---------------------------------------------------


        /**************************************\
         * NOTE: This sets tilde.action. If a *
         * tilde header does not exist in the *
         * import file (not the _content_, if *
         * the entire column isn't there), it *
         * will duplicate down through all of *
         * the rows. This is fine for ~id, as *
         * that will never be changed; and if *
         * ~Quantity is blank, that throws an *
         * error in 'Add'. With ~Action, I am *
         * not so certain. I THINK it'd be OK *
         * to dup-down most of the time... if *
         * the user only ever imports Adds or *
         * Revises, but never both at once in *
         * a single import. So for safety, to *
         * allow a blank ~Action to revise OR *
         * add, I'm breaking the check out to *
         * a new variable - the curaction. In *
         * most cases, it won't be needed, so *
         * it's a waste; but it isn't like it *
         * has to copy the entire tilde.*, so *
         * it's only a small waste. So it can *
         * waste a register... big deal. OK ! *
        \**************************************/


---------------------------------------------------


            //if (!response) // we're going to crash
            //if (!items) // we're going to crash
            //TODO: Don't crash


---------------------------------------------------

我的很多评论都包含对电影或音乐剧的晦涩引用,但如果你不了解这部剧,它们就不会那么有趣了。

答案 483 :(得分:1)

/* Look not upon this file lest your eyes be burnt from your head. */

我能说什么?我是一名实习生,夏天快要结束了。我们应该说,我缺乏对文件责任的认真承诺。

答案 484 :(得分:1)

我没有源的副本,但我一直记得它:

//如果你无法理解,你不应该读这个

答案 485 :(得分:1)

来自Linux内核源代码:

的linux /包括/ ASM-I386 / hw_irq.h:

/*
 * subtle. orig_eax is used by the signal code to distinct between
 * system calls and interrupted 'random user-space'. Thus we have
 * to put a negative value into orig_eax here. (the problem is that
 * both system calls and IRQs want to have small integer numbers in
 * orig_eax, and the syscall code has won the optimization conflict ;)
 *
 * Subtle as a pigs ear.  VY
 */

答案 486 :(得分:1)

double t = 0.0; /* that's generally my opinion of the diner, too. */

答案 487 :(得分:1)

$dnstime = time() + 60 * 60 * 24 * 7 * 2; //how long are you staying for vacation on mars? twooo weeeeeks. give dees people air

答案 488 :(得分:1)

在生成HTML的旧perl脚本中找到:

# I would be _very_ brain farting if I said this code didn't need reviewing.
# It will make babies cry, and hair grow on your back, so please don't use it

答案 489 :(得分:1)

来自/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/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? */

答案 490 :(得分:1)

来自http://www.madore.org/~david/computers/callcc.html

/* Yow!  DEMONS are flying through my NOSE! */

答案 491 :(得分:1)

// repopulate, slight hax (or strong assumptions :P) below

答案 492 :(得分:1)

//this is a crap way to do this but I ran out of patience

DelButton.click(); 

答案 493 :(得分:1)

/**
 * Hexadecimal digit
 */
protected $version = -1;

答案 494 :(得分:1)

// Holy moses! I've never seen anything so ridiculous in all my life. 

// Why do we need to query the AlarmIDs table twice.

// Please tell me sir; I would really like to know. 

// This like all the other services have been mangled

// to the point where they are nearly impossible to determine what kind of side affects might occur.

// I am making the smallest changes I can to this code. 

// The GetAlarmId method gets the alarm id from the AlarmIDs table.

// Novel idea, why didn't we query for the values be get below all in the same place.

// This should be changed, but right now it will have to remain as is due to time constraints.

// This like all other services really don't do anything fantastically hard, but after the original coders got

// done with them; they are difficult to work with and have an acceptable comfort level.

答案 495 :(得分:1)

首先在对一个巨大对象的更新开始时:

/*General note to all who tread in the <ObjectName>() code...
 * The SetOriginals() method from the BaseEntity class should be called (and only called) right after the Get() method
 * call as seen above.  Calling the SetOriginals method elsewhere will result in bugs and all kinds of other nasty suprises.
 */

然后经过大约200行逻辑更新对象:

//Attempt to explain this confusing mess of code:
//First time you save an actual absence this is what happens:
//0. The first save saves to the <TableName> table (among other things). (Fig. A)
//1. The <CalculationMethod> method is called next which inserts to the <OtherTableName> table. 
//(This is the table that keeps track of credits to the case.) (Fig. B)
//2. So then you have to call <UpdateCalculations> to move the <TableName> records to the <ThirdTableName> table. (Fig. C)
//3. Then you go back and run calculations since you have the debits table (<ThirdTableName>) populated. (Fig D.)
//4. Then a final save to save the calculations back to the case. (Fig. E)
//Yeah, I know what you're thinking:  this sucks. 10/01/07 XXX

开发人员是对的...这很糟糕!

答案 496 :(得分:1)

//Maybe you should make anyone knows your code's purpose. 

答案 497 :(得分:1)

[vrk:Cloud ID="cTags" runat="server" DataTextField="Tag" DataWeightField="Total"
    Width="100%" DataHrefField="Tag" DataHrefFormatString="~/tags.aspx?tag={0}"]
[/vrk:Cloud]

[!--if anybody would like to change the control's color contact with FLORJON--]

答案 498 :(得分:1)

我真的非常喜欢oh_my_gawd标签比评论更好......

    /*
     * IOC3 is fucked fucked beyond believe ...  Don't even give the
     * generic PCI code a chance to look at it for real ...
     */
    if (cf == (PCI_VENDOR_ID_SGI | (PCI_DEVICE_ID_SGI_IOC3 b_type0_cfg_dev[slot].f[fn].c[where ^ (4 - size)];

    if (size == 1)
        res = get_dbe(*value, (u8 *) addr);
    else if (size == 2)
        res = get_dbe(*value, (u16 *) addr);
    else
        res = get_dbe(*value, (u32 *) addr);

    return res ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;

oh_my_gawd:

    /*
     * IOC3 is fucked fucked beyond believe ...  Don't even give the
     * generic PCI code a chance to look at the wrong register.
     */
    if ((where >= 0x14 && where = 0x48)) {
        *value = 0;
        return PCIBIOS_SUCCESSFUL;
    }

答案 499 :(得分:1)

技术上不是评论,而是来自凌晨2点左右的某些事情的编码:

consent = False

...该变量永远不会再次使用,并且出现在套接字的监听循环的开头。

答案 500 :(得分:1)

TextBox1.Text = TextBox1.Text; //Point less yes, who writes this crap?

答案 501 :(得分:1)

在对MAPPER应用程序进行编码时,我们有一些标准,其中之一就是整个套件中都有一个标准变量列表。其中一个 - 'V43'总是用来拿一个姓氏。所以想象一下,当我被要求解决的一大块神秘的MAPPER代码中的唯一评论时,我的烦恼是:

Here V43 contains the Surname

答案 502 :(得分:0)

(A bunch of code that's really weird looking)  //Kludge.

答案 503 :(得分:0)

[onload_1;block=begin;when 1=0]

Some of the techinques in this template are rather obscure, just trust me, they need to be there.
OTOH a better sollution would be to create a few seperate templates and pick one in the php-script...

[onload_1;block=end]

答案 504 :(得分:0)

这是来自旧的IOCCC获奖作品,我不得不下载整个获奖者档案 - 一个巨大的1.4 M - 并且在找到它之前我记得错误的几个短语的grep。

从语法上讲,这可能不是评论。或者可能是。我没弄明白。它绝对没有注释分隔符,但它也没有String分隔符。

C="Lint says "argument Manual isn't used."  What's that
mean?";

没有猜测lint输出的价格。

好奇的是,该条目是here

答案 505 :(得分:0)

REM Don't delete this print statement ****** will die

有问题的流程是某些遗留代码中的服务

答案 506 :(得分:0)

// long live COM'n'Roll
public enum StatusCode
{
        //success codes
        S_OK                                            = 1,
        S_NONE                                          = 2,
        S_SQL_OPERATIONS_LISTS_EMPTY                    = 3,

        //error codes
        E_NO_MATCHING_END_FOUND                         = -1,
        E_SEQUENCE_NUMBER_NOT_FOUND_AT_BEGINNING        = -2,
        E_SEQUENCE_NUMBER_NOT_FOUND_AT_END              = -3,
        E_FORWARD_AND_BACKWARD_OPS_COUNT_DO_NOT_MATCH   = -4,
        E_FORWARD_AND_BACKWARD_IDS_DO_NOT_MATCH         = -5,
        E_IDS_DO_NOT_MATCH                              = -6
}

答案 507 :(得分:0)

// Oh crap, i think i'm gonna yack

随后不久之后:

// TODO: end this lunacy

答案 508 :(得分:0)

Mine fave是用java编写的学校项目的一些业务逻辑中的变量名。

int StupidJava = -1;

答案 509 :(得分:0)

// Hack-er-ama

答案 510 :(得分:0)

// now swap like a <explicative removed>

答案 511 :(得分:0)

我刚刚在一些遗留代码中找到了这个..

'CANNOT JUST QUIT!

答案 512 :(得分:0)

<cftry>
...code...
<cfcatch>
  <!--- Gobble --->
</cfcatch>
<cftry>

这完全是我公司的代码库。它是ColdFusion,它只是忽略了错误。

答案 513 :(得分:0)

写得好的Lisp是最容易阅读的语言之一,我喜欢它。但糟糕的Lisp可能是一场噩梦,比糟糕的Java等更糟糕。

这里,如果存在3个以后缀a,b和c命名的原始文件变体,我们需要创建一个“组文件”。我一直试图找出一个奇怪的错误,我们收到了不必要的群组文件......

  (let ((varianta (format nil "~aa" problem))
        (variantb (format nil "~ab" problem))
        (variantc (format nil "~ac" problem)))
    ;;if the A and B variants exist, create a group file
    ;;(why not just check for a? I don't know, this just feels right)
    (when (and (probe-file varianta)
               (probe-file variantb))
      ...)))

Bug:1,Gut:0。

显然,对于那些写这篇文章的人来说,或许没有想到检查所有三种变体都是个好主意。当然,这是我最初编写此代码后十年内跟踪的错误(它早于第一个SVN日志)。

答案 514 :(得分:0)

我看到一些旧的fortran代码:

     integer *4 one,two,three;

c    asssign one to 100 before entering the loop
     one=100;

答案 515 :(得分:0)

重新吃自己的狗食:我们在工作场所有相同的用语(只有因为我介绍了它才被授予)。我的代码充斥着说“TODO”的评论,并指出最终应该完成的事情,但是评论说“DOGFOOD”(两个关键字总是在评论的开头,全部大写)意味着必须要完成的事情在此程序可以在内部使用之前。这是一个很方便搜索的东西,因为“dogfood”这个词永远不会出现在一个引用的字符串中 - 如果是这样的话,我总是可以说“狗食”或其他东西 - 所以即使是不区分大小写的搜索也会出现得到了正确的结果。

关于归零器的归零:我在编程Intel 80x86时做了完全相同的事情(我从8086开始并从那里升级到现代Pentiums)。将寄存器与自身进行异或,是清除它的最快捷,最紧密的方法。使用“MOV AX,0”需要三个字节(操作码和两个字节的文字16位零),而“XOR AX,AX”只需要两个; 386和更高的扩展寄存器更加引人注目,其中“MOV EAX,0”需要5个字节(4个字节的32位零)。我的C / C ++编译器总是以这种方式将寄存器归零,所以我认为它仍然是最好的方法(尽管我还没有研究过年代的操作码时序表,可能还有XOR reg,reg和MOV reg,imm需要一个时钟)

答案 516 :(得分:0)

我在Access中做了一个数据库,非常简单 - 至少应该是在开始时,或者我会在Delphi中完成它。客户希望能够从数据库中获取客户信息,但他们不会输入足够的信息来可靠地识别客户。我告诉他们使用电话号码作为关键,因为每个客户(他们的工作方式,而不是每个人)会有不同的号码。在他们发出一些疯狂的电话后,(它无法正常工作,我们无法进入客户)我发现他们懒得查看旧系统中的电话号码并试图输入他们不知道的所有号码“N / A”。在尝试为它们排序时,我最终在代码中有很多检查循环,并在一个结果旁边发表评论“如果他们做了他们应该做的事情,那就永远不会达到!!!!!!!! !“

他们也曾问过我“即使我们输错地址,我们怎样才能找到合适的客户?”而且都是花生。

答案 517 :(得分:0)

回顾类中的旧代码很有趣......

    cardDeck.push_back(*(new card((rank)r, (suit)s)));  // Push each card onto the deck
                                                        // Temp. objects are overrated

虽然经历了一些事情,但我希望我在凌晨4点留下更多评论,当时我在一起乱砍随机代码......