the language of the gods - C++

This is a discussion on the language of the gods - C++ within the A Brief History of Cprogramming.com forums, part of the Community Boards category; MFC was just poorly designed, but that certainly is no fault of C++'s....

  1. #16
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    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.

  2. #17
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    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.

  3. #18
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    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
    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.

  4. #19
    ___
    Join Date
    Jun 2003
    Posts
    806
    Originally posted by -KEN-
    Quoted for being quite possibly the stupidest thing I've ever read.
    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?
    "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."

  5. #20
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    ...Makes sence to use the "official" language of my operating system...
    Perhaps this is what was being referred to.

  6. #21
    ___
    Join Date
    Jun 2003
    Posts
    806
    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."

  7. #22
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    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.

  8. #23
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    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.
    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.

    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

  9. #24
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    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.

  10. #25
    Registered User
    Join Date
    May 2003
    Posts
    161
    > 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.

  11. #26
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    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.

  12. #27
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    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.
    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.

  13. #28
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    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.
    You're right - I probably can't. But I'm sure someone could. MFC is not indicative of all object-oriented Windows programming.

    Anyway, see VB.NET or C# for object-oriented Windows programming that you might find easier.

  14. #29
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    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.
    Actually, it is possible to use certain things created in VB in a Linux environment.

  15. #30
    ___
    Join Date
    Jun 2003
    Posts
    806
    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.
    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.


    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."

Page 2 of 3 FirstFirst 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What language did they make Java in?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 07-03-2005, 05:18 PM
  2. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 02:40 PM
  3. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 02:11 PM
  4. Language of choice after C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 47
    Last Post: 06-15-2004, 02:20 AM
  5. Languages dying
    By Zewu in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 07-29-2003, 11:08 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21