Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why C++?

Name: Anonymous 2011-10-05 1:20

http://www.gamearchitect.net/Articles/WhyC++.html

Nothing succeeds like success. The fact that C++ is the dominant language for game development gives it a lot of inertia. If you want to hire experienced programmers, it's much easier to recruit C++ gurus than it is to find OCaml talent. If you're going to develop for consoles, Microsoft and Sony provide C++ compilers, but for any other language you're on your own. And if you want to link with middleware, most modern game middleware packages--including Gamebryo, Havok, FMOD, SpeedTree and the Unreal Engine--are written in C++. Developing in another language, even C, is a lonely path.

The power of the C++ network effect is not to be underestimated. For example, Naughty Dog used an in-house LISP variant called GOAL (Game Oriented Assembly Lisp) for the Jak and Daxter titles. They had a significant investment in GOAL, for which they'd written their own compiler, linker and debugger. They supported dynamic reloading of code by a running game and reportedly generated tight, efficient assembly. After their acquisition by Sony, however, Naughty Dog were forced to transition to C++ development. "Sony wants us to be able to share code with other studios, and this works both ways - both other studios using our code and vice versa," posted Naughty Dog lead programmer Scott Shumaker.

Name: Anonymous 2011-10-05 1:25

C++ is the dominant language for game development

no, it's the dominant language for console/PC AAA game development. Not all games are big expensive blockbusters. Most of them are casual games on browsers and phones.

Name: Anonymous 2011-10-05 1:34

>>2
I found a game written using functi-anal language:
http://code.google.com/p/masterofmagicclone/source/browse/#git%2Fsrc

the code looks uglier than C/C++. Do we really want that prized functi-anality?

Name: Anonymous 2011-10-05 1:37

C/C++

            times (Run, Length-1) putPixel(X, Y++, Color);


Funct-anal language:

            for run = 0 to length - 1 do
              Allegro.putpixel bitmap !x !y color;
              y := !y + 1
            done

Name: Anonymous 2011-10-05 1:39

the guy writing this article is a moron.

I confess that I haven't worked with aspects or closures enough to even know whether they give great productivity improvements.

I'm skeptical of garbage collection because *stupid reason*

god I hate that shit. RAII IS A STUPID HACK. GET IT THROUGH YOUR THICK SKULLS

Name: Anonymous 2011-10-05 1:41

>>3
man, I don't even know ML and I already prefer this code to C++

Name: Anonymous 2011-10-05 2:14

>>4

doing mutable stuff in ocaml isn't as pretty as C/C++, but it can do it just the same...

Name: Anonymous 2011-10-05 2:15

>>4
macros

macros everywhere!

I don't hate C++, but that example is plain and simply idiotic

Name: Anonymous 2011-10-05 2:36

>>5
he would fit in on /prog/

Name: Anonymous 2011-10-05 3:41

i've fallen in love with XNA/C#. i can't imagine going back to C++ and suffering just for a few measly cycles.

Name: VIPPER 2011-10-05 4:26

>>1
Good job copypasting shit instead of using your own brain.
Ah you dont have one.
>>2-10
Good job responding to an obvious troll.

Name: Anonymous 2011-10-05 7:28

I'm not sure what the Naughty Dog example proves. Seems like they were doing just fine without C++. "It's popular" isn't an argument for quality.

Name: Anonymous 2011-10-05 7:31

>>12
The example proves that C++ is here to stay forever, better start using it or exit programming.

Name: Anonymous 2011-10-05 7:40

If you think garbage collection "just works," read this explanation of the complexities inherent in C# finalization.
I'm not a fan of garbage collection, but saying that it is complex because of finalization is akin to saying clothes suck because it's hard to clean them when they're stained with shit. Using destructors for anything else than deallocation is bad design.

Name: Anonymous 2011-10-05 13:33

>>14
to extend your metaphor to an earlier point in your post,
I'm not a fan of clothing
and this is what anti-GC people actually sound like to me

Name: Anonymous 2011-10-05 13:41

If you want to hire experienced programmers, it's much easier to recruit C++ gurus than it is to find OCaml talent.

Typical C++er attitude that programmers are good at languages rather than programming.

Just because C++ requires years of study and nobody can agree how it's supposed to work, does not make that true of basically any other language than maybe Common Lisp.

Name: Anonymous 2011-10-05 13:49

>>12
Were they making an argument for quality? I don't think so.

Name: Anonymous 2011-10-05 14:09

>>16
What?! Most of Common Lisp problems are legacy-related. Everything else, except CLOS, is straightforward. But CLOS is hard because OOP in general is hard.

Name: Anonymous 2011-10-05 14:43

>>18
Common Lisp
GC is shit.

Name: Anonymous 2011-10-05 16:36

What I don't understand is why `the industry' pushes these things. Obviously most `old school' developers and/or people who know what they are talking about agree that
• OO is shit;
• C++ is shit;
• Java is shit;
• C# is shit;
• UML is shit;
• `Paired programming' is shit;
• EnterpriseQualityCode is shit;
GC is shit.

So why do these things become standard in industry? Are businesses that easily swayed by a few buzz words? Does nobody do the research?
It would take years to undo the damage all this has done. And it's just going to get worse and worse and there's nothing we can do about it.

Name: Anonymous 2011-10-05 21:08

>>20
what do you use then faggot?

Name: Anonymous 2011-10-05 21:47

>>18
there are CL programmers who don't use CLOS. Everyone has his favorite subset of the language, just like C++

Name: Anonymous 2011-10-05 22:09

>>20
Cool story bro.

Name: Anonymous 2011-10-05 23:17

>>22
CLOS is an external library. One can disable it completely.

Name: Anonymous 2011-10-05 23:22

>>20
The point of "paired programming" is to have non-ending argument about insignificances, instead of writing useful code.

Name: Anonymous 2011-10-05 23:33

>>25
( ≖‿≖)

Name: Anonymous 2011-10-06 0:06

>>24
Wrong. Why do people keep spreading this falsehood?

Name: Anonymous 2011-10-06 0:13

>>27
Standalone interpreters sometimes omit CLOS at all.

Name: Anonymous 2011-10-06 0:58

C++ is too complex. languages should help you, not fight you at every step of the way. compilers cant even understand it. they have to cheat and add in shit behind your back like virtual clasess. the assembly output looks obfuscated, so you cant even understand bugs when they occur so you have to code in a very specific, inexpressive and clunky style. too big, too many needless features that were put in simply to increase the language's popularity.

c++ is simply too big. you should use almost every language feature in any project of significant size. with c++, you actively try to avoid this, and most projects will limit themselves to a subset of the language. c++ makes it too hard to write good programs.

this is bad language design. when you have to pay for features you do not use (in language implementation complexity), that is bad design.

the only people who are allowed to use c++ are math wizards like sergei brin and larry page. math is the most powerful language that is available to us, but computers do not understand it natively. if you have a deep understanding of math, then it matters a lot less what language you implement the algorithms in.

i agree that garbage collection is shit, but memory is essentially infinite these days. the real problem is concurrency. time is the new space. c++ is esepeccialy awful at this problem, and java is not much better. i encourage you all to look at functional and concurrent languages if you want to keep your skill relevant. even my phone has two cores.

hand coded assembly is still about two times faster than the best C compilers. that's not enough. multicore has the potential to be at least n times faster. 

also Common lisp is kind of a shitty lisp. clojure and arc are much, much better. common lisp is like the c++ of lisps.


>>18

oop does not have to be hard. look at ruby

Name: FrozenVoid 2011-10-06 1:10

>still about two times faster than the best C compilers
Thats if you don't check asm output and improve your hand-coded C code.
Its easy:
1.insert timing RDTSC calls at critical points
2.at end of program display cycles spent in critical code.
Now check asm output for C:
every instruction has latency: there is opcode latency table for every processor
JMPs to non-obvious locations stop the pipeline,CPUs can't predict everything 
interfering with cache stalls the pipeline, like:self-modifying, cryptic code paths.
register starvation check, registers need to be used 100%
stack activity. Stack is still slower than registers, despite easy access
Reduction of function calls: inlining with macros/optimizations.
excessive memory accessess.
Using expensive Opcodes vs simpler 1 cycle code.
If code can't be optimized any further consider replacing it with inline asm

Name: Anonymous 2011-10-06 1:21

>>28
Then they aren't Common Lisp.

Name: FrozenVoid 2011-10-06 1:21


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List