【正文】
t groundup C++ tutorials are Who39。s Afraid of More C++. If you already know C, try Teach Yourself C++.我該學(xué)習(xí)C++或是該從C開始(Should I learn C++, or should I start with C ) 我不喜歡這種說法,但它是繼“我該使用哪門語言”之后最經(jīng)常被問及的問題。你可以自學(xué)C并使用它來寫程序,從而節(jié)省一大堆的時間,不過使用這種方法有兩個弊端: I thought this bore mentioning, as it39。t black and white. You could save a lot of time by just teaching yourself C and writing apps, but there are two disadvantages to this approach. 你將錯過那些面向?qū)ο蟮闹R,因為它可能在你的游戲中使得數(shù)據(jù)建模更有效率的東西。re missing out on what will likely be a much more effective way of modeling the data in your game. By not learning OO programming off the bat, you could be enforcing bad programming habits that you39。但是,這些程序的作者即使使用老的C的格式,他們通常堅持使用面向?qū)ο缶幊碳夹g(shù)。OO是仿真(游戲)的完美方法,如果你不學(xué)習(xí)OO,你將不得不“辛苦”的工作。re using objectoriented programming techniques even though they39。ll really be doing it the hard way if you push off learning OO. 匯編語言(Assembly) 顯然,匯編是第一個計算機(jī)語言。這意味著你將與處理器的底層打交道,比如寄存器和堆棧?! y default, assembly was the first puter language. Assembly language is actually a mandbased representation of the actual instructions that your puter39。re looking for a language that39。t it! 確切的說,任何你能在其他語言里做到的事情,匯編都能做,只是不那么簡單 — 這是當(dāng)然,就像說你既可以開車到某個地方,也可以走路去,只是難易之分?! y definition, anything you can do in any other language, you can do in assembly, only not as easily of course, that39。游戲使用匯編主要是使用它那些能提高性能的零零碎碎的部分。這些程序每秒鐘要調(diào)用數(shù)千次,因此,盡可能的簡潔將有助于提高游戲的性能?! n general, assembly language is not used on its own for games. Games that use assembly language use it in bits and pieces where it can improve performance. For example, DOOM is written entirely in C with a couple of drawing routines handcoded in assembly. They are the routines that are called a few thousand times a second, so making the routine as tight as possible really helped the performance of the game. It39。t a problem. 特別注意:語言的名字叫“匯編”。把這門語言叫做“匯編程序”這種用詞不當(dāng)相當(dāng)普遍,因此,請從這門語言的正確稱呼作為起點出發(fā)。s a mon misnomer to call the language assembler, so start out on the right foot by calling the language by its proper name. 優(yōu)點:最小、最快的語言。你將是利用處理器最新功能的第一人,因為你能直接使用它們。ll be the first person to be able to take advantage of the processor39。 Disadvantages: Difficult to learn, cryptic syntax, tough to do efficiently, and it takes much more code to get something done not for the faint of heart! 移植性:接近零。如果使用了某個特殊處理器的擴(kuò)展功能,你的代碼甚至無法移植到其他同類型的處理器上(比如,AMD的3DNow指令是無法移植到其它奔騰系列的處理器上的)。t even portable to other processors of the same type (for example, AMD 3DNOW instructions are not portable to other Pentiumclass processors). 使用匯編編寫的游戲:我不知道有什么商業(yè)游戲是完全用匯編開發(fā)的?! ames Written in Assembly: I don39。網(wǎng)絡(luò)上如Intel、AMD、Motorola等有一些關(guān)于它們的處理器的資料?! esources: When you39。re basically looking for the documentation for the chip. There is some online information at [Intel], [AMD][Motorola] for their processors. As for books, [Assembly Language: StepByStep] is wellreviewed.Pascal語言 Pascal語言是由Nicolas Wirth在七十年代早期設(shè)計的,因為他對于FORTRAN和COBOL沒有強(qiáng)制訓(xùn)練學(xué)生的結(jié)構(gòu)化編程感到很失望,“空心粉式代碼”變成了規(guī)范,而當(dāng)時的語言又不反對它。最初的Pascal被嚴(yán)格設(shè)計成教學(xué)之用,最終,大量的擁護(hù)者促使它闖入了商業(yè)編程中。集成的編輯器,閃電般的編譯器加上低廉的價格使之變得不可抵抗,Pascal編程了為MSDOS編寫小程序的首選語言。s, because he was dismayed to see that FORTRAN and COBOL were not enforcing healthy structured programming disciplines in students. Spaghetti code was being the norm, and the languages of the time weren39。Pascal在1990年Windows開始流行時走到了盡頭,Borland放棄了Pascal而把目光轉(zhuǎn)向了為Windows 編寫程序的C++?! he momentum, however, did not stay. C pilers became faster and got nice builtin editors and debuggers. The almostfinal nail in Pascal39。s when Windows took over, and Borland ignored Pascal in favor of C++ for writing Windows applications. Turbo Pascal was all but forgotten. 最后,在1996年,Borland發(fā)布了它的“Visual Basic殺手”— Delphi。由于不懈努力,它很快贏得了一大群愛好者。雖然語法類似,它缺乏很多C有的簡潔操作符。雖然很難寫出難以理解的“聰明”代碼,它同時也使得一些低級操作,如位操作變得困難起來。s harder to write inscrutable clever code, but it makes lowlevel operations like bitmanipulation more difficult. 優(yōu)點:易學(xué)、平臺相關(guān)的運(yùn)行(Dephi)非常好。語言標(biāo)準(zhǔn)不被編譯器開發(fā)者認(rèn)同。 Disadvantages: World class OO successors to Pascal (Modula, Oberon) have not been successful. Language standards are not adhered to by pilermakers. Proprietary. 移植性:很差。 Portability: Dismal. The features of the language changes from platform to platform, and there are no portability toolkits to handle platformspecific features. 使用Pascal編寫的游戲:幾個?! ames Written in Pascal: A couple. The DirectX ponents for Delphi have made the playing field more level. 資料:查找跟Delphi有關(guān)的資料,請訪問:Inprise Delphi page?;氐桨耸甏氖鲿r代,它是程序初學(xué)者的第一個語言。當(dāng)回憶起B(yǎng)ASIC的行號和GOSUB命令,沒有幾個人能止住眼角的淚水。s, it was the first language for budding programmers. The original incarnations of BASIC, while easy to learn, were horribly unstructured, leading to the a rash of GOTOladen spaghetticode. Not many people wipe away tears when reminiscing about BASIC39。Windows下的HyperCard克隆品如ToolBook又慢又笨又昂貴。這門語言雖然還叫做Basic(不再是全部大寫),但更加結(jié)構(gòu)化了,行號也被去除?! astforward to the early 199039。用戶界面發(fā)生了許多變化,但依然保留著“把代碼關(guān)聯(lián)到用戶界面”的主旨?! ix versions later, Visual Basic is pretty deluxe. The userinterface has made some changes, but still retains its attach bits of code to the userinterface motif. Th