Hey. I have a quick question. [Will it be extremely hard to learn C++ on my own]

Discussion in 'Indie Basics' started by Mashew, May 16, 2007.

  1. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    Do you realize you started the flamewar? I mean, if you don't want them, then you'd be well advised not to come on so aggressively and dismissively at first. I don't take any of it personally, I'm just pointing out you got what you dished up.

    Otherwise, glad to hear your attitudes towards various tools are reasonable.
     
  2. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    If you mean geometry transformation bottlenecks in the 3d HW, I don't believe you. The performance of 3d HW is still doubling every 6 months. Far more likely that people get CPU bound with whatever number crunching they have to do there (3d modeling, physics) before feeding the 3d HW. CPU-bound problems is where the differences between Java and C++ matter.
     
  3. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    Um, if you've got a business model that works for your indie game company, great. But indie game development isn't everything out there. Some AAA titles are always going to find a way to use every scrap of CPU cycle available, as that's what pushes the envelope and makes 3D IHV guys money. At some point we'll have the digital convergence with film, there is that performance goal to be chased. Games are also not the only number crunching market out there. The idea that C++ is going to go away because nobody needs it for performance anymore is completely silly. Just maybe not indie game developers like yourself.

    A person can do just fine learning how to be a C++/ASM optimization jock and contracting that skill to the right customers. It is worth noting that the perceived need for ASM or lickety-fast stuff is not as widespread as it used to be though.

    One advantage of learning skills that other people don't want to deal with, is supply and demand causes them to be worth more money. So I've accidentally discovered in build engineering. For my next gig, I don't know if I'll be doing that or going back to the 3d C++/ASM/shader schtick.
     
  4. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    I don't think I started it, I (and I think others as well) am easily triggered nowadays by the overpresent Java-advocacy that princec (towards who I have nothing against, this is a technical debate) does better than Sun itself.
    All this "C++ is for old stupid programmers who waste their time and cannot get with the times" shows up too many times as spots, and some (like me) got quite sensitive to it, also because it shows how limited those that state it are (for example, they don't realize that some ppl do system and driver development, which you cannot do in Java, nor in Ruby, but you must do in C++ if you want to go highest level, and asm otherwise where C++ shows its limits). Indie game development doesn't represent neither the computer science in general nor the programmers market in general. That's all, but it's over now, hopefully. Have a nice time.

    You too, Cas. ;)
     
  5. electronicStar

    Original Member

    Joined:
    Feb 28, 2005
    Messages:
    2,068
    Likes Received:
    0
    Let's just put a ban on these "what language to use" threads because it always degenerates into ridiculous geekfights.
    Whatever language you guys are using it must not be very good if you have so much free time on your hands to come argue here (or it must be incredibly efficient).

    People have done succesful games using gamemaker, rpg_maker, java, c++, c#, pascal, etc... Use whatever you like and stick with it.
    Let this be the final word.
     
  6. Spiegel

    Spiegel New Member

    Joined:
    Jun 26, 2007
    Messages:
    287
    Likes Received:
    0
    Actually theres a irony in this thread... look at the title...

    Thread Title: Hey. I have a quick question. [Will it be extremely hard to learn C++ on my own]

    I think the answer is... Its harder to try and get 2 programmers to agree which language to use in a project... wars have been fought by less than this... :D
     
  7. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    Ok, it's not fair to say you started it. You definitely escalated it though. I don't necessarily mind when things escalate. Sometimes people show a lot more commitment to their thinking when you get them mad. Sometimes light comes from the heat, if not usually. I'm just saying, when you escalate something, picky pointless arguments do ensue, so no reason to act surprised or indignant about it. I think we'd all be happy to deal with the more substantive stuff now. Parts of this thread are ok, other parts are indeed a waste.
     
  8. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    Regular expression parsing in CMake script is indeed pretty efficient in terms of my programmer time. It's got plenty of warts, and I wish I had a modern, non-greedy regex engine to work with, but I've gotten tons done with somewhat broken functionality. All it took was a couple of clever workarounds. Then the bulk of the job just turns into writing the right regexes over and over again. It helps that I don't have to translate arbitrary files, just some known files that have a specific coding style.

    When I get fed up with the CMake scripting, I come here and run my mouth for a bit. I have a debate-cooled brain. :D

    My point is, I'm using a pretty junky scripting language, and nevertheless doing reasonably sophisticated parsing work with it, because it has a so-so regex engine available. Seems like "real programming" to me; it's certainly making me real money.

    If I had more time, I would try a more powerful pattern matching paradigm in Scheme. But the point isn't to implement it the best way, the point is to implement it in a cost-effective way.
     
  9. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    This is why the Decisionmaker is important in a project, i.e. the person who has the power to break the logjam and decide what tools are going to be used. With a client, for instance, it's not important what build tool all the Decisionmaker's underlings think maybe should be used. What's important, is that the Decisionmaker and maybe a few key underlings have bought into CMake, so I'm authorized to just go do it without a committee second guessing how it will be done. At that point I become the Decisionmaker. Basically you can be the Decisionmaker about the language or tool as long as you can attach a revenue stream to what you're doing.

    So a lot of this language argument is really an argument about business models.
     
  10. MedievalElks

    MedievalElks New Member

    Joined:
    Jul 25, 2006
    Messages:
    82
    Likes Received:
    0
    I think you've just listed some of the major detractions of Java. Not every problem is best solved by object-oriented code. I like that I can write OO, procedural, and generic code in C++. And the memory management thing, at least in my experience, fosters lazy programming and leads to bloated programs, leaked references, etc. And for a "pointerless language", there sure have been a lot of java.lang.NullPointerExceptions firing for the last ten years or so. :)

    To the OP:

    C++ has its warts, and is probably the most complex, abused language ever, but it's power, flexibility, speed, and portability are unmatched. If you can write from scratch and learn best practices, you'll be OK. If you have to maintain bad C++ code written by inexperienced programmers, it can be a nightmare (I deal with that in my day job all the time).

    And as others have said, don't overlook Python. It's a joy to program in and interfaces easily with C and C++, so if you have to optimize bottlenecks, it's not a chore. You can also use Py2Exe to bundle your program up into an .exe, relieving the user from installing the runtime + libraries on the target machine.
     
  11. MedievalElks

    MedievalElks New Member

    Joined:
    Jul 25, 2006
    Messages:
    82
    Likes Received:
    0
    I've been hearing this argument for ten years. The problem is, user expectations and needs increase as hardware performance does. And rather than write something I hope will run on machines several years in the future, I prefer to write something that runs on machines that are several years old.
     
  12. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    Hm, a variation on "Worse Is Better?" There will always be underpowered machines up to 6 years old, so always C++ ? Until certain classes of applications are totally solved problems. Won't happen in game development any time soon though.
     
  13. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,212
    Likes Received:
    0
    Yes, that's why I'm currently using Java. It gives me enough performance for all genres I'm interested in (even danmaku). And that on really ancient hardware (500mhz).

    And 10 years? 10 years ago Java wasn't really usable for this kind of things. However, it improved a lot and it was the same with hardware.

    Or take the (amazingly slow) Flash. As soon as the slowest hardware, you can think of, is a 2ghz machine (that's 6-8 times faster than 500mhz), you'll be able to do a lot more with it.

    Also in the past C was too slow. Then C++ was too slow.

    Things are changing. Get used to it.

    And yea, user expectations surely change as well. But that's a graphics thing (as far as programming languages are concerned). If you can utilize hardware acceleration and shaders that problem doesn't exist.
     
  14. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    You still can't accomplish everything with shaders. Until that changes, you can expect the CPU to be heavily loaded for some game problems.
     
  15. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,212
    Likes Received:
    0
    Everything I wrote was (obviously) generalized and specific to indie games, which are supposed to run on Windows, Mac and Linux. (Is it really necessary to point out this context over and over again?)

    Educate yourself and pick the right tool for the job. If you really need inline ASM all over the place then by all means use C/C++. For indie games, however, this will rarely be the case. I can't even think of a single example.
     
  16. MedievalElks

    MedievalElks New Member

    Joined:
    Jul 25, 2006
    Messages:
    82
    Likes Received:
    0
    I would choose C++ over Java because I have much more experience with it (and really dislike a lot of things about Java), not because I need inline ASM.
     
  17. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    You're talking like indies never do anything intensive with 3d graphics or FPU computation. It's not true. I think I'll start a different thread to reinforce that point.
     
  18. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,212
    Likes Received:
    0
    As I said... "For indie games, however, this will rarely be the case. I can't even think of a single example."

    Most games simply don't use much CPU, because there isn't that much to do per frame. Eg something like Ricochet Infinity could be done with Java+OpenGL. I also doubt that there is any inline ASM in the game logic. And there are 3D games with path finding and lots of models that run fine on old machines... like Tribal Trouble... oh wait that's already written in Java. ;)

    Well, feel free to point me at some indie game, which looks better than TT and runs equally well or better. Can't think of anything? Neither can I.
     
  19. HairyTroll

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    582
    Likes Received:
    0
    Back in the day it was necessary to use ASM/C/C++ to achieve decent 3D effects. Nowdays many of these effects may be achieved from a high level language using shaders.

    There are still areas in game development where optimization is necessary, but these areas are shrinking.

    The question then becomes; Why would in Indie write a game in 100% C++ for the purposes of 'runtime efficiency' when the same result can be achieved using using a high level language for 95% of the work (here, development efficiency) and calling to C/C++ for the hairy 5%?

    To summarize, yes an Indie developer should know C/C++. But these days it is not necessary for an Indie developer to write his entire game in C/C++.
     
  20. MedievalElks

    MedievalElks New Member

    Joined:
    Jul 25, 2006
    Messages:
    82
    Likes Received:
    0
    How exactly is Java "high level" compared to C++? Maybe you're still compiling C code with Visual Studio and calling it C++.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer