C++

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • I've read somewhere that C++ is supposed be C on steroids and after reading Bjarne Stroustrup's book "The C++ Programming Language", I am convinced that C++ is indeed C on drugs. Let me render (pun intended) that more precisely:

      C++ is C on heavy-laced cocaine.

      There are so many ineffable pitfalls it's like playing Russian roulette with six bullets.

      It's such a monstrous language a 300m Katamari seems whimsical in comparison.

      And there actually is an industry writing games in this language? I'm getting seizures trying to write C++ code that my compiler will accept without throwing a hissy fit. It feels like Stroustrup is deliberately trying to make the programmer's life hell on earth.

      There. I feel a lot better now after venting off my accumulated desperation and aggravation.

      Now would you please excuse me. I will go sit in a corner, cry, and contemplate that without knowing this language I am pretty much fucked as a game programmer.

      ;(
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • Originally posted by sledge
      I will go sit in a corner, cry, and contemplate that without knowing this language I am pretty much fucked as a game programmer.

      Not necessarily true. You don't have to learn C++ to be able to program games, as there are other equally viable languages out there with their own slew of game development libraries.

      Python and PyGame
      C#/VB.NET and DirectX /Axiom
      Java and lwjgl/jogl
      Or even just go with straight C and use something like SDL/GLFW
    • Heh. Plenty of people don't really believe that C++ is an improvement over C. Personally, I use C-style C++, and by that I mean it's C with classes (which was the original name for C++). I rarely break out the real C++ features, like namespaces, templates (though I do use those occasionally), or any of the other crazy things. Hell, I shy away from inheritence, and I sure as hell don't see why you would use anything other than the printf() family.

      The REAL fun is writing Java code in C-style. It's possible...

      I'd hope you are at least good with C before making a post like that, though.
      -Larrik Jaerico

      www.LarrikJ.com
    • Sheesh - go program in assembly....

      C++ is simple. Just learn the basics and add to it as you go.

      Inheritance and polymorphism ABSOLUTELY ROCK! When used correctly - nightmare otherwise. There are so many cool things you can do with the features available that it's hard to really grasp it all. Template functions alone will save you hundreds of hours of programming. Template classes are another workhorse. Once you get to know the stuff it really is nice.

      So sit and cry in the corner until you feel better, take a deep breath and start again - easy does it. There are tons and tons of features, and they are often admittedly difficult to get your head around. When the going gets frustrating, back up, take a breath, have a donut and try again.

      Rich
      "Your job is not to die for your country. Your job is to make some other poor sod die for his."
    • Eventually, C++ may very well become defunct, and the majority of games programmers will have to evolve or get out. What separates a good programmer from a bad programmer is one with an open mind who actually makes an effort to learn nuances of a programming language as needed and without prejudice... embracing what works and accepting what does not work. C++ does give you the ability to shoot yourself in the foot, and you'll have to wrap your head around some advanced object oriented concepts before you can appreciate those "dangerous" powers.
    • I have nothing against object-oriented programming. If it floats your boat, fine. C++ just doesn't cut it for me. The added complexity just isn't worth it.
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • I agree with you. There ate times when C++ just isnt worth the trouble. But when it comes to building and creating games where control of low level programming and the flexibility of Object-Oriented programming are both very important you need a language like c++.

      If i ever find myself in need of a cross-platfom application then i'll go to java. And if i ever need to run anything on DOS 5 then i'll go back to QBASIC.
      .Code
      push you ; haha!
    • Originally posted by DarkPenguin
      ... the flexibility of Object-Oriented programming ...

      That's highly debatable. Is object-oriented programming/development really more flexible than functional or procedural programming?

      In my humble opinion - I don't think so.
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • Well in theory asm can be just as flexible as C++ if you code it right. All programming languages end up as a the same 1's and 0's (well not the exact same but you get my drift). C++ just adds the ability to change large blocks of code into function calls and large blocks of functions into objects. You can use other object oriented programming languages or procedural programming lanuages and accomplish the same tasks. It's the way C++ changes code into functions and functions into objects that i personally like (and apparently alot of people agree with me).
      .Code
      push you ; haha!

      The post was edited 2 times, last by DarkPenguin ().

    • Originally posted by DarkPenguin
      C++ just adds the ability to change large blocks of code into function calls and large blocks of functions into objects.
      I don't understand. Could you be more specific?
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • But every programming language lets you combine fundamental types to more abstract constructs.
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • I think C++ is incredibly useful to game programmers. But I also think that extremes are not good. One thing I love about C++ is that I can write a global function when I need to and fall back on old procedural techniques when they benefit. For axample, I have an Assembly Language function that fills a chunk of memory using DWORD fills. In some other languages (like Java, I think), you'd have to make a class or something. How retarded is that?

      Conversly, I think forcing everything to be procedural and closing your mind to object oriented programming may be too limiting. Who can argue that templates are a godsend? Write one templated sorting function or templated hash table class and be done with it. Polymorphism is just incredibly cool; you can create a list of generic objects and tell them to call their specialized draw or AI functions. You can't beat that! Yes, you can set up something like that C, but you'd probably have to use an annoying system of function pointers.

      Anyway, it's 1:00am and I'm rambling.... I guess the whole point I'm trying to make is this: do what you're comfortable with, but keep an open mind.
    • Originally posted by rezination
      For axample, I have an Assembly Language function that fills a chunk of memory using DWORD fills. In some other languages (like Java, I think), you'd have to make a class or something. How retarded is that?

      That's pretty retarded, because you can't embed assembler in Java code. You'd need to write an NMI to interface a platform-dependent library. And that basically makes Java's benefits a moot point. (BTW, I think Java is a good language.)

      Originally posted by rezination
      Who can argue that templates are a godsend?

      Templates aren't just an OO-practice.

      Originally posted by rezination
      Polymorphism is just incredibly cool; you can create a list of generic objects and tell them to call their specialized draw or AI functions. You can't beat that! Yes, you can set up something like that C, but you'd probably have to use an annoying system of function pointers.

      Hey Sherlock, guess what a V-table is...

      ps.: I think it's brilliant how some people here spin my C++ ramblings into incompetence at programming or closed-mindedness. Way to go, guys!
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • You know the point of this forum is to encourage open discussion not to insult other people.

      If you think something someone said is flawed then you don't have to make fun of them. Why dont you try to tell them their error politly and try to educate them so maybe everyone can learn something? Things are alot more productive that way.
      .Code
      push you ; haha!

      The post was edited 1 time, last by DarkPenguin ().

    • Originally posted by DarkPenguin
      You know the point of this forum is to encourage open discussion not to insult other people.

      I think that's what we are doing. Calling someone Sherlock isn't an insult in my eyes.

      Originally posted by DarkPenguin
      If you think something someone said is flawed then you don't have to make fun of them.

      So what's with all those political satirists?

      Originally posted by DarkPenguin
      Why dont you try to tell them their error politly and try to educate them so maybe everyone can learn something?

      Please point out where I didn't act politely and didn't try to educate.
      Brits: Shop at home and have goods imported because they live on an island.
      Aussies: Shop at home and have goods imported because they live on an island.
      Americans: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
      Canadians: Cross the southern border for cheap shopping, gas, & liquor in a backwards country.
    • lol, I knew that 1:00am rambling would come back and bite me in the ass. :P No biggie, it takes more than that to insult me. :)

      My ignorance of Java makes me quite unqualified to say much about it. My point was only to convey that while I enjoy and use OOP, I dislike being locked into it as is the case with Java. That's why I don't use it.

      I know exactly what a v-table is. You can do object oriented programming in Assembly if you really wanted to.... My point there was that you'd have to do it manually. Object oriented programming is really more about the design then the coding. Object oriented programming languages do nothing more than provide syntatic sugar to aid the programmer. With C, you don't have that sugar. It's like DarkPenguin said, it all gets converted into 1' & 0's in the end. The CPU could care less whether I wrote procedurally or used OOP, it just wants the chunk instruction in the pipline.

      Finally, I didn't mean to imply any incompitence at programming nor any close mindedness on your part. How could I? I have never met you and have never seen any code from you so I certainly have nothing to base that on. :) My statements were meant to be general and were not targeted at you. I find that I sometimes have to force myself to open my mind to other approaches for a given problem when I feel I know the best solution.