C ++糟透了游戏 [英] C++ sucks for games

查看:63
本文介绍了C ++糟透了游戏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




最近,我研究了使用C ++进行游戏编程,这里是我找到的




C ++游戏开发人员花了很多时间调试损坏的内存b
。很少(如果有的话)编译器提供完全安全的模式。


不出所料,使用

C ++进行现代游戏开发的项目中存在很高的失败率。 br />

当程序运行时,你甚至无法改变函数定义,并且可以看到效果(终极调试工具)。

或者,你不能执行程序的一小部分

而不编译和链接整个事物,然后将你的游戏

带入一个特定的表示你的部分代码正在执行的状态。


静态类型系统将你锁定在某个设计中,你不能用
*测试*新想法,当他们来找你时,没有重新设计你的整个班级层次结构。


C ++是如此不灵活,甚至那些将它用于游戏的人,必须

用其他语言写出他们的游戏逻辑(通常非常慢,

无表情且仍然是garba ge收集)。他们还必须使用这两种语言来接口。


C ++缺少高阶函数。函数对象模仿它们

很差,速度慢,使用起来很痛苦。另外,C ++类型系统确实不能很好地处理函数对象。


C ++程序不能思考在运行时新代码,并以编译形式插入新代码。反正不容易。


C ++编码感觉非常重复,例如,在编写类

访问器时,你经常需要编写const和非const方法与

完全相同的函数体。看看STL。


使用C ++进行编程时,你会觉得自己像个盲人一样想要画一些东西。你不会_see_你的程序

将运行的数据结构。 Lisp编程更直观。


构造函数和智能指针使得很难从昂贵的操作中分辨出廉价的操作




C ++缺乏自动内存管理,因此它鼓励复制

对象以使手动内存管理易于管理。

引用计数方案通常比现代垃圾更慢< b / b
收藏家也不那么一般。


最重要的是,C ++语法是不规则的,你经常会发现自己

再次输入重复模式再一次 - 一个任务很容易自动化

语言更简单的语言。甚至有关于C ++

模式的书籍,一些C ++专家为能够以类似计算机的精度执行

这些模式而感到自豪 - 这是一台计算机

应该是开始做的。


C ++程序很慢:即使编译器擅长

微优化代码,程序员浪费时间在C ++中编写重复的模式并调试内存损坏,而不是寻找更好的算法,而这些算法对速度来说更为重要

比愚蠢的微优化。


很难为C ++项目找到优秀的程序员,因为大多数好的程序员毕业于像Lisp这样的语言或完全避免使用C ++

。 C ++以懦弱的心态吸引缺乏想象力的同伴。

对于创意项目,你想要像瘟疫一样避免它们。


我认为以上所有使得C ++成为商业游戏开发的一个非常糟糕的选择。

Hey

Recently, I researched using C++ for game programming and here is what
I found:

C++ game developers spend a lot of their time debugging corrupted
memory. Few, if any, compilers offer completely safe modes.

Unsurprisingly, there is a very high failure rate among projects using
C++ for modern game development.

You can not even change function definitions while the program is
running and see the effects live (the ultimate debugging tool).

Alternatively, you can''t execute a small portion of the program
without compiling and linking the whole thing, then bringing your game
into a specific state where your portion of the code is being executed.

The static type system locks you into a certain design, and you can''t
*test* new ideas, when they come to you, without redesigning your
whole class hierarchy.

C++ is so inflexible, even those who do use it for games, have to
write their game logic in some other language (usually very slow,
inexpressive and still garbage collected). They also have to interface
the two languages.

C++ lacks higher-order functions. Function objects emulate them
poorly, are slow and a pain to use. Additionally, C++ type system does
not work well with function objects.

C++ programs can not "think" of new code at run-time, and plug that
new code into themselves in compiled form. Not easily, anyway.

C++ coding feels very repetitive, for example, when writing class
accessors, you often have to write const and non-const methods with
completely identical function bodies. Just look at STL.

When programming in C++ you feel like a blind person trying to draw
something. You don''t _see_ the data structures that your procedures
will operate on. Lisp programming is much more visual.

Constructors and smart pointers make it hard to tell cheap operations
from expensive ones.

C++ lacks automatic memory management and so it encourages copying
objects around to make manual memory management manageable.
Reference-counting schemes are usually slower than modern garbage
collectors and also less general.

Most important, C++ syntax is irregular, and you often find yourself
typing repetitive patterns again and again - a task easily automated
in languages with simpler syntax. There are even books on C++
patterns, and some C++ experts take pride in being able to execute
those patterns with computer-like precision - something a computer
should be doing to begin with.

C++ programs are slow: even though the compilers are good at
micro-optimizing the code, programmers waste their time writing
repetitive patterns in C++ and debugging memory corruption instead of
looking for better algorithms that are far more important for speed
than silly micro-optimizations.

It''s hard to find good programmers for C++ projects, because most of
the good programmers graduated to languages like Lisp or avoided C++
altogether. C++ attracts unimaginative fellows with herd mentality.
For creative projects, you want to avoid them like a plague.

It is my opinion that all of the above makes C++ a very bad choice for
commercial game development.

推荐答案

Neo-LISPer写道:
Neo-LISPer wrote:
嘿嘿
...


创意项目,你想像瘟疫一样避免它们。
我认为以上所有都是C ++对于
商业游戏开发来说,这是一个非常糟糕的选择。
Hey ...

creative projects, you want to avoid them like a plague.
It is my opinion that all of the above makes C++ a very bad choice for
commercial game development.



我对其他人的看法:


不要给巨魔喂食。请!


My opinion to others:

Do not feed the trolls. Please!


嗯。我记得在大学里生动地做了lisp。

我认为作业是一个简单的长分裂问题。我记得

整个班级中只有少数人设法找到了实现这种方式的方式......我的问题是新手会在没有C的情况下做打破了汗水。


之后,没有人再次使用过lisp ......


...除了Jax&达克斯特开发商。他们的游戏引擎运行在一个

解释的lisp平台上(我相信)并且已经产生了一些我见过的最令人印象深刻的平台游戏......

所以道德是....

我不知道,但我很快就不会切换到Lisp ......

一旦掌握了它就可能很好......

但我觉得这可能太过递归了大多数大脑的自下而上编程

想要处理...


Neo-LISPer <是ne ******** @ yahoo.com>在消息中写道

新闻:87 ************ @ yahoo.com ...
hmm. I remember vividly doing lisp at uni.
I think the assignment was a simple long division problem. I remember that
only a few people in the entire class managed to work out a way of achieving
it... I problem that is a newbie would do in C without breaking a sweat.

After that, no-one ever used lisp again...

...except the Jax & Daxter developers. Their game engine runs on an
interpretted lisp platform (I believe) and has spawned some of the most
impressive platformers I''ve ever seen...

So the moral is....
I don''t know, but I won''t be switching to Lisp any time soon...
Maybe its good once you get the hang of it...
But I think it may be too recursive & bottom-up programming for most brains
to want to deal with...

"Neo-LISPer" <ne********@yahoo.com> wrote in message
news:87************@yahoo.com...


最近,我研究了使用C ++进行游戏编程,这里是我发现的:

C ++游戏开发人员花了很多时间调试损坏的内存。很少(如果有的话)编译器提供完全安全的模式。

不出所料,使用C ++进行现代游戏开发的项目失败率非常高。

你程序运行时甚至无法更改函数定义并查看效果(最终调试工具)。

或者,您不能执行程序的一小部分<没有编译和链接整个事物,然后将你的游戏带入一个特定的状态,你的部分代码正在执行。

静态类型系统将你锁定到某个特定状态设计,当你来到你面前时,你不能测试*新的想法,而不需要重新设计你的全班级。

C ++是如此不灵活,甚至那些谁将它用于游戏,必须用其他语言写出他们的游戏逻辑(通常很慢,没有表现力,仍然是垃圾收集)。他们还必须界面两种语言。

C ++缺乏高阶函数。函数对象模仿它们很差,速度慢,使用起来很痛苦。另外,C ++类型系统对功能对象不起作用。

C ++程序不能思考。在运行时新代码,并以编译形式将新代码插入自身。反正不容易。

C ++编码感觉非常重复,例如,在编写类访问器时,你经常需要用完全相同的函数编写const和非const方法身体。看看STL。

当用C ++编程时,你会觉得自己像个盲人一样想要画一些东西。您不会_see_您的程序将运行的数据结构。 Lisp编程更直观。

构造函数和智能指针使得很难从昂贵的操作中分辨出廉价的操作。

C ++缺乏自动内存管理,所以它鼓励复制周围的对象,使手动内存管理易于管理。
参考计数方案通常比现代垃圾收集器慢,而且不太通用。

最重要的是, C ++语法是不规则的,你经常发现自己一次又一次地输入重复模式 - 一个任务很容易自动化,语法更简单的语言。甚至有关于C ++
模式的书籍,一些C ++专家为能够以类似计算机的精度执行这些模式而感到自豪 - 这是计算机应该开始做的事情。< C ++程序很慢:即使编译器擅长微代码优化代码,程序员也浪费时间在C ++中编写重复模式并调试内存损坏而不是
很难为C ++项目找到优秀的程序员,因为大多数
优秀的程序员毕业于Lisp等语言或完全避免使用C ++。 C ++以懦弱的心态吸引缺乏想象力的同伴。
对于创意项目,你想要像瘟疫一样避免它们。

我认为上述所有内容都使C ++成为一个非常糟糕的选择<商业游戏开发。
Hey

Recently, I researched using C++ for game programming and here is what
I found:

C++ game developers spend a lot of their time debugging corrupted
memory. Few, if any, compilers offer completely safe modes.

Unsurprisingly, there is a very high failure rate among projects using
C++ for modern game development.

You can not even change function definitions while the program is
running and see the effects live (the ultimate debugging tool).

Alternatively, you can''t execute a small portion of the program
without compiling and linking the whole thing, then bringing your game
into a specific state where your portion of the code is being executed.

The static type system locks you into a certain design, and you can''t
*test* new ideas, when they come to you, without redesigning your
whole class hierarchy.

C++ is so inflexible, even those who do use it for games, have to
write their game logic in some other language (usually very slow,
inexpressive and still garbage collected). They also have to interface
the two languages.

C++ lacks higher-order functions. Function objects emulate them
poorly, are slow and a pain to use. Additionally, C++ type system does
not work well with function objects.

C++ programs can not "think" of new code at run-time, and plug that
new code into themselves in compiled form. Not easily, anyway.

C++ coding feels very repetitive, for example, when writing class
accessors, you often have to write const and non-const methods with
completely identical function bodies. Just look at STL.

When programming in C++ you feel like a blind person trying to draw
something. You don''t _see_ the data structures that your procedures
will operate on. Lisp programming is much more visual.

Constructors and smart pointers make it hard to tell cheap operations
from expensive ones.

C++ lacks automatic memory management and so it encourages copying
objects around to make manual memory management manageable.
Reference-counting schemes are usually slower than modern garbage
collectors and also less general.

Most important, C++ syntax is irregular, and you often find yourself
typing repetitive patterns again and again - a task easily automated
in languages with simpler syntax. There are even books on C++
patterns, and some C++ experts take pride in being able to execute
those patterns with computer-like precision - something a computer
should be doing to begin with.

C++ programs are slow: even though the compilers are good at
micro-optimizing the code, programmers waste their time writing
repetitive patterns in C++ and debugging memory corruption instead of
looking for better algorithms that are far more important for speed
than silly micro-optimizations.

It''s hard to find good programmers for C++ projects, because most of
the good programmers graduated to languages like Lisp or avoided C++
altogether. C++ attracts unimaginative fellows with herd mentality.
For creative projects, you want to avoid them like a plague.

It is my opinion that all of the above makes C++ a very bad choice for
commercial game development.



Neo-LISPer写道:
Neo-LISPer wrote:
一些毫无意义的东西




除了你糟糕的拖钓尝试(你的大多数论据只是表明你不知道C ++)你甚至不告诉我们什么是替代方案

到C ++的游戏编程可能是。


-

要获得我真实的电子邮件地址,请删除两个onkas

-

Hendrik Belitz

- Abort,Retry,Fthagn? -



Besides your poor trolling attempts (most of your arguments just show that
you have no knowledge of C++) you don''t even tell us what the alternative
to C++ in game programming could be.

--
To get my real email adress, remove the two onkas
--
Hendrik Belitz
- Abort, Retry, Fthagn? -


这篇关于C ++糟透了游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆