青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當(dāng)自強而不息

【ZT】我該使用何種語言

目錄:
1、C語言
2、C++
3、C++與C的抉擇
4、匯編語言
5、Pascal語言
6、Visual Basic
7、Java
8、創(chuàng)作工具
9、結(jié)論

--------------------------------------------------------------------------------
  原 文:What Language Do I Use
  譯 者:Sunlxy
  版 本:the first edition(Ver 1.0)
--------------------------------------------------------------------------------

  這是每個游戲編程FAQ里都有的問題。這個問題每星期都會在游戲開發(fā)論壇上被問上好幾次。這是個很好的問題,但是,沒人能給出簡單的答案。在某些應(yīng)用程序中,總有一些計算機語言優(yōu)于其他語言。下面是幾種用于編寫游戲的主要編程語言的介紹及其優(yōu)缺點。希望這篇文章能幫助你做出決定。
  This is a question that belongs in every game programming FAQ. It seems to be asked in a game development forum several times a week. It's a good question, though, and not one with an easy answer. There are computer languages that work better for some applications than others. Here is a list of the major programming languages used to write games along with descriptions, advantages, and disadvantages. Hopefully this list will help you make a decision.

1、C語言

  如果說FORTRAN和COBOL是第一代高級編譯語言,那么C語言就是它們的孫子輩。C語言是Dennis Ritchie在七十年代創(chuàng)建的,它功能更強大且與ALGOL保持更連續(xù)的繼承性,而ALGOL則是COBOL和FORTRAN的結(jié)構(gòu)化繼承者。C語言被設(shè)計成一個比它的前輩更精巧、更簡單的版本,它適于編寫系統(tǒng)級的程序,比如操作系統(tǒng)。在此之前,操作系統(tǒng)是使用匯編語言編寫的,而且不可移植。C語言是第一個使得系統(tǒng)級代碼移植成為可能的編程語言。
  If FORTRAN and COBOL were the first compiled high-level languages, then C is their grandchild. It was created in the 70's by Dennis Ritchie as a tighter and more coherent successor to ALGOL, which was a structured successor to COBOL and FORTRAN. It was designed to be a smaller and simpler version of its predecessors, suitable for writing system-level programs, like operating systems. Before then, operating systems were hand-coded in assembly and were not portable. C was the first programming language that made portability a reality for system-level code.

  C語言支持結(jié)構(gòu)化編程,也就是說C的程序被編寫成一些分離的函數(shù)呼叫(調(diào)用)的集合,這些呼叫是自上而下運行,而不像一個單獨的集成塊的代碼使用 GOTO語句控制流程。因此,C程序比起集成性的FORTRAN及COBOL的“空心粉式代碼”代碼要簡單得多。事實上,C仍然具有GOTO語句,不過它的功能被限制了,僅當(dāng)結(jié)構(gòu)化方案非常復(fù)雜時才建議使用。
  C is a language that supports structured programming. That is to say that C programs are written as collections of disconnected function calls that run top-down rather than a single monolithic block of code with program control-flow happening via GOTO statements. Hence, C programs are generally easier to follow than monolithic FORTRAN and COBOL spaghetti-code. Actually, C still has a GOTO statement, but its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated.

  正由于它的系統(tǒng)編程根源,將C和匯編語言進(jìn)行結(jié)合是相當(dāng)容易的。函數(shù)調(diào)用接口非常簡單,而且匯編語言指令還能內(nèi)嵌到C代碼中,所以,不需要連接獨立的匯編模塊。
  True to its system-programming roots, it is fairly easy to interface C with assembly languages. The function-calling interface is very simple, and assembly language instructions can be embedded within C code, so linking in separate assembly-language modules is not necessary.

  優(yōu)點:有益于編寫小而快的程序。很容易與匯編語言結(jié)合。具有很高的標(biāo)準(zhǔn)化,因此其他平臺上的各版本非常相似。
  Advantages: Good for writing small fast programs. Easy to interface with assembly language. Very standardized, so versions on other platforms are similar.

  缺點:不容易支持面向?qū)ο蠹夹g(shù)。語法有時會非常難以理解,并造成濫用。
  Disadvantages: Does not easily support object-oriented techniques. Syntax can be difficult and lends itself to abuse.

  移植性:C語言的核心以及ANSI函數(shù)調(diào)用都具有移植性,但僅限于流程控制、內(nèi)存管理和簡單的文件處理。其他的東西都跟平臺有關(guān)。比如說,為 Windows和Mac開發(fā)可移植的程序,用戶界面部分就需要用到與系統(tǒng)相關(guān)的函數(shù)調(diào)用。這一般意味著你必須寫兩次用戶界面代碼,不過還好有一些庫可以減輕工作量。
  Portability: While the core of the language and the ANSI function calls are very portable, they are limited to control-flow, memory management, and simple file-handling. Everything else is platform-specific. Making a program that's portable between Windows and the Mac, for instance, requires that the user-interface portions be using system-specific function calls. This generally means that you need to write the user-interface code twice. There are libraries, though, that make the process a bit easier.

  用C語言編寫的游戲:非常非常多。
  Games Written in C: Lots and lots.

  資料:C語言的經(jīng)典著作是《The C Programming Language》,它經(jīng)過多次修改,已經(jīng)擴展到最初的三倍大,但它仍然是介紹C的優(yōu)秀書本。一本極好的教程是《The Waite Group's C Primer Plus》。
  Resources: The classic book about C is [The C Programming Language].It's gone through several iterations and has expanded to about three times its original size, but it's still a good introduction to the language. An excellent tutorial is [The Waite Group's C Primer Plus].

2、C++

  C++語言是具有面向?qū)ο筇匦缘腃語言的繼承者。面向?qū)ο缶幊蹋蚍QOOP是結(jié)構(gòu)化編程的下一步。OO程序由對象組成,其中的對象是數(shù)據(jù)和函數(shù)離散集合。有許多可用的對象庫存在,這使得編程簡單得只需要將一些程序“建筑材料”堆在一起(至少理論上是這樣)。比如說,有很多的GUI和數(shù)據(jù)庫的庫實現(xiàn)為對象的集合。
  C++ is the object-oriented successor to C. Object-oriented, or OO, programs are the next step beyond structured programming. OO programs are built out of objects, which are packages of data and functions collected into discrete units. There are many libraries of objects available that make writing programs as simple as pulling together a collection of program "building blocks" (at least in theory). For example, there are many GUI and database libraries that are implemented as collections of objects.

  C++總是辯論的主題,尤其是在游戲開發(fā)論壇里。有幾項C++的功能,比如虛擬函數(shù),為函數(shù)呼叫的決策制定增加了一個額外層次,批評家很快指出C++ 程序?qū)⒆兊帽认嗤δ艿腃程序來得大和慢。C++的擁護(hù)者則認(rèn)為,用C寫出與虛擬函數(shù)等價的代碼同樣會增加開支。這將是一個還在進(jìn)行,而且不可能很快得出結(jié)論的爭論。
  C++ is the subject of controversy, especially in the game development community. There are features of C++, like virtual functions, that add an extra layer of decision-making to function calls, and critics are quick to point out that C++ programs can be larger and slower than C counterparts. C++ advocates point out, however, that coding the equivalent of a virtual function in C requires the same overhead. It's an on-going debate that's not likely to be decided soon.

  我認(rèn)為,C++的額外開支只是使用更好的語言的小付出。同樣的爭論發(fā)生在六十年代高級程序語言如COBOL和FORTRAN開始取代匯編成為語言所選的時候。批評家正確的指出使用高級語言編寫的程序天生就比手寫的匯編語言來得慢,而且必然如此。而高級語言支持者認(rèn)為這么點小小的性能損失是值得的,因為 COBOL和FORTRAN程序更容易編寫和維護(hù)。
  In my opinion, the overhead of C++ is simply the price you pay for a better language. This same debate went on in the 60's when high-level programming languages like COBOL and FORTRAN started to displace hand-coded assembly as the language of choice. Critics correctly pointed out that programs written in high-level languages were inherently slower than hand-tuned assembly and always would be. High-level language advocates pointed out, however, that the slight performance hit was worth it because COBOL and FORTRAN programs were much easier to write and maintain.

  優(yōu)點:組織大型程序時比C語言好得多。很好的支持面向?qū)ο髾C制。通用數(shù)據(jù)結(jié)構(gòu),如鏈表和可增長的陣列組成的庫減輕了由于處理低層細(xì)節(jié)的負(fù)擔(dān)。
  Advantages: Much better than C for organizing large programs. Supports the object-oriented paradigm nicely. Libraries of common data structures, like linked lists and grow-able arrays, can remove much of the burden of having to deal with low-level details.

  缺點:非常大而復(fù)雜。與C語言一樣存在語法濫用問題。比C慢。大多數(shù)編譯器沒有把整個語言正確的實現(xiàn)。
  Disadvantages: Extremely large and complicated. Like C, the syntax lends itself to abuse. Can be slower than C. Not many compilers implement the entire language correctly.

  移植性:比C語言好多了,但依然不是很樂觀。因為它具有與C語言相同的缺點,大多數(shù)可移植性用戶界面庫都使用C++對象實現(xiàn)。
  Portability: Better than C, but still not great. While it shares the same disadvantage as C, most of the portable user-interface libraries are implemented as collections of C++ objects.

  使用C++編寫的游戲:非常非常多。大多數(shù)的商業(yè)游戲是使用C或C++編寫的。
  Games Written in C++: Lots and lots. Almost all commercial games are written in C or C++.

  資料:最新版的《The C++ Programming Language》非常好。作為教程,有兩個陣營,一個假定你知道C,另外一個假定你不知道。到目前為止,最好的C++教程是《Who's Afraid of C++》,如果你已經(jīng)熟知C,那么試一下《Teach Yourself C++》。
  Resources: The latest edition of The C++ Programming Language is excellent. As for tutorials, there are two camps, ones that assume you know C, and ones you don't. By far the best ground-up C++ tutorials are Who's Afraid of C++ and Who's Afraid of More C++. If you already know C, try Teach Yourself C++.

3、我該學(xué)習(xí)C++或是該從C開始(Should I learn C++, or should I start with C )

  我不喜歡這種說法,但它是繼“我該使用哪門語言”之后最經(jīng)常被問及的問題。很不幸,不存在標(biāo)準(zhǔn)答案。你可以自學(xué)C并使用它來寫程序,從而節(jié)省一大堆的時間,不過使用這種方法有兩個弊端:
  I thought this bore mentioning, as it's the second most commonly asked question next to "which programming language should I use?"Unfortunately, the answer isn'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ù)建模更有效率的東西。
You'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 you'll have to un-learn later. Trust me on this one.


最大的商業(yè)游戲,包括第一人稱射擊游戲很多并沒有使用C++。但是,這些程序的作者即使使用老的C的格式,他們通常堅持使用面向?qū)ο缶幊碳夹g(shù)。如果你只想學(xué)C,至少要自學(xué)OO(面向?qū)ο螅┚幊碳夹g(shù)。OO是仿真(游戲)的完美方法,如果你不學(xué)習(xí)OO,你將不得不“辛苦”的工作。
Many of the biggest commercial games, including most first-person shooters, get by without C++. The authors of these programs, however, always insist that they're using object-oriented programming techniques even though they're using plain old C. If you want to just learn C, at least teach yourself OO programming techniques. OO is the perfect methodology for simulations (read: games), and you'll really be doing it "the hard way" if you push off learning OO.


4、匯編語言(Assembly)

  顯然,匯編是第一個計算機語言。匯編語言實際上是你計算機處理器實際運行的指令的命令形式表示法。這意味著你將與處理器的底層打交道,比如寄存器和堆棧。如果你要找的是類英語且有相關(guān)的自我說明的語言,這不是你想要的。
  By default, assembly was the first computer language. Assembly language is actually a command-based representation of the actual instructions that your computer's processor runs. That means you will be dealing with the low-level details of your processor, like registers and stacks. If you're looking for a language that's English-like and is relatively self-documenting, this isn't it!

  確切的說,任何你能在其他語言里做到的事情,匯編都能做,只是不那么簡單 — 這是當(dāng)然,就像說你既可以開車到某個地方,也可以走路去,只是難易之分。話雖不錯,但是新技術(shù)讓東西變得更易于使用。
  By definition, anything you can do in any other language, you can do in assembly, only not as easily --of course, that's like saying that anywhere you can go in a car, you can go on foot, only not as easily. While the statement might be true, the later technologies made things much easier to use.

  總的來說,匯編語言不會在游戲中單獨應(yīng)用。游戲使用匯編主要是使用它那些能提高性能的零零碎碎的部分。比如說,毀滅戰(zhàn)士整體使用C來編寫,有幾段繪圖程序使用匯編。這些程序每秒鐘要調(diào)用數(shù)千次,因此,盡可能的簡潔將有助于提高游戲的性能。而從C里調(diào)用匯編寫的函數(shù)是相當(dāng)簡單的,因此同時使用兩種語言不成問題。
  In 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 hand-coded 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. It's fairly easy to write a function in assembly that is call-able from C, so using both languages wasn't a problem.

  特別注意:語言的名字叫“匯編”。把匯編語言翻譯成真實的機器碼的工具叫“匯編程序”。把這門語言叫做“匯編程序”這種用詞不當(dāng)相當(dāng)普遍,因此,請從這門語言的正確稱呼作為起點出發(fā)。
  Special Note: The name of the language is "assembly". The name of the tool that converts assembly language into true machine code is called an "assembler". It's a common misnomer to call the language "assembler", so start out on the right foot by calling the language by its proper name.

  優(yōu)點:最小、最快的語言。匯編高手能編寫出比任何其他語言能實現(xiàn)的快得多的程序。你將是利用處理器最新功能的第一人,因為你能直接使用它們。
  Advantages: Is, by definition, the smallest and fastest language. A talented assembly programmer can write programs that are faster than anything that can be done in other languages. You'll be the first person to be able to take advantage of the processor's latest new features, because you can use them directly.

  缺點:難學(xué)、語法晦澀、堅持效率,造成大量額外代碼 — 不適于心臟虛弱者。
  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!

  移植性:接近零。因為這門語言是為一種單獨的處理器設(shè)計的,根本沒移植性可言。如果使用了某個特殊處理器的擴展功能,你的代碼甚至無法移植到其他同類型的處理器上(比如,AMD的3DNow指令是無法移植到其它奔騰系列的處理器上的)。
  Portability: Zilch. Since the language is designed for a single processor, it is not portable by definition. If you use extensions specific to a particular brand of processor, your code isn't even portable to other processors of the same type (for example, AMD 3DNOW instructions are not portable to other Pentium-class processors).

  使用匯編編寫的游戲:我不知道有什么商業(yè)游戲是完全用匯編開發(fā)的。不過有些游戲使用匯編完成多數(shù)對時間要求苛刻的部分。
  Games Written in Assembly: I don't know of any commercial games that are written entirely in assembly. Some games, however, have the most time-critical portions done in assembly.

  資料:如果你正在找一門匯編語言的文檔,你主要要找芯片的文檔。網(wǎng)絡(luò)上如Intel、AMD、Motorola等有一些關(guān)于它們的處理器的資料。對于書籍而言,《Assembly Language: Step-By-Step》是很值得學(xué)習(xí)的。
  Resources: When you're looking for documentation for an assembly language, you'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: Step-By-Step] is well-reviewed.


5、Pascal語言

  Pascal語言是由Nicolas Wirth在七十年代早期設(shè)計的,因為他對于FORTRAN和COBOL沒有強制訓(xùn)練學(xué)生的結(jié)構(gòu)化編程感到很失望,“空心粉式代碼”變成了規(guī)范,而當(dāng)時的語言又不反對它。Pascal被設(shè)計來強行使用結(jié)構(gòu)化編程。最初的Pascal被嚴(yán)格設(shè)計成教學(xué)之用,最終,大量的擁護(hù)者促使它闖入了商業(yè)編程中。當(dāng) Borland發(fā)布IBM PC上的 Turbo Pascal時,Pascal輝煌一時。集成的編輯器,閃電般的編譯器加上低廉的價格使之變得不可抵抗,Pascal編程了為MS-DOS編寫小程序的首選語言。
  Pascal was designed by Nicolas Wirth in the early 70's, because he was dismayed to see that FORTRAN and COBOL were not enforcing healthy structured programming disciplines in students. "Spaghetti code" was becoming the norm, and the languages of the time weren't discouraging it. Pascal was designed from the ground up to enforce structured programming practices. While the original Pascal was designed strictly for teaching, it had enough advocates to eventually make inroads into commercial programming. Pascal finally took the spotlight in a big way when Borland released Turbo Pascal for the IBM PC. The integrated editor, lightning-fast compiler, and low price were an irresistible combination, and Pascal became the preferred language for writing small programs for MS-DOS.

  然而時日不久,C編譯器變得更快,并具有優(yōu)秀的內(nèi)置編輯器和調(diào)試器。Pascal在1990年Windows開始流行時走到了盡頭,Borland放棄了Pascal而把目光轉(zhuǎn)向了為Windows 編寫程序的C++。Turbo Pascal很快被人遺忘。
  The momentum, however, did not stay. C compilers became faster and got nice built-in editors and debuggers. The almost-final nail in Pascal's coffin happened in the early 1990'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。它是一種快速的帶華麗用戶界面的 Pascal編譯器。由于不懈努力,它很快贏得了一大群愛好者。
  Finally, in 1996, Borland released its "Visual Basic Killer", Delphi. Delphi was a fast Pascal compiler coupled with a gorgeous user interface. Against all odds (and the Visual Basic juggernaut), it gained a lot of fans.

  基本上,Pascal比C簡單。雖然語法類似,它缺乏很多C有的簡潔操作符。這既是好事又是壞事。雖然很難寫出難以理解的“聰明”代碼,它同時也使得一些低級操作,如位操作變得困難起來。
  On the whole, Pascal is simpler than C. While the syntax is similar, it lacks a lot of the shortcut operations that C has. This is a good thing and a bad thing. It's harder to write inscrutable "clever" code, but it makes low-level operations like bit-manipulation more difficult.

  優(yōu)點:易學(xué)、平臺相關(guān)的運行(Dephi)非常好。
  Advantages: Easy to learn. Platform-specific implementations (Delphi) are very nice.

  缺點:“世界潮流”面向?qū)ο蟮腜ascal繼承者(Modula、Oberon)尚未成功。語言標(biāo)準(zhǔn)不被編譯器開發(fā)者認(rèn)同。專利權(quán)。
  Disadvantages: "World class" OO successors to Pascal (Modula, Oberon) have not been successful. Language standards are not adhered to by compiler-makers. Proprietary.

  移植性:很差。語言的功能由于平臺的轉(zhuǎn)變而轉(zhuǎn)變,沒有移植性工具包來處理平臺相關(guān)的功能。
  Portability: Dismal. The features of the language changes from platform to platform, and there are no portability toolkits to handle platform-specific features.

  使用Pascal編寫的游戲:幾個。DirectX的Delphi組件使得游戲場所變大了。
  Games Written in Pascal: A couple. The DirectX components for Delphi have made the playing field more level.

  資料:查找跟Delphi有關(guān)的資料,請訪問:Inprise Delphi page。
  Resources: The find out about Delphi, check out the Inprise Delphi page.


6、Visual Basic

  哈,BASIC。回到八十年代的石器時代,它是程序初學(xué)者的第一個語言。最初的BASIC形式,雖然易于學(xué)習(xí),卻是可怕的無組織化,它義無返顧的使用了GOTO充斥的“空心粉式代碼”。當(dāng)回憶起B(yǎng)ASIC的行號和GOSUB命令,沒有幾個人能止住眼角的淚水。
  Ahh, BASIC. Way back in the stone-age of the 80'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 GOTO-laden "spaghetti-code". Not many people wipe away tears when reminiscing about BASIC's line numbers and the GOSUB command.

  快速前進(jìn)到九十年代早期,雖然不是蘋果公司所希望的巨人,HyperCard仍然是一個在Windows下無法比擬的吸引人的小型編程環(huán)境。 Windows下的HyperCard克隆品如ToolBook又慢又笨又昂貴。為了與HyperCard一決高下,微軟取得了一個小巧的名為 Thunder編程環(huán)境的許可權(quán),并把它作為Visual Basci 1.0發(fā)布,其用戶界面在當(dāng)時非常具有新意。這門語言雖然還叫做Basic(不再是全部大寫),但更加結(jié)構(gòu)化了,行號也被去除。實際上,這門語言與那些內(nèi)置于TRS-80、Apple II及Atari里的舊的ROM BASIC相比,更像是帶Basic風(fēng)格動詞的Pascal。
  Fast-forward to the early 1990's. While not the monster that Apple was hoping for, HyperCard was a compelling little programming environment that had no equal under Windows. Windows-based HyperCard clones like ToolBook were slow, clunky, and expensive. To finally compete with HyperCard, Microsoft licensed a neat little programming environment named Thunder, releasing it as Visual Basic 1.0. The user-interface was very innovative for the time. The language, while still called Basic (and no longer all-caps), was much more structured. Line numbers were mercy-killed. The language was, in fact, much closer to Pascal with Basic-style verbs than the old ROM BASIC that was built into every TRS-80, Apple ][, and Atari.

  經(jīng)過六個版本,Visual Basic變得非常漂亮。用戶界面發(fā)生了許多變化,但依然保留著“把代碼關(guān)聯(lián)到用戶界面”的主旨。這使得它在與即時編譯結(jié)合時變成了一個快速原型的優(yōu)異環(huán)境。
  Six versions later, Visual Basic is pretty deluxe. The user-interface has made some changes, but still retains its "attach bits of code to the user-interface" motif. This, in combination with instantaneous compiling, makes it a terrific environment for fast prototyping.

  優(yōu)點:整潔的編輯環(huán)境。易學(xué)、即時編譯導(dǎo)致簡單、迅速的原型。大量可用的插件。雖然有第三方的DirectX插件,DirectX 7已準(zhǔn)備提供Visual Basic的支持。
  Advantages: Neat IDE. Easy to learn. Instantaneous compiling makes for very fast and easy prototyping. Lots and lots of add-ons available. While there are currently third-party DirectX add-ons for Visual Basic, DirectX version 7 is going to include support for Visual Basic right out of the box.

  缺點:程序很大,而且運行時需要幾個巨大的運行時動態(tài)連接庫。雖然表單型和對話框型的程序很容易完成,要編寫好的圖形程序卻比較難。調(diào)用 Windows的API程序非常笨拙,因為VB的數(shù)據(jù)結(jié)構(gòu)沒能很好的映射到C中。有OO功能,但卻不是完全的面向?qū)ο蟆@麢?quán)。
  Disadvantages: Apps are large and require several large runtime DLL's to run. While form and dialog-based apps are easy to make, writing good graphical apps is more difficult. Calling Windows API functions is clunky, because VB data structures don't map nicely to C. Has OO features, but is not fully object-oriented. Proprietary.

  移植性:非常差。因為Visual Basic是微軟的產(chǎn)品,你自然就被局限在他們實現(xiàn)它的平臺上。也就是說,你能得到的選擇是:Windows,Windows或Widnows。當(dāng)然,有一些工具能將VB程序轉(zhuǎn)變成Java。
  Portability: Worse than dismal. Since Visual Basic is owned by Microsoft, you're pretty-much limited to whatever platforms they've ported it too. That means that you've got the choice of Windows, Windows, or Windows. Note that there are, however, a couple of tools that help convert VB apps to Java.

  使用Visual Basic編寫的游戲:一些。有很多使用VB編寫的共享游戲,還有一些是商業(yè)性的。
  Games Written in Visual Basic: A few. There are lots of shareware games done in VB, and a couple of commercial offerings.

  資料:微軟的VB頁面有一些信息。
  Resources: The [Microsoft VB page].

7、Java

  Java是由Sun最初設(shè)計用于嵌入程序的可移植性“小C++”。在網(wǎng)頁上運行小程序的想法著實吸引了不少人的目光,于是,這門語言迅速崛起。事實證明,Java不僅僅適于在網(wǎng)頁上內(nèi)嵌動畫 — 它是一門極好的完全的軟件編程的小語言。“虛擬機”機制、垃圾回收以及沒有指針等使它很容易實現(xiàn)不易崩潰且不會泄漏資源的可靠程序。
  Java was originally designed by Sun to be a portable "small C++" that could be used in embedded applications. The idea of running little applications in a web-page really captured people's imaginations, so the language caught on quickly. It turned out that Java wasn't just suitable for embedding animated banners in web pages --it was a downright nifty little language for application programming! The "virtual machine" nature, garbage collection and lack of pointers made it easy to make bulletproof apps that didn't crash and had no resource leaks.

  雖然不是C++的正式續(xù)篇,Java從C++ 中借用了大量的語法。它丟棄了很多C++的復(fù)雜功能,從而形成一門緊湊而易學(xué)的語言。不像C++,Java強制面向?qū)ο缶幊蹋贘ava里寫非面向?qū)ο蟮某绦蚓拖褚赑ascal里寫“空心粉式代碼”一樣困難。
  While not an official "sequel" to C++, Java borrows very heavily from C++ syntax. It dumps many of the more difficult C++ features to reveal a rather compact and easy-to-learn language. Unlike C++, Java enforces object-orientation with a heavy hand. Writing a non-OO app in Java is as difficult as writing spaghetti-code in Pascal.

  優(yōu)點:二進(jìn)制碼可移植到其他平臺。程序可以在網(wǎng)頁中運行。內(nèi)含的類庫非常標(biāo)準(zhǔn)且極其健壯。自動分配合垃圾回收避免程序中資源泄漏。網(wǎng)上數(shù)量巨大的代碼例程。
  Advantages: Binaries are portable to other platforms. Apps can run embedded in web pages. The included class library is reasonably standardized and extremely robust. Automatic allocation and garbage collection all but eliminates resource leaks in applications. Zillions of code examples on the web.

  缺點:使用一個“虛擬機”來運行可移植的字節(jié)碼而非本地機器碼,程序?qū)⒈日嬲幾g器慢。有很多技術(shù)(例如“即時”編譯器)很大的提高了Java的速度,不過速度永遠(yuǎn)比不過機器碼方案。早期的功能,如AWT沒經(jīng)過慎重考慮,雖然被正式廢除,但為了保持向后兼容不得不保留。越高級的技術(shù),造成處理低級的機器功能越困難,Sun為這門語言增加新的“受祝福”功能的速度實在太慢。
  Disadvantages: Uses a "virtual machine" to run portable byte-code rather than native machine code, so apps are slower than true compilers. There are technologies (like "Just In Time" compilers) that greatly improve the speed of Java, but the speed will likely always lag behind true machine-code solutions. Early features like the Abstract Windowing Toolkit were not well thought-out and, while officially abandoned, have to hang around for backward compatibility. Is very high-level, which makes dealing with any low-level machine features very difficult. Sun is pretty slow in adding new "blessed" features to the language.

  移植性:最好的,但仍未達(dá)到它本應(yīng)達(dá)到的水平。低級代碼具有非常高的可移植性,但是,很多UI及新功能在某些平臺上不穩(wěn)定。
  Portability: The best of the lot, but still not what it should be. The low-level code is very portable, but a lot of the UI and newer features are wobbly on some platforms.

  使用Java編寫的游戲:網(wǎng)頁上有大量小的Applet,但僅有一些是商業(yè)性的。有幾個商業(yè)游戲使用Java作為內(nèi)部腳本語言。
  Games Written in Java: Lots of little applets in web pages, but only a couple of commercial offerings. Several commercial games use Java as the internal script language.

  資料:Sun的官方Java頁面有一些好的信息。IBM也有一個非常好的Java頁面。JavaLobby是一個關(guān)于Java新聞的最好去處。
  Resources: [Sun's official Java page] has some good info. IBM also has an excellent [Java page]. The [JavaLobby] is the best place to go for news about Java.

8、創(chuàng)作工具

  上面所提及的編程語言涵蓋了大多數(shù)的商業(yè)游戲。但是也有一個例外,這個大游戲由于它的缺席而變得突出。
  All of the programming languages mentioned above cover pretty-much every commercial game out there. There is one exception, but it's such a big one that it would be conspicuous by its absence.

  “神秘島”。沒錯,賣得最好的商業(yè)游戲不是使用以上任何一門語言編的,雖然有人說“神秘島”99%是使用 3D建模工具制作的,其根本的編程邏輯是在HyperCard里完成的。
  Yep, the best selling commercial game of all time wasn't written in any of the above languages. While some would say that 99% of Myst was written using 3D modeling tools, the underlying program logic was done in HyperCard.

  多數(shù)創(chuàng)作工具有點像Visual Basic,只是它們工作在更高的層次上。大多數(shù)工具使用一些拖拉式的流程圖來模擬流程控制。很多內(nèi)置解釋的程序語言,但是這些語言都無法像上面所說的單獨的語言那樣健壯。
  Most authoring tools are a bit like Visual Basic, only they work at a much higher level. Most of the tools use some kind of click-and-drag flowchart motif to model control flow. Many contain embedded interpreted programming languages, but these languages aren't nearly as robust as the standalone languages mentioned above.

  優(yōu)點:快速原型 — 如果你的游戲符合工具制作的主旨,你或許能使你的游戲跑得比使用其他語言快。在很多情況下,你可以創(chuàng)造一個不需要任何代碼的簡單游戲。使用插件程序,如 Shockware及IconAuthor播放器,你可以在網(wǎng)頁上發(fā)布很多創(chuàng)作工具生成的程序。
  Advantages: Fast prototyping --if your game fits the motif the tool's made for, you can probably get your game running faster than any other language. In many cases, you can make a rudimentary game without writing any code. You can broadcast many authored apps on web pages with plug-ins like Shockwave and IconAuthor Player.

  缺點:專利權(quán),至于將增加什么功能,你將受到工具制造者的支配。你必須考慮這些工具是否能滿足你游戲的需要,因為有很多事情是那些創(chuàng)作工具無法完成的。某些工具會產(chǎn)生臃腫得可怕的程序。
  Disadvantages: Proprietary, so you're at the mercy of the tool-maker as to what features will be added. You've gotta really look at these tools to see if they'll do everything that your game's gonna require, because there are things that authoring tools simply can't do. Some of these tools produce frighteningly bloated apps.

  移植性:因為創(chuàng)作工具是具有專利權(quán)的,你的移植性以他們提供的功能息息相關(guān)。有些系統(tǒng),如Director可以在幾種平臺上創(chuàng)作和運行,有些工具則在某一平臺上創(chuàng)作,在多種平臺上運行,還有的是僅能在單一平臺上創(chuàng)作和運行。
  Portability: Since authoring tools are proprietary, your portability is limited to whatever they offer. Some systems, like Director, can author and run on several platforms. Some tools can author on one platform but play on several. Some are single-platform beasts.

  使用創(chuàng)作工具編寫的游戲:“神秘島”和其他一些同類型的探險游戲。所有的Shockwave游戲都在網(wǎng)絡(luò)上。
  Games Written in Authoring Tools: Myst and a few other "exploration" games of the same genre. All of the Shockwave games on the web.

  資料:Director、HyperCard、SuperCard、IconAuthor、Authorware。

9、結(jié)論(Conclusion)

  你可能希望得到一個關(guān)于“我該使用哪種語言”這個問題的更標(biāo)準(zhǔn)的結(jié)論。非常不幸,沒有一個對所有應(yīng)用程序都最佳的解決方案。C適于快而小的程序,但不支持面向?qū)ο蟮木幊獭++完全支持面向?qū)ο螅欠浅?fù)雜。Visual Basic與Delphi易學(xué),但不可移植且有專利權(quán)。Java有很多簡潔的功能,但是慢。創(chuàng)作工具可以以最快的速度產(chǎn)生你的程序,但是僅對某一些類型的程序起作用。最好的方法是決定你要寫什么樣的游戲,并選擇對你的游戲支持最好的語言。“試用三十天”的做法成為工業(yè)標(biāo)準(zhǔn)是件好事情。
  You probably were hoping for a more cut-n-dry conclusion to the "what programming language do I use" dilemma. Unfortunately, there's no solution that's optimal for all applications. C is suited for fast and small applications, but doesn't support OO programming well. C++ has very complete OO support, but is frighteningly complicated. Visual Basic and Delphi are easy to learn, but are non-portable and proprietary. Java has a lot of neat features, but is slow. Authoring tools can get your app working quickest, but are only useful for a narrow range of applications. It might just be best for you to figure out what kind of game you're writing and pick the language that would best support your game. It's a good thing that the "try it free for 30 days" offer has become the industry norm :-)


--------------------------------------------------------------------------------
作者簡介
  John Hattan是位于德克薩斯州的Watauga里最大的軟件公司 — Code Zone的主要負(fù)責(zé)人。如果你對他的文章有什么看法,請寫信給他。
 

posted on 2007-05-13 00:09 lovedday 閱讀(805) 評論(0)  編輯 收藏 引用 所屬分類: ■ Game Program

公告

導(dǎo)航

統(tǒng)計

常用鏈接

隨筆分類(178)

3D游戲編程相關(guān)鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲一区免费在线观看| 一二三区精品福利视频| 亚洲精品系列| 亚洲国产欧美不卡在线观看| 黄色国产精品一区二区三区| 国产真实精品久久二三区| 国产午夜久久| 在线激情影院一区| 在线观看三级视频欧美| 亚洲激情成人网| 亚洲一区自拍| 久久亚洲国产成人| 亚洲久久一区| 久久国产高清| 欧美日本二区| 国语自产在线不卡| 久久蜜桃精品| 国产在线欧美| 这里只有精品视频| 久久麻豆一区二区| 亚洲剧情一区二区| 久久不射网站| 欧美色播在线播放| 亚洲高清一区二| 欧美一级片一区| 亚洲日本欧美在线| 99精品国产一区二区青青牛奶| 亚洲免费在线精品一区| 免费成人毛片| 国产综合av| 欧美一级电影久久| 亚洲精品综合久久中文字幕| 欧美在线一级视频| 国产精品视频九色porn| 日韩视频精品在线| 欧美va天堂| 欧美影院在线| 亚洲成人自拍视频| 欧美精品v国产精品v日韩精品| 欧美精品一区在线观看| 国产亚洲精品高潮| 亚洲专区免费| 亚洲精品国久久99热| 久久久久国内| 国产小视频国产精品| 亚洲一区免费在线观看| 亚洲激情黄色| 欧美成人午夜激情在线| 怡红院精品视频在线观看极品| 亚洲一级电影| 亚洲最新视频在线| 欧美日韩中文字幕精品| 99热免费精品| 91久久久久久| 欧美精品成人一区二区在线观看| 在线观看欧美亚洲| 乱中年女人伦av一区二区| 性做久久久久久免费观看欧美| 久久亚洲欧美| 国产一区av在线| 久久精品二区三区| 午夜日韩视频| 国产一区二区中文| 另类天堂av| 美女诱惑一区| 一区二区三区www| 一区二区三区回区在观看免费视频 | 香蕉尹人综合在线观看| 国产精品一区二区三区免费观看| 亚洲自拍都市欧美小说| 中文av字幕一区| 国产嫩草影院久久久久| 久久久久久电影| 蜜桃精品一区二区三区 | 亚洲欧美精品在线观看| av成人免费观看| 国产日韩欧美亚洲一区| 久久在线精品| 欧美国产日韩在线| 亚洲一区二区三区在线看| 亚洲伊人伊色伊影伊综合网| 国产午夜精品理论片a级探花| 久久综合色影院| 欧美日韩不卡| 久久激情视频久久| 欧美大片免费久久精品三p| 一本在线高清不卡dvd| 亚洲午夜视频在线| 伊人久久亚洲热| 99视频一区| 韩国av一区| avtt综合网| 亚洲高清色综合| 一二三区精品福利视频| 亚洲一区图片| 亚洲区一区二区三区| 亚洲视频在线一区观看| 国产亚洲成年网址在线观看| 免费黄网站欧美| 国产精品v一区二区三区| 免费不卡欧美自拍视频| 久久成人综合视频| 一本大道av伊人久久综合| 午夜精品福利视频| 日韩视频一区二区三区在线播放| 亚洲一区二区三区涩| 亚洲国产欧美不卡在线观看| 亚洲一级二级在线| 日韩视频亚洲视频| 久久深夜福利免费观看| 午夜亚洲性色福利视频| 老牛嫩草一区二区三区日本| 亚洲愉拍自拍另类高清精品| 另类激情亚洲| 老牛嫩草一区二区三区日本| 国产精品成人aaaaa网站| 另类尿喷潮videofree| 国产伦理一区| 亚洲新中文字幕| 在线亚洲欧美视频| 欧美高清一区二区| 欧美成人官网二区| 国内视频一区| 欧美一乱一性一交一视频| 亚洲影院在线| 欧美日韩亚洲国产一区| 亚洲国产精品久久久久婷婷老年 | 亚洲毛片一区| 麻豆成人小视频| 久久婷婷国产综合精品青草| 国产精品主播| 午夜精品久久久99热福利| 亚洲在线视频| 国产精品视频| 亚洲欧美美女| 久久精品国产精品亚洲综合| 国产免费亚洲高清| 午夜精品一区二区三区四区| 亚洲欧美日本国产专区一区| 欧美天天在线| 亚洲一区免费网站| 久久久777| 亚洲第一福利在线观看| 久久在线播放| 亚洲国产成人在线| 亚洲人成网站精品片在线观看| 久久视频精品在线| 欧美激情一区二区三区不卡| 亚洲高清网站| 亚洲精品一品区二品区三品区| 午夜日韩福利| 国产欧美在线| 久久―日本道色综合久久| 亚洲国产欧美一区二区三区同亚洲| 亚洲国产另类精品专区 | 久久久噜噜噜久久中文字幕色伊伊 | 在线亚洲观看| 久久精品一区二区| 在线不卡亚洲| 欧美日本国产| 亚洲一区二区伦理| 久久一区二区三区国产精品| 亚洲激情电影中文字幕| 欧美日韩中文精品| 欧美在线视频观看| 91久久线看在观草草青青| 亚洲视频网在线直播| 国产伦精品一区| 欧美插天视频在线播放| 在线亚洲免费视频| 免费在线观看一区二区| 一区二区三区不卡视频在线观看| 国产精品久久久久一区二区三区共 | 嫩草国产精品入口| 一区二区三区日韩精品| 久久亚洲精品欧美| 亚洲午夜电影网| 在线看欧美日韩| 欧美性一区二区| 你懂的视频一区二区| 亚洲一区二区三区在线播放| 麻豆精品视频在线观看| 亚洲伊人一本大道中文字幕| 红杏aⅴ成人免费视频| 欧美日韩在线观看一区二区| 久久精品视频99| 亚洲一区二区在线| 亚洲日本成人网| 久久午夜精品| 欧美亚洲尤物久久| 99国产精品国产精品久久| 国产一区二区三区高清播放| 欧美另类专区| 老巨人导航500精品| 久久9热精品视频| 国产精品对白刺激久久久| 久久综合网络一区二区| 欧美在线观看视频| 午夜精品久久久久99热蜜桃导演| 亚洲精品久久嫩草网站秘色 |