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. impossible

    Original Member

    Joined:
    Aug 9, 2004
    Messages:
    443
    Likes Received:
    0
    If you go with Java, I suggest trying out processing a great easy to use framework for games and multimedia applications in general.
     
  2. HairyTroll

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    582
    Likes Received:
    0
    I think perhaps you missed the joke. It's not a hierarchy of programming languages. Rather it's how the developers perceive themselves.
     
  3. MrGoldfish

    Original Member

    Joined:
    Jul 28, 2005
    Messages:
    50
    Likes Received:
    2
    I learnt C++ as my first language entirely on my own, from books and the web, and i found it an enoyable experience. I'm actually doing a computer science degree at the moment and my god i'm glad i taught myself. The rate at which classes teach programming languages is ridiculously slow. My rule of thumb, never wait for anyone to teach you anything you can't just as easily teach yourself. Especially programming as you're continuously going to be teaching yourself new things on a day to day basis.
     
  4. KatieL

    Original Member

    Joined:
    Nov 2, 2005
    Messages:
    44
    Likes Received:
    0
    Java cannot, in the general case, be optimised and executed faster than a pre-optimised language. It does not matter how good the optimisation is because the pre-optimised code can also be done that well. The BEST execution time equals the execution time of the best optimised code plus the optimisation time, which is necessarily greater than the execution time of the best optimised code.

    The advocates for Java tend to point to non-general case successes. And Java can, in some circumstances, be optimised more easily than C++ because it's designed for that to be the case. And hence it's more likely to actually get done well - but again, only in non-general cases. In the general case, the limit of optimisation is the same for both languages - for any given operation (regardless of the language of initial specification) there exists one (or more) optimal native code sequences.

    The difference between the two is that JIT compilation is attempting to discover them in limited circumstances at runtime. It is notable that this approach only even tends towards absolute optimality if the subsequently detected hot-spot is executed infinitely many times; otherwise the slow pre-optimisation cycles will add further to their disadvantage - and since the limit of optimisation is the same for both run and compile time optimisations, the runtime optimisations cannot regain an advantage.

    In many circumstances, this simply doesn't matter -- Tribal Trouble spends almost all of its time rendering OpenGL stuff, so it really doesn't matter if the API is called by C++ or Java. And hence Java is a perfectly reasonable tool to write software such as this.
     
  5. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    No, it merely validated my world view. Except that Haskell and OCaml programmers are again smarter than Lisp programmers. OCaml programmers are more productive than Haskell programmers, but not smarter. Then there are all the "boutique" programming languages that have like 5 users. Eventually by the Great Circle Theory you realize that industrialists are actually smarter than academics. But do they proceed on the basis of knowledge or ignorance?
     
  6. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    False, if the time spent optimizing is very much smaller than the time spent executing.

    What does matter is how fast C++ or Java can shove vertices into arrays, because that's the interface you're actually going to be using if you want it fast.
     
  7. HairyTroll

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    582
    Likes Received:
    0
    I don't think it's really about being 'smarter'. It's more like 'hey, my language is better than yours'.
     
  8. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    Actually, Haskell and OCaml programmers are smarter than most programmers. But then we get into questions of smarter vs. more productive. Personally, I think the domain of problems where exotic programming languages make you more productive than mainstream languages is rather limited. Specifically with regards to game development and all the Functional Programming stuff, I've been there, done that, and found it wanting. It didn't help me get a darned thing done, and there aren't enough FP game programmers to build up a meaningful industrial support base.
     
  9. tagged

    Original Member

    Joined:
    Oct 28, 2004
    Messages:
    132
    Likes Received:
    0
    It's like saying most cyclists are smarter than drivers because I've talked to cyclists who have been... Unless there's a statistic/graph with a huge sample size that helps backup that statement, it's simply your opinion.

    Actually, Haskell and OCaml programmers seem smarter than most programmers...

    would be more accurate ;)
     
  10. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    In FP there's more to know, and it takes more brain cells to know it.
     
  11. HairyTroll

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    582
    Likes Received:
    0
    If you want to be helpful please explain why FP is so great.
     
  12. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    If you're in the Seattle area go to one of the Seattle Functional Programmers meetings, aka SeaFunc. I co-organized these guys but I'm not currently involved. I don't live in Seattle anymore and my interest in FP is in remission pending a real need. These guys are smart and the level of brain trust will become apparent to you if you go.

    On the internet, there's news://comp.lang.functional and plenty of other resources. Feel free to dig. I've already given my verdict regarding FP and the industrial realities of game programming. There's nothing magical available, and the level of industrial support for this class of problems is poor. But you do have to be smarter than the average programmer to understand what these FP guys are on about, let alone make effective use of FP in the real world.

    There is a pecking order of language understanding in academia. Some have the opinion that guys like Guido van Rossum, Python's author, are complete amateurs as far as the academic study of language design. I recall one fellow who worked on the OCaml optimizer saying that Guido has contributed nothing at all to the discipline. I think his words were, "What, syntax?" It bugged him that there's been 50 years of academic study of computer languages and in his opinion, Guido hadn't absorbed any of it.

    Now, I think this underappreciates what it takes to popularize and industrialize a language. Guido has done tons there; of course, those are not academic concerns. You don't have to be smart to solve those problems, just forceful. In fact if you're too smart about things you won't solve them; look at the vast majority of academics.

    So there's this tension about what makes a language guy smart vs. useful. I will say one thing regarding "smart." If you think programming languages don't matter because they're all basically the same, they all do things the same way, you're wrong. They don't. FP didn't turn out to be worth anything to me right now, but it's worth exposing yourself and learning that there's more than one way to approach computation.
     
  13. KatieL

    Original Member

    Joined:
    Nov 2, 2005
    Messages:
    44
    Likes Received:
    0
    "False, if the time spent optimizing is very much smaller than the time spent executing."

    No. It isn't.

    In the general case, the C++ (or other compile-time optimised language) can be optimised as well as the Java (or other run-time optimised language) and hence the same algorithm written in both languages MUST, in the limit, cost the same run time.

    The total run time of doing the optimisation then running the algorithm must therefore necessarily be longer than the run time of the compile time optimised version.
     
  14. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,211
    Likes Received:
    0
    If the hardware is fixed and if the program is always used in the same way, yes.

    Other than that statically compiled stuff has a disadvantage. Thats the reason why Java's performance will continue to improve with each release for the foreseeable future. Statically compiled .net stuff for example runs slower than usual jitted stuff.

    Well, right now the performance difference isn't all that big anymore. Will those few percent result in enough extra sales to offset the extra work? I sorta doubt it. If it takes 500mhz or 450mhz won't make much of a difference, since 500mhz is already well below that 6 year barrier.

    If it would require 1.5ghz instead of 500mhz... well, that would certainly affect sales. But the way things are now it's a very appealing compromise. You get Mac and Linux support for free, you are 3-5 times more productive, beta testing is a breeze, and you also get amazing tools for free.

    Now if there only would be some equally appealing compromise for content creation, I would be really happy.
     
  15. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    From your statement above, you're familiar with limits. So you surely understand amortization of the optimization cost over the run time. Nobody cares if the optimization cost is %1 of the runtime. You'll never be able to measure it. Any benchmark improvement under 10% is noise, and any benchmark improvement under 20% is not worth bothering with.
     
  16. Spiegel

    Spiegel New Member

    Joined:
    Jun 26, 2007
    Messages:
    287
    Likes Received:
    0
    As one who knows C/C++/C#, Java, Ruby, Caml, smalltalk and so many more... I prefer the power of C++, once you're mind is set with pointers, you wont many as many mistakes as you would...

    Its a matter of personal taste...

    If you want a good (great) book on C++ or Java go to Bruce Eckel Book's Page. Great books on most used languages...

    Unfortunately making a game is not only about learning a programming language...
     
  17. Luis

    Original Member

    Joined:
    Dec 14, 2005
    Messages:
    67
    Likes Received:
    0
    try Delphi! It's much more powerful than those bytecode/virtualmachine crap and maybe a little bit easier to learn than c++
     
  18. Falcan

    Indie Author

    Joined:
    Sep 5, 2004
    Messages:
    37
    Likes Received:
    0
    Also, because I suppose you post on Indie Gamer to program games, if you want to create games don't forget to learn game design ;-) Programming is only technical part, I think the easier(you can or you can't do thing X). If you want to be a wheel in a machine somehwere as programmer though it's ok to stick only to tech questions... :p
     
  19. Mashew

    Mashew New Member

    Joined:
    May 14, 2007
    Messages:
    53
    Likes Received:
    0
    Wow. I totally forgot about this place and I was figuring that my account was gone and the thread was long dead. But, I came back and it is still at the top of the front page.

    You guys are the first programming like forum that doesn't flame every person that asks a question. Thank you, you guys are amazing. Lol.

    Just FYI. :p
     
  20. bvanevery

    bvanevery New Member

    Joined:
    Jun 25, 2007
    Messages:
    369
    Likes Received:
    0
    Indies have a hard life. Most aren't into making it any harder for people than it already is.
     

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