Game Design Music and Art

C++ – Goldrush13

Goldrush13

Member

Posts: 107
From:
Registered: 02-27-2005
Hi I'm new here and like to start by saying how great it is to have a christian coding website, I had no idea this would be a christian website but I checked it out and it seems I was wrong.

Anyway I've done VB and Pascal and I'm taking kind of a break by using these simple game creation languages like DarkBasic and BlitzBasic, they're quite fun and surprisingly powerful but soon it will come the time for me to learn the more powerful languages so I can actually become a programmer, C++ seems logical and I'm ready for it now but someone at college suggested Java, then C++, I DO intend to do both but starting with C++, should I do Java, I was told basically that C++ is a step-down from Java so I suppose it makes sense, I'm afraid i'm not really a games programmer, I prefer to make practical applications although I think I'll make a game on one of those specialised Basic programs I mentioned above just to say I can do it really.

So do you think I should start with Java, I have everything for C++ but my only compiler for Java is Visual J++ v6 which someone told me did not have Java's ability to be used multi-platform, I kind of feel this defeats the purpose but I'd appreciate some advice, I don't want to make this decision based on what I would like to do, I just want to learn both in the best order.

[This message has been edited by Goldrush13 (edited February 27, 2005).]

crazyishone

Member

Posts: 1685
From:
Registered: 08-25-2004
i am a noob to programming also, but i've always been told that for game programming, C++ is the creme of the crop. even commercial game developers like THQ and stuff use C++ all the time. it is the standard.

------------------
It is better to be silent and be thought a fool than to open your mouth and remove all doubt. - Abe Lincoln

Goldrush13

Member

Posts: 107
From:
Registered: 02-27-2005
Um thanks crazyishone for your input, I know the industry standard for computer games quite well, in case I didn't make myself clear I will try again, I would hate to waste peoples time.

I have been programming for a while now, done a few languages, I DON'T want to make a game, I am doing an HNC in computing, after that I will go onto an HND and by then hope to have a good understanding of C++ and maybe Java as well, both, I am not a gamer, but if I have to I will make a game but the main question is, "Should I learn Java as a stepping stone to C++, or C++ as a stepping stone to Java"

I hope this is clearer, thank you.

Briant

Member

Posts: 742
From: Stony Plain, Alberta, Canada
Registered: 01-20-2001
Hi Goldrush13, and welcome to the board!

Maybe it depends on where you see your apps being run: if in a browser, head for Java. If on the desktop, head for C++. Of course each can be used both places, though.

Java was developed after C++, and uses much of the concepts and syntax. So maybe you'll want to follow the same path: C++ first. I don't think C++ is a "step down" from Java, except in terms of allowing you to get closer to the hardware. Depending on your style, this "step down" may be a benefit (it is for me).

For my peers and I, we learned C++ first, and then some went on to learn Java. But this is perhaps because of our age.

Brian

------------------
Brian

HeardTheWord

Member

Posts: 224
From: Des Moines, IA
Registered: 08-16-2004
Well, since you have experience in VB and Pascal, C++ might be the route to take.

I am not saying Java isn't a good choice, but C++ follows a more structured approach to object oriented programming (OOP). After you get used to OOP then you can take a look at Java and decide which you like better.

[This message has been edited by HeardTheWord (edited February 27, 2005).]

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
C++ is the standard, but Java isn't bad. I'd personally say start with Java, but that's my opinion.

quote:
I am not saying Java isn't a good choice, but C++ follows a more structured approach to object oriented programming (OOP).

Please explain to me how C++, which has OOP tacked on, "follows a more structured approach to object oriented programming (OOP)" than Java, which is designed from the ground up as an OOP language? I'm sorry, I disagree.

You can get the Java Development Kit from Sun Microsystems for free, by the way. You can also get the NetBeans IDE.

------------------
"The very idea of freedom presupposes some objective moral law which overarches rulers and ruled alike." -- C. S. Lewis (1898 - 1963), "The Poison of Subjectivism" (from Christian Reflections; p. 108)

Switch Mayhem now available! Get it here
Codename: Roler - hoping to get more done over the holidays . . .

[This message has been edited by CobraA1 (edited February 28, 2005).]

Goldrush13

Member

Posts: 107
From:
Registered: 02-27-2005
Thanks for your help, I did want to do C++ first, not really interested in Java at the moment but need it for good job prospects.
HeardTheWord

Member

Posts: 224
From: Des Moines, IA
Registered: 08-16-2004
quote:
Originally posted by CobraA1:
Please explain to me how C++, which has OOP tacked on, "follows a more structured approach to object oriented programming (OOP)" than Java, which is designed from the ground up as an OOP language? I'm sorry, I disagree.

I believe I used the wrong word. C is a procedural programming language.

Everything in Java is formed in classes so it is considered a pure OOP language (and for other reasons). C++, on the other hand, is really a loosely based procedural language with some OOP thrown in, like you stated. Sorry for the confusion.

[This message has been edited by HeardTheWord (edited February 28, 2005).]

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Howdy!

I've been programming in C for about 16 years now, and only now am I really starting to learn hardcore OOP (Object Oriented Programming).

From my experience, C++ does not do OOP very well. It's a hack. C++ is too wierd with its multiple-inheritance, it's crazy and repetitive syntax (you still need header files), and it's starting to phase out.

I've started appreciated working in managed languages (like Java, Python, VB.NET, and C#). It's more "pure" object-oriented, and you will get much better programming habits from working in a language like Java or C# than if you start out in C++ (where it's sometimes difficult to program in pure object-oriented structure).

My reco? Start in a language like C# or Java. If you're looking to move to C++ later, then I would recommend C# as it's slightly more c'ish in structure (though Java and C# are *very* similar). They fixed a lot of the things they did wrong with C++ in C#.

I haven't spent a dime on C# compilers, the one I use is currently SharpDevelop ( http://www.icsharpcode.com/ ). Open-source IDE that you can develop even commercial applications with -- no strings attached.

That's my $0.02, I hope you find it helpful.

Respectfully,
clint

------------------
http://www.includingjudas.com/christiangame.html

Goldrush13

Member

Posts: 107
From:
Registered: 02-27-2005
C# never entered my mind, I kinda figured it was a more powerful and therefore more complicated version of C++, I'll take a look at that compiler and peruse some sample code for the basic jist of the structure of C# though, I really like this more C'ish aspect to the language that you described.

It'd be great if someone could back this up please.

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
*shrug* It's kindof more powerful, but it's also simpler in a lot of ways.

Much like Java, *everything* is in a class (whereas with C++, you can write an application that never touches classes, just like C).

"Hello World" in C# looks like this:


using System;

public class HelloWorldApp
{
public static void Main(string[] args)
{
System.Console.WriteLine("Hello World!");
}
}

The heart of C# is the extensive class library -- everything is organized in C# beautifully. Everything regarding graphics and drawing is in System.Drawing namespace. Everything regarding Windows forms and controls is in System.Windows.Forms namespace.

I hope I'm not confusing you too much, but suffice it to say that C# is *much* better organized than C++, and still maintains a lot of the C'ish syntax. Also, with the progression of things like DotGNU and Mono, C# is not a Microsoft-only beast.

I'd be happy to talk with you more about this subject!

Respectfully,
clint

------------------
http://www.includingjudas.com/christiangame.html

Goldrush13

Member

Posts: 107
From:
Registered: 02-27-2005
I feel C++ is still required though, now going from organised C# to disorganised C++ could essentially have a bad effect if you see what I mean, with the code you pasted I feel I'm looking at a kind of a Java C++ hybrid, if I got C++ then Java, C# would seem to fall into place much more easily.

Starting with C++ would give me the multitude of powerful commands, then an understanding of Java next would help me identify the probable structure of C# and finish with an easy C# lesson if you follow.

It's great to see what "Hello World" looks like on C#, whereas I understand a few of the C++ elements in it the rest of it must be Java which I haven't touched on.

The approach I originally decided of C++, Java then C# is chronological by the looks of it, (1985 for C++ can't remember Java but it must have been later) learning this way would be probably the way of many other programmers of the past no doubt.

Out of all of these C++ appears to be the "monster" if you will, guaranteed I can put in the work for it now, and maybe take it a little easier with Java and C# in future.

C++ isn't gonna run out of steam for a while I think, and I reckon C++ is a guaranteed job as well, after all in the end this isn't a hobby, I want to be a programmer and C++ is still pretty much the standard.

I suppose I'd feel safe with C++ first if anything, C++, Java then C# is still what I'm feeling at the moment and I reckon each step is beneficial to the next.

Thanks for the info on C# HanClinto, it was certainly an eye opener.

Can anyone change my mind maybe?

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Howdy!

Another thing you might want to look at is the relative demand -- meaning your marketability.

For perspective, COBOL isn't exactly a dead language yet either, and there is still a need for people who can read/write/patch it (though it's certainly dwindling, and has been for at least a decade).

For instance, check out Planet Source Code, where they have job postings for various languages.

Here's the current stats, as of 10:50 EST:
Visual Basic: 415 jobs
Java / Javascript: 203 jobs
C / C++: 207 jobs
ASP / VBScript: 181 jobs
SQL: 233 jobs
Perl: 61 jobs
Delphi: 31 jobs
PHP: 76 jobs
Cold Fusion: 35 jobs
.Net: 982 jobs
LISP: 21 jobs

I'm not making those numbers up, check them out yourself at http://www.pscode.com/ . .NET includes VB.NET, ASP.NET, J#, C# and Managed C++.NET as well, so don't think all 982 are for C#. However, that's just to show you how much this platform is on the rise and being a .NET developer can make you quite marketable currently.

I've heard it said that ADA is a great language to learn when studying to be a programmer, because it teaches you a lot about how computers work, and forces you to use several good programming habits (such as strict type casting -- I.E. you can't treat a boolean as an integer without specifically casting it as such).

C++ is very powerful, but it's also *very* dangerous. One of my last jobs was cleaning up C code after a guy (who was a "code ninja" to use his own wording) who used tons of powerful features that are supported in C and C++. Do you know how hard that code was to read? He optimized the heck out of his code, but the problem was that he did it before it was bug-free, so I had to fix bugs and add features to code that was incredibly hard to read. Sure, C++ has pointers, but when you've got triply nested pointers in arrays that are passing back and forth, it just makes you want to scream! How about some organized code? How about some intelligence in design?

Unless you're seeking to do coding on embedded processors (like DSP's) to do real-time audio/video processing (where optimization is king, and you're right, everything is still in C/C++/assembler), then you need to know how to optimize the heck out of your pointer math, do register shifts, in-line assembler, etc.

However, what companies need is *maintainable* code. The time-consuming process of programming is not throwing the code on the screen, it's fixing it once you have it up there. Adding in features later that weren't originally planned for. Fixing bugs that only pop up once every 17 and a half hours (that was a real one we had to find, turns out it was in an assembly file that was only called every so often, and the bug only happened when a certain value rolled over at it's max value).

C# is still really powerful, and it's still used for applications where power is needed (embedded processors and such). But for database applications? For normal user applications? Even standard processing utilities? Web applications? What people need is *maintainable*, *modifiable* code. That's one difference between a good programmer and a great programmer. A good programmer can write code that runs so fast it makes your eyes bleed, but a great programmer writes clean code, good comments, understandable and clever solutions, but most importantly, when the code is picked up 5 years down the road because they need it expanded, the code is able to be changed by "the next guy".

That's why I believe managed code is such a great tool, because so much optimized C and C++ code takes 10 times longer to fix than it should because it's too confusing (or worse yet, they throw it out and re-program it in something else as a hack-job).

Sorry for the long dissertation.

I just want you to know that C++ is still a valuable language (and I work to do today in it actually), and if you want to learn it, I say "go for it!". Do it well, but *please* don't get yourself into silly habits like preprocessor macros, insane pointer math, crazy tertiary usage, and other such nasties that make the "next guy" want to pull his hair out.

I want you to be informed in the direction that everyone is going, and in the application market, C++ is being dropped in favor of cleaner languages.

Take care friend, I know whichever path you take, it can work out fabulously for you.

In Christ,
clint

------------------
http://www.includingjudas.com/christiangame.html

[This message has been edited by HanClinto (edited March 01, 2005).]

Goldrush13

Member

Posts: 107
From:
Registered: 02-27-2005
Over here in Britain, on a lot of job sites, C++ is dominating, I know C++ will drop, but for now it's not going anywhere, being a young coder, programmer etiquette is not my speciality, bad indentation, interesting instead of productive, the usual, I've only ever heard of ADA, but I like the sound of it enforcing good habits, I'll a look.

Looking at all those jobs, there's work for almost every coder imaginable, even the language I fear the most, Delphi.

415 VB Jobs! Why I don't know but I know most of the ins and outs of VB already, gives me a renewed confidence.

Thanks again clint.

CodingForChristX0r

Junior Member

Posts: 2
From: Boston, MA, USA
Registered: 04-05-2005
C++ is the standard in the video games industry. If you are interested in writing games, go with C++.

C# is Windows only. If you ever want to code for a console other than the X-Box, you will need to learn a cross-platform language.

I recommend learning picking up the "Effective" books by Scott Meyer. (Effective C++, Effective STL, etc.) Great stuff.

Goldrush13

Member

Posts: 107
From:
Registered: 02-27-2005
Thanks, I've kind of made my decision now. (although I may change my mind)
As I never actually intend to take on games programming, platforms don't bother me, I know the ins and outs of all the specific platforms required by the languages and have pretty much come to the conclusion that as long as the platform exists, I'll do it, which pretty much means any language I guess.

I'm going to go with Java first, I was told by a friend that there are two ways to learn Java, the Java way and the C++ way (not 100% sure about what he was on about), if I learn the C++ way naturally this will make learning C++ easier, so my mind's on Java at the moment, a recent flood of college work has put all of this on hold though.

Does "the Java way and the C++ way" thing mean anything to anyone here?