• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            BillyYu

            The means of Gotcha

            From Wikipedia, the free encyclopedia

            Gotcha is a Slang term derived from the phrase "I got you", usually referring to an unexpected capture or discovery. It may refer to an unexpected or unintuitive, but documented, behavior in a computer system( as opposed to a bug). It may also refer to many other things, they are omitted in this paper.
            A gotcha is a detrimental condition (usually of a contract or agreement) that is designed to sneak past the other party. For example, many "free" Credit Report sites have "gotchas" that automatically sign you up for a monthly credit report service unless you explicitly cancel. "Gotcha" is also a frequently used programming term.
            Programming gotchas

            In programming, a gotcha is a feature of a system, a program or a programming language that works in the way it is documented but is counter-intuitive and almost invites mistakes because it is both enticingly easy to invoke and completely unexpected and/or unreasonable in its outcome.


            Gotchas in the C programing language

            Equality operator

            The classic gotcha in C is the fact that

            if (a=b) code;


            is syntactically valid and sometimes even correct. It puts the value of b into a and then executes code if a is non-zero. What the programmer probably meant was

            if (a==b) code;


            which executes code if a and b are equal.

            Function calls

            In C and C++, function calls that need no arguments still require parentheses. If these are omitted the program will still compile, but will not produce the expected results. For example:

            #include <iostream>
            using namespace std;
            int myfunc(){
            return 
            42;
            }
            int main (){
            cout 
            << myfunc;
            return 
            0;
            }


            The program will only display the expected result (the string 42) if the form cout << myfunc(); is used. If the shown form cout << myfunc; is used, the address of the function myfunc is cast to a boolean value, and the program will instead display the string 1.

            Gotchas in the C++ programing language

            Initializer lists

            In C++, it is the order of the class inheritance and of the member variables that determine the initialization order, not the order of an initializer list:

            #include <iostream>
            class CSomeClass
            {
            public:
            CSomeClass(
            int n)
            {
            std::cout 
            << "CSomeClass constructor with value ";
            std::cout 
            << n << std::endl;
            }
            };
            class CSomeOtherClass
            {
            public:
            CSomeOtherClass() 
            //In this example, despite the list order,
            : obj2(
            2), obj1(1//obj1 will be initialized before obj2.
            {
            //Do nothing.
            }
            private:
            CSomeClass obj1;
            CSomeClass obj2;
            };
            int main(void)
            {
            CSomeOtherClass obj;
            return 
            0;
            }

            posted on 2007-09-15 22:50 志華 閱讀(1003) 評(píng)論(4)  編輯 收藏 引用

            評(píng)論

            # re: The means of Gotcha 2007-09-15 23:09 Minidx全文檢索

            下面是一點(diǎn)參考:
            如果你打球時(shí)假動(dòng)作逼真,騙過(guò)了對(duì)手,球回到令對(duì)手意想不到的地方而得分,就可以自鳴得意的大叫一聲 “Gotcha!”,意思是(I’ve)got you,騙到你了吧!不知大家記不記得電影《小鬼當(dāng)家》,小機(jī)靈用玩具水槍嚇得歹徒落荒而逃后,滿(mǎn)臉童真的笑意,說(shuō)了一句“Gotcha!”

            如果你開(kāi)玩笑,朋友卻信以為真,也可以說(shuō)Gotcha,騙到你了吧。

            在電腦領(lǐng)域中尤其是編程語(yǔ)言里經(jīng)常出現(xiàn),到底是什么意思呢?

            Gotcha是I’ve got you的省略語(yǔ),為“難倒你了”、“問(wèn)倒你了”的意思。

            I got you.
            我了解.

            這句跟 I see, I understand, 都是一樣的, 適合在跟美國(guó)同學(xué)討論功課時(shí)使用. 例如有一次我跟我的美國(guó)同學(xué)說(shuō)這題該怎么怎么作, 他就很高興地說(shuō), Ok, now I got you. 你如果不說(shuō) I got you, 說(shuō) I got it 也是可以的, 這二個(gè)都很常聽(tīng)人家說(shuō).
             
            另外 I got you 有一個(gè)更常用的解釋, 就是我騙到你了, 通常會(huì)讀成 Gotcha.. 比如說(shuō)你騙人家說(shuō), I got married. 別人回答: Oh~ Really? 這時(shí)你就可以吹著口哨說(shuō).. Hahaha.. Gotcha.

            C+ +長(zhǎng)久演化與發(fā)展以來(lái),這樣一本gotchas書(shū)籍的遲遲出版顯得有點(diǎn)怪怪的。C++作為一個(gè)現(xiàn)實(shí)可用的語(yǔ)言,已經(jīng)有至少十五年的歷史了;而C++標(biāo)準(zhǔn)在過(guò)去的五年中也幾乎沒(méi)有改變。就此你可能會(huì)認(rèn)為,語(yǔ)言中的缺陷現(xiàn)在應(yīng)該已經(jīng)成為眾人皆知的“常識(shí)(common knowledge)[注1]”了。然而,即使經(jīng)驗(yàn)豐富的C++程序員也會(huì)時(shí)不時(shí)遇到麻煩;Steve Dewhurst——這位從業(yè)多年的C++課程教師、作者以及顧問(wèn)——?jiǎng)t比任何人都清楚這一點(diǎn)。Dewhurst看上去似乎更多的是在責(zé)備程序員的求次而安,而非C++的復(fù)雜性。在本書(shū)中,對(duì)C++基礎(chǔ)議題的忽視及不良的風(fēng)格被列為程序設(shè)計(jì)中的兩大原罪。經(jīng)驗(yàn)本身無(wú)法避免這樣一些人為的失誤;有時(shí)候我們確是需要一些刺耳忠言。據(jù)此,C++ Gotchas不僅僅是一本關(guān)于C++疑難雜癥的目類(lèi)書(shū)籍,也是現(xiàn)世警言,提醒我們?nèi)リP(guān)注那些可能被我們忽視的問(wèn)題。

            慣用法便是上述問(wèn)題之一。在口語(yǔ)中,所謂慣用法是指被經(jīng)常使用的單語(yǔ)(比如“gotcha”),其能迅捷的表達(dá)一個(gè)明晰的含義。而慣用法的含義之所以明晰,則僅僅是因?yàn)樵搯握Z(yǔ)被廣泛使用,而非其中的各單字的含義使然。在一門(mén)編程語(yǔ)言中,一個(gè)慣用法是指一個(gè)表達(dá)式或技巧,其能夠明晰的表達(dá)程序員的意圖。同樣,編程語(yǔ)言中慣用法表意明晰之性質(zhì)源自其被廣泛使用的程度。一個(gè)沒(méi)能學(xué)到口語(yǔ)慣用法的人會(huì)處于非常不便的境地;而一個(gè)不使用編程慣用法的程序員則會(huì)導(dǎo)致其他所有程序員——特別是其代碼維護(hù)者——的工作更難做。在Dewhurst的書(shū)中,恰當(dāng)?shù)倪\(yùn)用慣用法被視為良好的編程風(fēng)格,而良好的編程風(fēng)格可以最大程度的減少gotchas出現(xiàn)。  回復(fù)  更多評(píng)論   

            # re: The means of Gotcha 2007-09-16 07:49 志華

            原來(lái)有了這樣一本書(shū)出來(lái)了啊,有機(jī)會(huì)的話(huà),倒可以好好的研究研究!!謝謝Minidx,發(fā)現(xiàn)你的blog上好多東西,要好好的學(xué)習(xí)下
            ^_^@Minidx全文檢索
              回復(fù)  更多評(píng)論   

            # re: The means of Gotcha 2007-09-17 00:07 turing

            gotcha一般可以譯為“陷阱”。  回復(fù)  更多評(píng)論   

            # re: The means of Gotcha 2007-09-17 15:57 力為

            I got you~  回復(fù)  更多評(píng)論   


            只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


            <2007年9月>
            2627282930311
            2345678
            9101112131415
            16171819202122
            23242526272829
            30123456

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            留言簿(1)

            隨筆分類(lèi)

            隨筆檔案

            文章檔案

            搜索

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            三上悠亚久久精品| 亚洲国产成人乱码精品女人久久久不卡 | 久久99久久99小草精品免视看| 亚洲欧美久久久久9999| 久久久网中文字幕| 久久久久久一区国产精品| 91精品久久久久久无码| 夜夜亚洲天天久久| 91精品国产色综久久| 色综合久久中文综合网| 99久久亚洲综合精品成人| 精品999久久久久久中文字幕| 国产精品岛国久久久久| 99久久久精品免费观看国产| 久久99国产精品久久99果冻传媒| 国产精品9999久久久久| 国产激情久久久久影院| 色综合久久天天综线观看| 久久婷婷国产剧情内射白浆| 日产精品久久久久久久| 国产成人精品久久| 久久精品国产亚洲AV高清热| 色偷偷888欧美精品久久久| 久久影视综合亚洲| 狠狠综合久久AV一区二区三区| 久久久精品人妻一区二区三区蜜桃 | 久久久久久亚洲精品不卡| 久久久久九九精品影院| 97精品伊人久久久大香线蕉| 久久久久女人精品毛片| 久久久久国产亚洲AV麻豆| 久久这里的只有是精品23| 人妻无码久久一区二区三区免费| 国产高潮国产高潮久久久91| 久久久久青草线蕉综合超碰| 国内精品久久国产大陆| 亚洲精品高清一二区久久| 激情伊人五月天久久综合| 亚洲欧洲精品成人久久曰影片 | 久久香蕉国产线看观看精品yw| 狠狠色伊人久久精品综合网|