MFC was just poorly designed, but that certainly is no fault of C++'s.
MFC was just poorly designed, but that certainly is no fault of C++'s.
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
Most games are a mixture of C and C++. Since games are always squeezing frames and cycles, using the newest fanciest OOP may not always yield what you want. Often it does make the code harder to follow and harder to use for a third party.
Most graphic engines are probably written in pure C and assembler and then classes are created to encapsulate these functions. The classes, which probably hold function pointers to each respective function in the library, are then what is exposed to the programmer who wishes to use the library. Since giving the programmer direct ability to call and/or alter engine variables would not be good practice, the interface or classes shield the nitty-gritty code from abuse and/or misuse. So the classes provide the interface and the pure C/asm functions provide the functionality. This would also allow the engine to be updated since the interface would not be so tied into the actual functions. A simple pointer change would usually be all that is needed - similar to COM/ActiveX but not exactly the same thing.
I like OOP but the C++ style seems to fall apart in several areas - but it is far better than objects/classes in VB. Personally I'm a huge fan of COM/ActiveX - I think its design is pure brilliance, even though it too suffers at times from being too complex.
Last edited by VirtualAce; 01-06-2004 at 08:38 PM.
Hey, great, good for you. Way to make sense. You can do WinAPI with C++ without MFC. MFC is just Microsoft's implementation, which is $$$$ty and confusing. There wasn't any reason for your to even bring it into the thread.Originally posted by Silvercord
you can't really compare an api and a language, but you do know that mfc is the microsoft foundation *CLASSES*, right? It's the object oriented version of winapi...and subsequently I think you're doing drugs
Not really. C is the language that Linux was made in. There are tons of programs in C for Linux. It makes more sence when writing Linux programs to use a language with tons of support. C is that. And as far as the Python. I like it because it is a scripting language and it has OOP options. So how was that the "stupidest thing" you've ever read?Originally posted by -KEN-
Quoted for being quite possibly the stupidest thing I've ever read.
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."
Perhaps this is what was being referred to....Makes sence to use the "official" language of my operating system...
Well. Let's look at some things. When the C language was created, they thought fit to recreate it with C. The operating system is made in C. I have also seen more Linux programs written in C than any other language. I would call it Linux's official language.
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."
But it's not. C++ programs work just as well. So do programs written in many other languages.
Not saying anything against C... That reasoning is just a bit suspect.
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
I agree with that, but simple OOP can really help out. If you keep things simple its mostly the same as a lot of C code, except rather than having structs and having to pass the structs to different functions to control them, you can make classes which contain their own functions. It also helps avoid errors from modifying data incorrectly.Most games are a mixture of C and C++. Since games are always squeezing frames and cycles, using the newest fanciest OOP may not always yield what you want. Often it does make the code harder to follow and harder to use for a third party.
Designing classes can require a lot of work, though, and I have to agree that complex OO design could make things difficult (ie multiple inheritance)
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
I agree with all the arguments for OOP, and in general, I much prefer C++ and solid OO design to procedural design. However, there is something to be said for the speed of C code. Procedural C is generally much faster than OO C++. Granted, there are ways to significantly speed up the object oriented designs (e.g. template metaprogramming), they are much harder to implement than the straightforward methods.
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
> Procedural C is generally much faster than OO C++.
This is usually true. But it also usually has to do more with design than the language itself. The problem with OO C++ is that people get used to the "ease" of objects and start passing the things around by value. If you're constantly invoking copy constructors and making multiple temporaries with every function call, it's going to 1) quickly fragment your heap (if your object has dynamically allocated members), and 2) destroy any chance of cache hits.
Just as there is an art to coding efficient C, there is an art to coding efficient C++. C programmers have just had longer to refine it.
There is no "official" Linux programming language. People use C because...well...lots of people use C. And there's no VB to be omgsopopular.
>>When the C language was created, they thought fit to recreate it with C
Also, what does this mean? How do you create a language with the language you're creating?
Like Zach said, your reasoning is just stretching it a bit.
Actually you're completely missing the point, ass. The point is object oriented design isn't always great, and I'd really love to see you design an object oriented system with the same functionality and have it be easy to use...you probably can't, so it's very pertinent to the topic.Hey, great, good for you. Way to make sense. You can do WinAPI with C++ without MFC. MFC is just Microsoft's implementation, which is $$$$ty and confusing. There wasn't any reason for your to even bring it into the thread.
You're right - I probably can't. But I'm sure someone could. MFC is not indicative of all object-oriented Windows programming.Originally posted by Silvercord
Actually you're completely missing the point, ass. The point is object oriented design isn't always great, and I'd really love to see you design an object oriented system with the same functionality and have it be easy to use...you probably can't, so it's very pertinent to the topic.
Anyway, see VB.NET or C# for object-oriented Windows programming that you might find easier.
Actually, it is possible to use certain things created in VB in a Linux environment.Originally posted by -KEN-
There is no "official" Linux programming language. People use C because...well...lots of people use C. And there's no VB to be omgsopopular.
Err. Thick to get through to I see. I was talking about Linux. Linux was totally rewritten when Dennis Ritchie came up with the C language. 80% of the programs I have seen, are written in C (For Linux, See the talking about Linux pattern?) You are making this a bigger deal than it is. C has tons of support from the Linux society, it has been called the most used language before. Just stop being a prick about everything.Originally posted by -KEN-
There is no "official" Linux programming language. People use C because...well...lots of people use C. And there's no VB to be omgsopopular.
>>When the C language was created, they thought fit to recreate it with C
Also, what does this mean? How do you create a language with the language you're creating?
Like Zach said, your reasoning is just stretching it a bit.
And it's Zakk.
Z A K K
Spell it right for once.
"When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."