CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Nov 2011
    Posts
    0

    Quite new to C++

    Hello there,

    I'm quite new to C++ but not to programming in general. I have a lot of experience to javascript but only in a game development point of view. I have noticed so many limitations with the game creating software I have used that I thought id try out learning how to properly code.

    Im not sure where to start, so I thought id go with a tile based map editor, purely for making maps and wont worry about any kind of engine for now. But find myself immediatly confused.

    For now I just want a container, that will display a tileset inside it. I need the container to have scrollbars as the images will be quite large.

    I would also like a grid to be displayed over the image, seperating tiles to 32 x 32 sizes. Also when the cursor is over the container, have a box appear over the tile that is beneath the cursor at the time.

    Can anyone help just to get me started? I promise I pick this up quite quickly with help on forums (Well at least I have with Ruby and Javascript so far).

    Thanks guys (this is my first post btw so I hope I got it in the right section, sorry if i didnt)

  2. #2
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Quite new to C++

    You seem to be missing some basic concepts. I would suggest picking up one of the C++ beginners manuals that are prevalent at your local bookstore. (Or at least sit down and read the first couple of chapters.)

    If you feel that you need to order it online, "Programming Windows" from Petzold is always a good place to start.

    -Erik

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Quite new to C++

    Quote Originally Posted by egawtry View Post
    You seem to be missing some basic concepts. I would suggest picking up one of the C++ beginners manuals that are prevalent at your local bookstore. (Or at least sit down and read the first couple of chapters.)

    If you feel that you need to order it online, "Programming Windows" from Petzold is always a good place to start.

    -Erik
    That was a good place to start 20 years ago. I wouldn't recommend it any more.

    I agree that the OP needs to walk before he runs. I'd even suggest that perhaps C# and .Net would be more appropriate given his goal.

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Quite new to C++

    Quote Originally Posted by Harry Bo21 View Post
    For now I just want a container, that will display a tileset inside it. I need the container to have scrollbars as the images will be quite large.

    I would also like a grid to be displayed over the image, seperating tiles to 32 x 32 sizes. Also when the cursor is over the container, have a box appear over the tile that is beneath the cursor at the time.
    You are immediately talking about graphics. Graphics are not a beginner's subject in C++; first you should master the basics of the language. Then, you can find an appropriate GUI library to create the widgets you want.

  5. #5
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Quite new to C++

    Quote Originally Posted by GCDEF View Post
    That was a good place to start 20 years ago. I wouldn't recommend it any more.
    I will argue with you on that until the cows come home. That is the BIG problem with CS students these days. They learn from the top down instead of the bottom up and learn some very bad programming practices.


    Quote Originally Posted by GCDEF View Post
    I agree that the OP needs to walk before he runs. I'd even suggest that perhaps C# and .Net would be more appropriate given his goal.

    I suppose C# is similar enough to Java, but he said...

    Quote Originally Posted by Harry Bo21 View Post
    ...I thought id try out learning how to properly code.


    -Erik

  6. #6
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Quite new to C++

    Quote Originally Posted by egawtry View Post
    I will argue with you on that until the cows come home. That is the BIG problem with CS students these days. They learn from the top down instead of the bottom up and learn some very bad programming practices.
    I would argue it's just as bad to learn entirely from the bottom up. There are college grads out there who claim to know C++ on their resumes but have never used the STL. There's no point in wasting their time or the employer's reinventing the wheel when they don't have to. Occasionally you'll get one who is such a guru that they can write hyper-efficient C code, and they are a gem; but more often you get someone throwing dynamic memory management around willy-nilly and adding weeks of debugging time to development in the process.

    The key, in my view, is a balance approach. Teach C for low-level skills, and also teach C++ with an eye to abstraction. Do not teach them as if they are the same language with a few new features.

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Quite new to C++

    Quote Originally Posted by egawtry View Post
    I will argue with you on that until the cows come home. That is the BIG problem with CS students these days. They learn from the top down instead of the bottom up and learn some very bad programming practices.





    I suppose C# is similar enough to Java, but he said...





    -Erik
    With MFC and now .Net, there's no need to learn low level Windows programming. It doesn't hurt to understand it, but that's not a place to start. As to saying C# isn't proper coding, that's just silly.

  8. #8
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Exclamation Re: Quite new to C++

    Quote Originally Posted by GCDEF View Post
    With MFC and now .Net, there's no need to learn low level Windows programming.
    On the contrary, I use MFC because I can do low level programming with it at the same time have all the nice prepackaged GUI items.

    I agree it is nearly impossible to do low level programming with .NET. Of course, it is also almost impossible to debug .NET as well.

    Quote Originally Posted by GCDEF View Post
    As to saying C# isn't proper coding, that's just silly.
    And I suppose you think Visual Basic is a real language for commercial apps.

    -Erik

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Quite new to C++

    Quote Originally Posted by egawtry View Post
    On the contrary, I use MFC because I can do low level programming with it at the same time have all the nice prepackaged GUI items.

    I agree it is nearly impossible to do low level programming with .NET. Of course, it is also almost impossible to debug .NET as well.



    And I suppose you think Visual Basic is a real language for commercial apps.

    -Erik
    Nice red herring, but we're not talking about Visual Basic.

    I've been using Visual C++ for almost 20 years and making a pretty decent living at it. I couldn't write a Windows program using nothing but the Windows API to save my life. There's no reason to since there are several wrappers that make it much easier to use.

    You see all the time people on this board recommending stl to beginners who are trying to write their own lists and manage dynamic arrays and such. Sure it's nice to know how to do that stuff but it's not essential, and more than likely information overload to a beginner. I don't think you'd find any regulars hear coding their own linked list for the same reason I doubt very many of us use nothing but the raw API. There are simply better, faster, easier ways to do it.

  10. #10
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Quite new to C++

    Quote Originally Posted by GCDEF View Post
    Nice red herring, but we're not talking about Visual Basic.
    C# is like Visual Basic - for non-serious programmers.

    Quote Originally Posted by GCDEF View Post
    I've been using Visual C++ for almost 20 years and making a pretty decent living at it. I couldn't write a Windows program using nothing but the Windows API to save my life. There's no reason to since there are several wrappers that make it much easier to use.

    I have also been using it for 20 years, actually 22 years (MFC for 20 years). Almost every program I write I tweak at the Windows API level for speed and to fix bugs in MFC.

    Harry, the orginal poster on this thread, wants to write games. You absolutely cannot write a real game without tweaking low level code. ALL professional developers should be able to modify things at the assembly level. None of the "well this works, so use it" crap. If a programmer doesn't know how something works, then do not use it without really, really protecting his/her backside.

    -Erik

  11. #11
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Quite new to C++

    Quote Originally Posted by egawtry View Post
    Harry, the orginal poster on this thread, wants to write games. You absolutely cannot write a real game without tweaking low level code. ALL professional developers should be able to modify things at the assembly level. None of the "well this works, so use it" crap. If a programmer doesn't know how something works, then do not use it without really, really protecting his/her backside.

    -Erik
    I don't entirely agree. Yes, inner-loop optimization is a good skill to have; but that really only eeks out the last few milliseconds of performance. Most of your optimization improvements will come from simply choosing the right algorithm, and if a library has already implemented the algorithm or data structure you need, you may as well use it.

    Save the low-level work (assembly if necessary, though I doubt that's often as much of a help these days as it used to be, compilers are pretty good now) for the 10% of the code that does 90% of the work. The other 90% of the code won't affect speed significantly, so just throw it together in the most robust way possible....which usually does not mean low-level coding.

    Some code is speed-sensitive, but all code is bug-sensitive. Appropriate use of libraries and frameworks can reduce bug opportunities significantly.
    Last edited by Lindley; November 10th, 2011 at 05:48 PM.

  12. #12
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Quite new to C++

    Quote Originally Posted by Lindley View Post
    Some code is speed-sensitive, but all code is bug-sensitive. Appropriate use of libraries and frameworks can reduce bug opportunities significantly.
    And while you're out there optimizing your assembly code and tweaking using the native APIs, your competitor will bet using .net or MFC and get to market way before you do. It's nice to know that stuff but for most work, it's just not essential or even practical.

  13. #13
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Quite new to C++

    Quote Originally Posted by egawtry View Post
    C# is like Visual Basic - for non-serious programmers.


    -Erik
    That's just silly.

  14. #14
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Quite new to C++

    Oh, I just pictured that serious programmer: an untidy beard with pizza crumbs in it, a beer spotted "I'm a total geek. You'll love me" T-shirt with the famous penguin, canvas pants, dusty leather sandals, an absent look. Yeah, such guys cannot even stand a smell of C#/VB...
    Last edited by Igor Vartanov; November 11th, 2011 at 01:55 AM.
    Best regards,
    Igor

  15. #15
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Quite new to C++

    Except for the beer, you got it. A good programmer uses Mountain Dew, Dr. Pepper, or Jolt. Since you are from Russia, I bet that is why you substitute beer. Kvass is just too disgusting, even for one of those guys, and Coke or Pepsi give a headache after only ten or so cans. Chai is just too weak.

    Seriously, C# is a hack from Microsoft because they lost the Java lawsuit (and I liked J++). Like VB, sure it works, but ONLY on Windows machines. Most real RPG games these days are cross-platform which means C, C++, or Java. Java is a bit slow for RPG, so we are talking C or C++. If MS released C# under gnu license, then I might take it more seriously...

    -Erik

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured