xboxscene.org forums

Pages: [1] 2

Author Topic: C Or C++  (Read 129 times)

fragmaster170

  • Archived User
  • Newbie
  • *
  • Posts: 16
C Or C++
« on: December 30, 2003, 09:48:00 AM »

if you want a simple language designed to be easy yet teach you C, try BCX, its free and about as easy as they get, otherwise, personally, I would go with delphi as a beginner, useful language.

http://www.rjpcomput...rogramming/bcx/
Logged

LinksAwakening

  • Archived User
  • Sr. Member
  • *
  • Posts: 499
C Or C++
« Reply #1 on: December 30, 2003, 11:20:00 AM »

HERE is an old post on the same topic, with lots of helpful info...
Logged

Sobus

  • Archived User
  • Newbie
  • *
  • Posts: 1
C Or C++
« Reply #2 on: January 06, 2004, 09:38:00 PM »

Im in for it man, Learn C++  When the Xbox 2 comes out, you will have programming experience and then you will be better at prgramming and if they use a different language its not hard to pic it up since you already got the Theory and stuff behind it. I am currantly in school learning Many languages and C++ is one im in right now along with Unix. I have already done C and its easy and doesnt have as much that you can do ( more errors too)
Logged

antiflag1980

  • Archived User
  • Sr. Member
  • *
  • Posts: 257
C Or C++
« Reply #3 on: January 08, 2004, 01:58:00 AM »

C doesn't have errors?  Bad programmers have errors.  C++ isn't as flexible and as matured as C, thats why they still use C for many games still.  Look at all your games code like quake and wolfenstein and most games are still programmed all in C no C++ at all.
Logged

delphaeus

  • Archived User
  • Newbie
  • *
  • Posts: 20
C Or C++
« Reply #4 on: January 08, 2004, 04:17:00 AM »

I'm surprised nobody has pointed out this basic fact:

DIRECTX 8 IS WRITTEN IN C++, AND YOU CANNOT USE IT WITHOUT USING C++.

(Granted, a rather limited use of C++, since it doesn't take advantage of templates, but oh well.)

Since DirectX is your one, and only, interface to the screen, your choices are quite limited on the Xbox.  It's C++ or nothing.  You don't have a choice.

That said:

antiflag, you're either helplessly retarded or you've never actually looked into what C++ can do.  There's three advantages to using C++ over C:

1) Inheritance-based polymorphism.  C++ removes the work of manually implementing vtables in a C struct.  You can define all the code for, say, an object in a physics engine, and then say that all 3d objects are merely physics-engine-objects but with extra data describing what they look like.

2) Templates.  In C++ you can create true polymorphic code which adapts itself to the data type.  For example, you don't have to create a new link for every type of data you want to store in a linked list.  You instead define a generic linked list called list<T>, and then you can use list<int>, list<char *>, or even list<list<unsigned long>>.  It generates all the code for you for each type, and you can make it do the same for your own code too.  You can do the same thing with other data structures -- arrays (vector<T>), deques, trees, hashes, etc.  And the really slick part is that all of those data structures can be read through in the same way -- using the iterator objects you can go from beginning to end the same way whether it's a linked list or an array.  And the compiler will optimize it all into just pointers anyways.

3) Overloading.  In C, a function can have one meaning, and one meaning only.  A function can't accept "either an int or a string" unless you make it take a union and a flag representing which of the union members is used.  In C++, a function can be overloaded by its types, so you can have a single function that properly handles different cases based on what you feed it.  For example, you can make a printf() that will actually output the contents of a variable based on its type, instead of just passing a % in a string and making sure it matches up to the right variable -- in fact, that's exactly what cout and << do.

And by the way, every version of the Unreal engine was written in C++, as was Quake 3, as is HL2.  In fact, games are even driving innovation in C++ now -- Game Developer Magazine ran an article two issues ago about using some tricks with templates and reverse inheritance to make an extremely flexible vertex format that could store anything from raw mesh coordinates to arbitrary pixel shader data.  About the only time anyone uses C in games now is when you're interfacing with hand-coded assembly -- and in the days of 3GHz processors, it just doesn't happen anymore.  The last major game to have any hand-coded assembler was Quake 2, and that was only in its software rasterizer -- the game logic and the core engine was all C++.  Funny that all the games you quote as using C are coming on a decade old now -- not a good reference point for Xbox coding, I think.

And "not matured" ?  The core language has been an international standard (ISO/IEC/INCITS 14882) for five years now, and there's no end of libraries available for it to address its shortcomings (most notably, Boost).  Both Visual C++ and gcc implement the standard closely, and there are even a couple of compilers which have managed to implement it to the letter.

In other words, you have no fucking clue what you're talking about, and I suggest you shut your fucking trap instead of giving people advice you can't back up with facts.  There is nothing C++ can do that C can't... but it can let you finish it and move on to the next feature with a lot less typing.

Oh, and just FYI, you'll need to use VS.NET -- only the earliest versions of the XDK supported VS6,
Logged

SHiZNO

  • Archived User
  • Sr. Member
  • *
  • Posts: 287
C Or C++
« Reply #5 on: January 08, 2004, 02:15:00 PM »

C or C++ first? "No, learn C++ first. The C subset of C++ is easier to learn for C/C++ novices and easier to use than C itself." - Stroustrup, D&E, p 169
Logged

SHiZNO

  • Archived User
  • Sr. Member
  • *
  • Posts: 287
C Or C++
« Reply #6 on: January 08, 2004, 02:18:00 PM »

delphaeus nice burn btw

lol "go look at wolfenstein"
Logged

The Pen is mightier

  • Archived User
  • Full Member
  • *
  • Posts: 158
C Or C++
« Reply #7 on: January 08, 2004, 05:04:00 PM »

oh man I remember I took a whole course of C++, and the final thing we had to do was create a blackjack text game. We didn't do any object orientation at all... I took another class where we DID do a bit of object orientation with a language called "prograph". lol, I have a REALLY long way to go...
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
C Or C++
« Reply #8 on: December 11, 2003, 12:57:00 PM »

C is a subset of C++ (or rather, C++ is a superset of C)

C++ will make using DirectX MUCH easier, since it's based on COM/OLE. Interfaces are basically virtual class definitions, and work much easier in a C++ environment.
Logged

MagamiAKO

  • Archived User
  • Newbie
  • *
  • Posts: 35
C Or C++
« Reply #9 on: December 11, 2003, 12:57:00 PM »

Start with the infamous Hello World smile.gif
Logged

joseph_hac

  • Archived User
  • Sr. Member
  • *
  • Posts: 415
C Or C++
« Reply #10 on: December 11, 2003, 01:16:00 PM »

I would go with C++. Visual Basic is so easy, you can probably use it right now. One thing, if you jump into C++, make sure you stick to managed code. Unmanaged code is on its way out!
Logged

joseph_hac

  • Archived User
  • Sr. Member
  • *
  • Posts: 415
C Or C++
« Reply #11 on: December 11, 2003, 04:43:00 PM »

QUOTE (Xcool @ Dec 12 2003, 01:11 AM)
is C++ for dumies a good book to get me into C++ or do u guys know a better book
and is C# any good

I would go with something like Sam's Teach yourself C++ in 21 Days. It isn't saturated with corney humor like the dummy guides, and it is possible to get through the book in 21 days (or so they say).

As far as C# goes, it all depends on the application your writing. For a first language, I would stick to C++ becasue C# is pretty much a combo of C++ and java (although some may argue).

If your really new to programming, you might want to acquire Object-Oriented Turing. It is a language specifically written to be a teaching aid. Most secondary schools teach OOT.
Logged

Icelight

  • Archived User
  • Newbie
  • *
  • Posts: 21
C Or C++
« Reply #12 on: December 11, 2003, 08:15:00 PM »

QUOTE
also i'm a begainer i have never programed before in my whole life


So you have never programmed in you life, and you want to:

QUOTE
learn to program in directX and OpenGL then get into Xbox programing


Listen, not to discourage you or anything, but by the time you learn how to even remotely program GUI's through C++, nevermind use DirectX/OpenGL Xbox 2 will be nearing the end of it's life cycle.

Programming isn't as easy as you think. Sure, the basic are simple, variables, references, classes, functions, looping and if structures...but after that, when you get into real Data manipulation and screen manipulation it gets very complex. As I said before, I don't want to discourage you, please don't think I'm trying to say you shouldn't do this, as I'm all for it!

Just don't expect to be programming a homebrew Xbox game within the next couple of years...(unless you don't have school/university/job/life and you can sit at home all day, doing nothing but programming and the most basic of human needs)
Logged

Wishi

  • Archived User
  • Full Member
  • *
  • Posts: 191
C Or C++
« Reply #13 on: December 12, 2003, 02:13:00 AM »

QUOTE
Listen, not to discourage you or anything, but by the time you learn how to even remotely program GUI's through C++, nevermind use DirectX/OpenGL Xbox 2 will be nearing the end of it's life cycle.


Err, no offense but not everyone has your slow rate of learning. It's all dependant on how much time he puts into it and how fast he can pick up concepts etc.

Anyway, to help Xcool in some way, I'll point you to the tutorial I point people to in the chat when they want to learn C++. I haven't used it but from the table of contents it looks pretty comprehensive and seems to start at the beginning. Just go through it slowly and practice, I should say that again practice.

http://cplus.about.c.../blcplustut.htm
Logged

Wishi

  • Archived User
  • Full Member
  • *
  • Posts: 191
C Or C++
« Reply #14 on: December 12, 2003, 02:26:00 AM »

C++ is the language.
Visual C++ is just an IDE (integrated development environment) made by MS, ie. a program which you can code in and compile your apps etc.
Logged
Pages: [1] 2