Archived

This topic is now archived and is closed to further replies.

Is C++ useful for hobbyists?

This topic is 4945 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Whenever someone asks what language to use it''s almost C++ and the reason most of the time is because you''re going to have to learn it anyways if you plan on working in the industry. I know C++ but haven''t used it in a few months. I''ve been using Java but too slow since I plan to make a graphics intensive games but I want to be more productive so I don''t know. There must be some reason other than you have to learn it for this and that, right? You can skip this part, it''s only why I don''t want to use C++ for that purpose. ********* Is there a reason to use C++ if you don''t plan on going into the game programming industry, I certainly want to but it seems according to post around here your pay is extremely low and there won''t be much more of a industry where I live(the US) in the future. I won''t mind business program and I think system programming is seems like all types of computer engineering/software programming jobs are going to be rare in teh future and hard to get. And even if you can get one it will be low pay. ******** So there''s my reason for wanting to konw why C++ is a good choice for hobbyist. I''m mainly intrested in a productive language that I can easily distribute. And ins''t too hard, I know age doesn''t matter but I''m only 14 and haven''t dwelled too far out of the math I"m learning in school. But a lot of C++ game programming tutorials seems to need linear algebra(not from experience but from article and posts and such), even though I plan to do 2D only. So is C++ the right choice for me if I don''t plan on going into hte game dev industry? What is more productive, C++ or another language? Any help is appreciated.

Share this post


Link to post
Share on other sites
Productivity is more based on how proficient someone is with a particular language than the language itself (unless you''re programming in something silly.. like cobol). The bottom line is to use the language that fits you. I enjoy C++ because it has excellent flexibility (and compatibility), is relatively simple, and has an unbelievable amount of learning resources available.

Share this post


Link to post
Share on other sites
Well didn't want to have to make a reference counter or any smart pointer type thing and have to deal with memory evertime. Causing less time spent on the main objective.

Is it frowned upon to use libraries like Boost? If i wanted to use STL containers, will I have to add both of them(can I even do that?) or does something like Boost already have them.

Does it make it too slow say to mix boost and SDL or whatever API I use?



[edited by - Unnoobish N00b on May 28, 2004 7:05:34 PM]

Share this post


Link to post
Share on other sites
If you''re not going into the game industry, and you''re not planning on writing Doom 10 in your parents basement, I see little point in messing with C++.

Use some language that allows you to focus on the problem rather than on the minutiae of the implementation. There are lots to choose from.

/me refrains from commenting on the "c++ is simple" statement.

Share this post


Link to post
Share on other sites
quote:
Original post by Unnoobish N00b
Well didn''t want to have to make a reference counter or any smart pointer type thing and have to deal with memory evertime. Causing less time spent on the main objective.


Er, what? C#, Java, Lisp, Python etc... would help with this.
Garbage collectors do exist for C++, but they are not as robust as ones disigned into other languages. C++ with Managed Extentions (C++.Net) has a good garbage collector, but this is a new language not C++; it only works with .Net.

C++ requires you to use reference counters and smart-pointers to write reliable code (that is exception safe and thread safe).

quote:

Is it frowned upon to use libraries like Boost?


No, quite the opposite. It shows you are familar with the tools available to the C++ community.

quote:

If i wanted to use STL containers, will I have to add both of them(can I even do that?) or does something like Boost already have them.


Yes, you can and should use both. Boost has additional containers that augment the STL.

quote:

Does it make it too slow say to mix boost and SDL or whatever API I use?


No.


In the case you wouldn''t want to use the STL nor boost, you wouldn''t want to use much of C++ - it''s a better candidate for C; e.g. drivers and code for micro-controllers.

Share this post


Link to post
Share on other sites
Thanks for the replies.

Well seeing as I already tried Java. I might look into the other languages listed. Python seems to be popular and if I decide to use C++ again I may use it with C++. Though if there aren''t actually too many hinderances with using the multiple libraries I may stay with C++.

Share this post


Link to post
Share on other sites
I would recomend you to start of with Python. So you can learn think logical without mess with memory managerment and so on. When you feel confortable with Python you maybe want to go for C++ or stay to Python.

http://www.cis.gsu.edu/~shong/oojokes/

Share this post


Link to post
Share on other sites
quote:
Original post by Programmer One
quote:
Original post by Arild Fines
/me refrains from commenting on the "c++ is simple" statement.


Talk for yourself.


Yeah, I do that, but when I do that, you guys don''t get to benefit from what I''m saying.

Share this post


Link to post
Share on other sites
quote:
Original post by Programmer One
quote:
Original post by Arild Fines
/me refrains from commenting on the "c++ is simple" statement.


Talk for yourself.

Anything is simple once you live and breath it.


So you instantly knew the repercussions of the following code?


template<class T, class U>
struct Typelist
{
typedef T Head;
typedef U Tail;
};


Modern C++ Design, by the way.


Share this post


Link to post
Share on other sites
Well C# seems to be quite popular now days. Not too many game programming resources though. About the productivity questions is it productive in the game programming field? I know you can use DirectX with it but what else and is it slower than Java or as slow?

Share this post


Link to post
Share on other sites
Having played with C++ and win32 to develope a cad type app (more as a hobby though, maybe one day...) and now using C#, I now have a renewed energy and inspiration!
C# is sooo much easier to use with windows than dealing with the win32 api, and as Arild Fines posted "Use some language that allows you to focus on the problem rather than on the minutiae of the implementation."
IMO C# has all the flexibilty of C++ with the ease of coding VB. C# is a 'pure' OOP enviroment where to use C/C++ you either have to make wrappers/use MFC for OOP or develope a hybrib mix of procedural and oop code and that can take a LOT of time to set up even a simple OGL window (a window with events that is, not just a display!) if you're still learning the language.
Maybe later when I get it all working how I'd like I'll port it to C++ IF speed or backwards compatibility with windows will ever be a problem

It's very easy to set up an OGL window with C# using any of the 3rd party libraries, then just concentrate on your modelling/animation. Good Luck.

[edited by - Micko on May 29, 2004 7:36:16 PM]

Share this post


Link to post
Share on other sites
C++ is no more or less object-oriented then C#. I don't see how it is any more difficult to develop in C++ than it is in C#, Java, or anything else. C++ was designed so that you can write code in pretty much any manner you want, good or bad.

quote:
C# is a 'pure' OOP enviroment where to use C/C++ you either have to make wrappers/use MFC for OOP or develope a hybrib mix of procedural and oop code and that can take a LOT of time to set up even a simple OGL window (a window with events that is, not just a display!) if you're still learning the language.

Just because the standard doesn't provide any facility for OO handling of the GUI doesn't mean that problem hasn't ben solved thousands of times. Nobody's forcing you to reinvent the wheel.

[edited by - igni ferroque on May 29, 2004 9:34:28 PM]

Share this post


Link to post
Share on other sites
Unnoobish NOOb -
I agree with igni, the goal of c++ was to create an oop enviroment and it was also built for backwards capabilty to use/re-use old C code. This might have been a good idea at the time, though my opinion is that this backwards capabilty is the bane of C++. Let''s face it, there are just too many ways for a programmer to approach C++ and win32 to feel confident that they''re doing it ''the right'' or ''the best'' way.
Yes, you can be totally OO in C++ but it doesn''t enforce it like C#. I think that''s why C# (with .net) will do well, it has the paradigm of C++ ( OOP ) but has cut the apron strings of other languages and therefore is consistent in all of it''s code, that is, not a mixture of C and C++ just so the languages can ''get on'' together to create a window (somewhere in your wrapper you will have to call C functions of the win32 api).
This brings us to .NET and the future, if you want a job developing software for the biggest market share of pc users, you''d better jump on the .net wagon as soon as possible. With ''Longhorn'' around the corner there will be a lot of changes (and redundent code to re-write perhaps?) and new oppurtunities to develope new app''s using the abilities of the new framework.
Of course there are many advantages (speed and some portabilty) to coding in C++ if you''re a game programmer, and you could probably say even more again in assembly, but unless you are a full time professional game programmer, where do you draw the line?
I still like and write C++, I just find C# easier to achieve the same goals, and for what I do I don''t see any performance hits or loss of functionality so why make it any harder than it has to be?

Share this post


Link to post
Share on other sites
quote:

Use whatever language you want. It really doesn''t matter on a 1+ Ghz computer.



Try running any of the DX SDK samples using the C# versions, and then the C++ versions and tell me there''s no difference.

C++ is easy, and you''ll be very glad that you learned it when it comes time to make whatever you''re making.

Share this post


Link to post
Share on other sites
Wow!
Som people are so full of crap
"Use whatever language you want. It really doesn''t matter on a 1+ Ghz computer"
I hawe not read more funy post than that one
Do you realy beleve that??
I mean we all know that c++ is harder than other lanuges (relativly, maybe not than assembler).
So why do you think all the game companies woud us it ??
Becouse they like it ??
I don''t hawe much expirience with programing (not that much I mean) buth I hawe seen a lots of games.
Yes it''s true that some games hawe not been writen in c++ (profesional) but you coud see the diference from a helicopter

P.S.
Sory about gramatical errors

Share this post


Link to post
Share on other sites
I think what I meant was that if you already know C++, use it. Unless you want to learn another language =) Really I don''t see why there''s a debate.

quote:
Original post by Red Drake
Wow!
Som people are so full of crap
"Use whatever language you want. It really doesn''t matter on a 1+ Ghz computer"
I hawe not read more funy post than that one

quote:
I know you can use DirectX with it but what else and is it slower than Java or as slow?

Java screams on my 440Mhz UltraSPARC IIi.

Share this post


Link to post
Share on other sites
"Speed" is relevant to the program you''re using.

For games, you need top speed. That means C/C++, with a splattering of ASM thrown in at critical times.

No programming language is really "slow" these days (even JIT / partially compiled stuff like .net / Java is pretty damned quick), and therefore, yes, you could use *ANYTHING* you want for, say a desktop app. That doesn''t apply to games, though. Speed is critical.

Share this post


Link to post
Share on other sites
What parts of a game require speed, I have programmed some games before without an API and with SDL but speed wasn''t a problem. Is it the game logic or the graphics? Is 2D or 3D a factor if it''s the graphics.

I''m looking at C# right now and if it''s fast enough I will use it for the time being. I might just look for games written in it.

Share this post


Link to post
Share on other sites
I think the parts that would require the most speed would be the program logic and how fast it can calculate your vertices to send them to your OGL/DX calls. Things like animation calculations etc. of your scene handled by your app.

Would I be correct in saying that a call to OpenGL or DirectX is a call direct to the api in any language???

Share this post


Link to post
Share on other sites
quote:
Original post by Micko
the program logic and how fast it can calculate your vertices to send them to your OGL/DX calls. Things like animation calculations etc. of your scene handled by your app.

In this day and age, no speed-critical game will calculate any significant amount of vertex data in software. That's what your video card is for.

Furthermore, most game logic in pretty much any professional game I can think of is usually handled by interpreted scripts, which run much slower than C++. I believe that Carmack was at some point considering using Java as a scripting language for Doom 3, but he abandoned the idea for some reason (good going, I strongly dislike Java ).

The moral of the story is that while you will generally want to program most of your engine in C for the speed benefits (although Axiom, a very nice and very fast 3D engine, is written in C#), it's probably a good idea to code the actual game in a more suitable language.

[edited by - twix on May 30, 2004 6:37:53 PM]

Share this post


Link to post
Share on other sites