整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          30 多個有內味道且笑死的人代碼注釋

          碼注釋,有些人說它太丑,也有些人說它是標準和良好的做法。在本文中, 列出了一些在編程中遇到的有趣的代碼注釋。

          注釋 1

          // Weed Effect ! 
          
          這是雜草效應的意思?不是很懂,有誰知道,可以留言一下。
          

          注釋 2

          /**** 原文 *****/
          //The following code was written by <developer name>.
          // Unless it doesn't work, then I have no idea who wrote it.
          
          /**** 自譯 *****/
          // 以下代碼是由<developer name>編寫的。
          // 除非它不起作用,否則我不知道是誰寫的。
          

          注釋 3

          /**** 原文 *****/
          // Ad Index scheming and plotting - Those with
          // heart conditions are advised to not continue
          
          /**** 自譯 *****/
          // 廣告索引的設計和繪圖模塊
          // 建議不要深入閱讀,否則容得得心臟病
          

          注釋 4

          /**** 原文 *****/
          // nobody read comments!
          
          /**** 自譯 *****/
          // 沒人會讀的注釋
          

          注釋 5

          /**** 原文 *****/
          i++; // increment i
          
          /**** 自譯 *****/
          i++; // 自增 i
          

          注釋 6

          /**** 原文 *****/
          // Magic. Do not touch.
          
          
          /**** 自譯 *****/
          // 這里已經結界,不要碰.
          

          注釋 7

          /**** 原文 *****/
          // sometimes I believe compiler ignores all my comments
          
          /**** 自譯 *****/
          // 有時我相信編譯器會忽略我的所有注釋
          

          注釋 8

          /**** 原文 *****/
          // I am not responsible of this code.
          // They made me write it, against my will.
          
          /**** 自譯 *****/
          // 我對此代碼不承擔任何責任。
          // 是他們強迫我讓我寫的,這已違背了我的意愿。
          

          注釋 9

          /**** 原文 *****/
          // 
          // 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
          
          /**** 自譯 *****/
          // 親愛的程序媛
          // 
          // 一旦你嘗試“優化”此代碼,并意識到這是一個可怕的錯誤,
          // 請增加以下計數器,以警告下一個人
          //  total_hours_wasted_here = 42
          
          

          注釋 10

          /**** 原文 *****/
          
          # To understand recursion, see the bottom of this file
          At the bottom of the file
          # To understand recursion, see the top of this file
          
          
          /**** 自譯 *****/
          
          # 要了解遞歸,請參見此文件的底部
          
          在文件的底部
          
          # 要了解遞歸,請參見此文件的頂部
          

          注釋 11

          /**** 原文 *****/
          
          // I will give you two of my seventy-two virgins if you can fix this.
          
          /**** 自譯 *****/
          // 如果你能解決這個問題,我就把我七十二個處女中的兩個給你。
          
          

          注釋 12

          /**** 原文 *****/
          //Dear future me. Please forgive me. 
          //I can't even begin to express how sorry I am.
          
          
          /**** 自譯 *****/
          // 你好,未來帥氣的我,請原諒我。
          // 我現在無法表達我的歉意,因為我寫下了這段代碼。
          

          注釋 13

          /**** 原文 *****/
          //private instance variable for storing age
          public static int age;
          
          /**** 自譯 *****/
          // 用于存儲年齡的私有實例變量
          public static int age;
          
          

          注釋 14

          /**** 原文 *****/
          const int TEN=10; // s if the value of 10 will fluctuate...
          
          
          /**** 自譯 *****/
          const int TEN=10; // 10 是會改變的值
          

          注釋 15

          /**** 原文 *****/
          
          /* You are not meant to understand this */
          
          
          /**** 自譯 *****/
          
          /* 你不應該理解這一點 */
          
          
          

          注釋 16

          /**** 原文 *****/
          /*
          * TODO: Remove this function
          
          function remove($customer_id)
              {
                  $this->Customer->remove($id);
              }
          
          */
          
          
          /**** 自譯 *****/
          /*
          * TODO: 刪除函數
          
          function remove($customer_id)
              {
                  $this->Customer->remove($id);
              }
          
          */
          

          注釋 17

          /**** 原文 *****/
          //When I wrote this, only God and I understood what I was doing
          //Now, God only knows
          
          
          /**** 自譯 *****/
          
          // 當我寫這段代碼,只有上帝和我知道這是在做什么
          ...
          
          // 現在,只有上帝知道這段代碼在做什么
          

          注釋 18

          /**** 原文 *****/
          
          // drunk, fix later
          
          /**** 自譯 *****/
          
          // 喝醉了,待會解決
          
          

          注釋 19

          /**** 原文 *****/
          
          // I'm sorry.
          
          /**** 自譯 *****/
          
          // 我很抱歉
          
          

          注釋 20

          /**** 原文 *****/
          
          // I am not responsible of this code.
          
          /**** 自譯 *****/
          
          // 我對此代碼不承擔任何責任。
          

          注釋 21

          /**** 原文 *****/
          // I have to find a better job
          
          /**** 自譯 *****/
          
          // 我必須找到更好的工作
          

          注釋 22

          /**** 原文 *****/
          
          // Joe is sorry
          A few hundred lines later...
          // Harry is sorry too
          
          /**** 自譯 *****/
          
          // 老五抱歉了
          
          寫了幾百行代碼之后...
          
          // 小五對不住了
          

          注釋 23

          /**** 原文 *****/
          # Christmas tree initializer  
              toConnect = []  
              toRead =   [  ]  
              toWrite = [    ]   
              primes = [      ]  
              responses = {}  
              remaining = {}
              
              
          /**** 自譯 *****/
          
          # 圣誕樹初始化器
              toConnect = []  
              toRead =   [  ]  
              toWrite = [    ]   
              primes = [      ]  
              responses = {}  
              remaining = {} 
          

          注釋 24

          /**** 原文 *****/
          
          Catch (Exception e) {
           // who cares?
          }
          
          /**** 自譯 *****/
          
          Catch (Exception e) {
           // 管它呢?
          }
          

          注釋 25

          /**** 原文 *****/
          
          // IE7 update. this is still bad code, but IE8 is probably a long way off :)
          
          /**** 自譯 *****/
          
          IE7更新,這仍然是錯誤的代碼,看來 IE8 還有很長的路要走:)
          

          注釋 26

          /**** 原文 *****/
          
          // If this code works, it was written by Paul DiLascia. If not, I don't know
          
          /**** 自譯 *****/
          
          // 如果這個代碼有效的話,它就是由 前端小智 編寫的。如果出錯了,我也不知道是誰寫的。
          

          注釋 27

          /**** 原文 *****/
          
          // This comment is self explanatory.
          
          /**** 自譯 *****/
          
          // 這個注釋不言自明。
          
          

          注釋 28

          /**** 原文 *****/
          
          int main(void)
          /* Program starts here */
          
          /**** 自譯 *****/
          
          int main(void)
          /* 程序從這里開始 */
          

          注釋 29

          /**** 原文 *****/
          
          // I am not sure if we need this, but too scared to delete.
          
          /**** 自譯 *****/
          
          // 我不確定我們是否需要這個,但又害怕刪除
          

          注釋 30

          /**** 原文 *****/
          /**
           * Always returns true.
           */
          public boolean isAvailable() {
              return false;
          }
          
          
          /**** 自譯 *****/
          /**
           * 總是返回 true.
           */
          public boolean isAvailable() {
              return false;
          }
          

          注釋 31

          /**** 原文 *****/
          
          // Autogenerated, do not edit. All changes will be undone.
          
          /**** 自譯 *****/
          
          // 自動生成,不要編輯。所有的更改都將被撤銷。
          

          注釋 32

          /**** 原文 *****/
          
          // hack for ie browser (assuming that ie is a browser)
          
          
          /**** 自譯 *****/
          // 破解ie瀏覽器(假設ie是一個瀏覽器)
          

          注釋 33

          /**** 原文 *****/
          
          /////////////////////////////////////// this is a well commented line
          
          /**** 自譯 *****/
          
          /////////////////////////////////////// 這是一個很好的注釋
          

          注釋 34

          /**** 原文 *****/
          
          // Mr. Compiler, please do not read this.
          
          /**** 自譯 *****/
          
          // 編譯先生,請不要讀取這個
          

          注釋 35

          /**** 原文 *****/
          
          // All bugs added by David S. Miller
          
          /**** 自譯 *****/
          
          // 所有 bug 都是由 老王 添加的
          

          注釋 36

          /**** 原文 *****/
          
          //If you're reading this, then my program is probably a success
          
          
          /**** 自譯 *****/
          
          // 如果你現在在認真詳細的閱讀這段代碼,那么寫的這段代碼應該是沒有問題的。
          

          注釋 37

          /**** 原文 *****/
          
          Catch (Exception e) {
              //eat it
          }
          
          /**** 自譯 *****/
          
          Catch (Exception e) {
              // 吃掉它
          }
          

          注釋 38

          /**** 原文 *****/
          
          //todo: never to be implemented
          
          /**** 自譯 *****/
          
          // todo:永遠不會執行
          

          注釋 39

          /**** 原文 *****/
          
          // simply copied from another code
          
          /**** 自譯 *****/
          
          // 別問,問我也是從另一個代碼拷貝過來的
          

          注釋 40

          /**** 原文 *****/
          
          //Please comment on your source code
          
          /**** 自譯 *****/
          
          // 拜托啦,請把你寫的代碼注釋一下
          

          注釋 41

          /**** 原文 *****/
          # as you can see: I comment the code!
          
          
          /**** 自譯 *****/
          
          # 如你所見:我注釋了代碼!
          

          注釋 42

          /**** 原文 *****/
          
          // if i ever see this again i'm going to start bringing guns to work
          
          /**** 自譯 *****/
          
          // 如果我再看到這個,我會帶槍去工作
          

          注釋 43

          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  .__  _.-\   \
            ##         | |  |  ``/  /`  /
            ##        /,_|  |   /,_/   /
            ##           /,_/      '`-'
            ##
          

          注釋 44

          /**** 原文 *****/
          
          long long ago; /* in a galaxy far far away */
          
          
          /**** 自譯 *****/
          
          long long ago; /* 在遙遠的星系中 */
          

          注釋 45

          /**** 原文 *****/
          try {
          
          } finally { // should never happen 
          
          }
          
          /**** 自譯 *****/
          try {
          
          } finally { // 這里永遠不會被執行
          
          }
          

          注釋 46

          /**** 原文 *****/
          
          /* Ah ah ah! You'll never understand why this one works. */
          
          
          /**** 自譯 *****/
          
          // 啊啊啊!你永遠都不會明白為什么這個方法有效。
          
          

          注釋 47

          /**** 原文 *****/
          // this formula is right, work out the math yourself if you don't believe me
          
          /**** 自譯 *****/
          
          // 這個公式是正確的,如果你不相信我,自己動手算一下
          

          注釋 48

          /**** 原文 *****/
          
          // This was clearly written under duress
          
          /**** 自譯 *****/
          
          // 這顯然是在脅迫下寫的
          
          

          注釋 49

           
                                             .='  ' .`/,/!(=)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`                 
                                                 '''''
          

          注釋 50

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

          注釋 51

          /**** 原文 *****/
          // This was clearly written under duress
          
          /**** 自譯 *****/
          // 如果將來我讀到這篇文章,我會回到過去并自殺。
          

          注釋 52

          /**** 原文 *****/
          // This was clearly written under duress
          
          /**** 自譯 *****/
          // 亂七八糟的 SQL語句,但它有效,所以請不要觸摸它
          
          

          注釋 53

          //        .==.        .==.          
          //       //`^\\      //^`\\         
          //      // ^ ^\(\__/)/^ ^^\\        
          //     //^ ^^ ^/6  6\ ^^ ^ \\       
          //    //^ ^^ ^/( .. )\^ ^ ^ \\      
          //   // ^^ ^/\| v""v |/\^ ^ ^\\     
          //  // ^^/\/ /  `~~`  \ \/\^ ^\\    
          //  -----------------------------
          /// 這是條龍
          

          注釋54

          /**** 原文 *****/
          // I from the future read this I'll back in time and kill myself.
          
          /**** 自譯 *****/
          // 這是垃圾代碼,但現在是凌晨3點,我需要把它修好。
          

          注釋55

          // 我不確定我做了什么
          

          注釋56

          如果你想被解雇,請將其刪除

          注釋 57

          // 切勿動以下代碼,否則我會踢你的 PP

          作者:xor 譯者:前端小智 來源:medium 原文:https://medium.com/javascript-in-plain-english/30-funny-code-comments-that-will-make-you-laugh-1c1b54d4ab00

          HTML 注釋:

          <!--這是一個注釋,注釋在瀏覽器中不會顯示--><p>這是一個段落</p>

          瀏覽器支持

          所有主流瀏覽器都支持 <!--...--> 注釋標簽。

          標簽定義及使用說明

          <!--...--> 注釋標簽用來在源文檔中插入注釋。注釋不會在瀏覽器中顯示。

          您可使用注釋對您的代碼進行解釋,這樣做有助于您在以后的時間對代碼的編輯。特別是代碼量很大的情況下很有用。

          您也可以在注釋內容存儲針對程序所定制的信息。在這種情況下,這些信息對用戶是不可見的,但是對程序來說是可用的。一個好的習慣是把注釋或樣式元素放入注釋文本中,這樣就可避免不支持腳本或樣式的老瀏覽器把它們顯示為純文本。

          <scripttype="text/javascript"><!--functiondisplayMsg(){alert("Hello World!")}//--></script>

          注釋:命令行最后的兩個正斜杠(//)是 JavaScript 注釋符號。這確保了 JavaScript 不會執行 --> 標簽。

          除了在源文檔中有非常明顯的作用外,許多 Web 服務器也利用注釋來實現文檔服務端軟件特有的特性。這些服務器可以掃描文檔,從傳統的 HTML/XHTML 注釋中找到特定的字符序列,然后再根據嵌在注釋中的命令采取相應的動作。這些動作可能是簡單的包括其他文件中的文本(即所謂的服務器端包含,server-inside include),也可能是復雜地執行其他命令去動態生成文檔的內容。

          HTML 4.01 與 HTML5之間的差異

          無。

          標準屬性

          <!--...--> 注釋標簽不支持任何標準屬性。

          如需更多有關 HTML 標準屬性的信息,請訪問 標準屬性。

          事件屬性

          <!--...--> 注釋標簽不支持任何事件屬性。

          如需更多有關 HTML 事件屬性的信息,請訪問 事件屬性。

          如您還有不明白的可以在下面與我留言或是與我探討QQ群308855039,我們一起飛!

          要介紹

          roughnotation是一款web頁面目標元素標記動畫注釋的組件,該組件十分適合展示類的場景。它非常輕巧,只有3.8kb大小。它在github擁有5.3k顆星,足可以見其受歡迎的程度。它的注釋方式多樣,包括:下劃線、盒狀、圓圈、高亮、水平劃除線、X型劃除線、方括號。

          Github地址

          https://github.com/rough-stuff/rough-notation

          安裝

          npm install --save rough-notation

          引用

          import { annotate } from 'rough-notation';

          // Or using unpkg

          // import { annotate } from 'https://unpkg.com/rough-notation?module';

          效果

          const e = document.querySelector('#myElement');

          const annotation = annotate(e, { type: 'underline' });

          annotation.show();


          主站蜘蛛池模板: 精品少妇一区二区三区视频| 国产人妖视频一区在线观看 | 亚州日本乱码一区二区三区| 亚洲国产精品一区二区久久hs| 国产aⅴ一区二区| 亚洲av乱码一区二区三区| 本免费AV无码专区一区| 视频精品一区二区三区| 内射白浆一区二区在线观看 | 国产av一区最新精品| 国产精品毛片一区二区三区| 中文字幕久久久久一区| 国产乱码精品一区二区三| 亚洲成av人片一区二区三区| 好吊视频一区二区三区| 无码乱码av天堂一区二区| 麻豆精品久久久一区二区| 99精品久久精品一区二区| 中文字幕一区二区三| 亚洲老妈激情一区二区三区| 国精品无码一区二区三区左线| 三上悠亚精品一区二区久久| 国产亚洲一区二区在线观看| 麻豆国产在线不卡一区二区| 亚洲一区二区三区无码国产| 麻豆视频一区二区三区| 国产成人一区二区三区免费视频 | 国产精品一区二区久久国产| 无遮挡免费一区二区三区| 日韩A无码AV一区二区三区| 国产成人一区二区三区| 国产午夜精品一区二区三区极品 | 久久久国产精品亚洲一区 | 免费一区二区无码东京热| 中文字幕一区二区三区免费视频| 日韩精品福利视频一区二区三区| 亚洲综合色一区二区三区| 人妻av综合天堂一区| 午夜视频一区二区| 中文字幕日本精品一区二区三区| 国产亚洲一区二区手机在线观看|