Jump to content

  • Log In with Google      Sign In   
  • Create Account

Is C a wasted/useless language?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 romer   Members   -  Reputation: 323

Like
Likes
Like

Posted 28 January 2002 - 10:31 AM

Is C really all that important now that there''s C++? The only programming experience I have is the past 4-5 months of programming C++ in my computer science class, but we''ve just gotten to structs and classes after covering arrays and file streams. The reason I ask is because today someone said that C is a waste of a language and that it is useless today, that we could do everything with classes and all game programming is done in C++. I''ve read in different places that game programmers usually write C-style code, as in, a more procedural style than an object-oriented, and that a procedural way of programming is faster than object oriented due to overhead (not too sure on that though). Is this also true? I''ve always wanted to be a game programmer and now that I''ve started taking the computer science class at my high school, I''m starting to like more and more programming (despite the fact we''re only doing dos programming with Turbo c++, but I guess we all gotta start somewhere). In my spare time I''ve started reading Tips of the Windows Game Programming Gurus, and although I''ve pretty much grasped some of the concepts up through chapter 5, I decided to buy The C Programming Language to help fill in some holes my computer science class doesnt cover (pointers/memory addressing, learning to use character arrays instead of AP class libraries). For all those who are light years ahead of me, do I seem to be heading the right way? I planned on learninng to program well in a procedural style rather than object-oriented, and use object-oriented when I felt time comes. Is there any words of advice you guys have? I''m sorry for the long post, I''ve just been confused about the whole thing. One last question I have may seem trivial, but is DirectX based upon and use classes? I opened up a couple of the header files in notepad, ran a find on the word class but couldn''t find anything except for maybe something in the comments that were included or in the middle of a variable name. Well thanks for reading my post, and thanks for any input that you all might have. Mike

Sponsor:

#2 Oluseyi   Staff Emeritus   -  Reputation: 1678

Like
Likes
Like

Posted 28 January 2002 - 10:43 AM

Never listen to people who say "such-and-such is wasted/useless/whatever". They tend not to know what they''re talking about. As at now, C is still an extremely valuable language, plus it won''t totally die until C++ is also dead, since C++ is a superset of C.

C is alive and kickin; how do you think we do (most) systems/embedded development?

As for DirectX, it''s a COM (Component Object Model) implementation. It''s a sort of class-based implementation, but in a more complex and more powerful (and OS-specific) sort of way. Don''t worry about how it''s implemented for now (COM gives a lot of people headaches, and some are reluctant to use DirectX for that reason), just worry about using it.

Welcome, and good luck!

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!


#3 DigitalDelusion   Members   -  Reputation: 874

Like
Likes
Like

Posted 28 January 2002 - 12:05 PM

C++ is no longer a superset of the offical C standard (C99)
but it''s quite near, and well if you see it like this the C-Standard commitee are still alive and kicking, the new C++ stanrdad C++x00 i think it''s called is just around the corner trying to among other things keep up with C.

C won''t die, it''s a killer language it will prevail!

that said I love C++ but really they both have their pros and cons

#4 DigitalDelusion   Members   -  Reputation: 874

Like
Likes
Like

Posted 28 January 2002 - 12:08 PM

DX is C based, so you won''t find anything that is C++:ish in those headers.

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 28 January 2002 - 12:13 PM

Well if we''re speaking in the broad term of programming C is definately not a wasted language, especially when dealing with embedded devices and doing lower level programming (if you dont want to specifically deal with asm). In terms of game programming i''m sure it still is used widely for commercial projects because OO style can still be implemented, however C++ is probably the widest used at this moment...
well thats my 2 cents.



#6 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 28 January 2002 - 12:16 PM

quote:
Original post by DigitalDelusion
... the new C++ standard C++x00 ...


It's actually C++0x; you were close . I so hope that they include threading and some other higher level things in the new standard (like they said they might). As long as they're deviating from the C-roots of 'runs on everything' to 'runs on almost everything' they might as well make my job (actually: hobby ) easier.
[EDIT: Quote tag got broken, needed to fix it ]


Edited by - Null and Void on January 28, 2002 7:19:08 PM

#7 Pactuul   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 January 2002 - 12:25 PM

if you learn c++ you pretty much know regular C. C is constantly used in emedded systems (aka low level engineering to control circuit boards and the like) Also I mainly use C++ for game development, because of the object oriented-ness of it. It helps me to think in more abstract and general terms so I can produce a better quality (gameplay) than others who use procedural. But then I also use C in developing libraries that are cross platform because a lot (and I mean a lot ) of people and companies still use C as their primary system.

But I''m confident that it will be come more clear to you as you learn more concepts and more programming. I sense your biggest fear is learning something that will waste your time: your not.

C is the best language (and C++) to base your computer science background on. After learning C(++) you''ll be able to learn any other language that comes and goes.



-Pac
"The thing I like about friends in my classes is that they can''t access my private members directly."
"When listening to some one tell about their problem (whether it''s code or not), don''t listen to what went right or wrong, but what they assumed....."

#8 matrix2113   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 January 2002 - 01:02 PM

I really don''t see the point to keeping C.
C++ is like an upgrade of C (such a huge upgrade, that it has a new name)
If you don''t want to use classes and oop, then you can just write C code in C++, its exactly the same. Its like keeping VC++ v1.0 around when theres VC++ v6.0!
Sometimes, its useful to keep old versions around, but only when the updates exclude old features (such is the case in Direct X 8)
As for the functions, all the old C functions are also in C++, so if your accustomed to those, then you shouldn''t have a problem.

"I''ve learned something today: It doesn''t matter if you''re white, or if you''re black...the only color that REALLY matters is green"
-Peter Griffin

#9 Oluseyi   Staff Emeritus   -  Reputation: 1678

Like
Likes
Like

Posted 28 January 2002 - 01:06 PM

quote:
Original post by matrix2113
I really don''t see the point to keeping C.
C++ is like an upgrade of C (such a huge upgrade, that it has a new name)
If you don''t want to use classes and oop, then you can just write C code in C++, its exactly the same. Its like keeping VC++ v1.0 around when theres VC++ v6.0!

Sorry, no cookie. C and C++ are different languages, as you''ll quickly learn if you try to compile certain legal C code in C++, and vice versa. They may have started out with C++ as a strict superset of C, but that''s changed as both languages evolved differently.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!


#10 romer   Members   -  Reputation: 323

Like
Likes
Like

Posted 28 January 2002 - 01:19 PM

Wow, thanks for all the input. You all have really shed some light on areas I had litte/no knowledge about . I can tell that there''s a wealth of knowledge to be found here. Thanks again for answering my questions.

Mike

#11 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 28 January 2002 - 01:34 PM

Given the chance, I can''t not post my favorite peice of C that isn''t valid C++ (a little code never hurt anyone). Commonly known as the struct hack, it part of the C99 standard but not in any C++ standards. C++ has different ways of doing almost the same thing (some would argue better ways), but still...
  
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
unsigned char len;
char str[];
} byte_string;

byte_string *null_to_byte(char *as) {
unsigned int len = strlen(as);
byte_string *bs;

bs = (byte_string *) malloc(sizeof(byte_string) + (len * sizeof(char)));
bs->len = len;
memcpy(bs->str,as,len);

return bs;
}

int main(void) {
byte_string *bs;

bs = null_to_byte("Testing");
free(bs);

return 0;
}




#12 CaptainJester   Members   -  Reputation: 523

Like
Likes
Like

Posted 29 January 2002 - 02:12 AM

quote:
Original post by DigitalDelusion
DX is C based, so you won''t find anything that is C++:ish in those headers.


Uhh no. It may have been originally, but it is now more C++ than C.

---
Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home

#13 jonnyfish   Members   -  Reputation: 265

Like
Likes
Like

Posted 29 January 2002 - 07:56 AM

quote:
Original post by CaptainJester
Uhh no. It may have been originally, but it is now more C++ than C.



Try not to confuse COM with C++. COM can be done just as easily in Visual Basic as in C and even C++. Does that make DirectX more VB than C++?

#14 merlin9x9   Members   -  Reputation: 174

Like
Likes
Like

Posted 29 January 2002 - 08:09 AM

C certainly won''t die in that it seems to be a model for plenty of other languages (Java, C#, Python, etc.). Beyond that, everything that''s possible in C++ is possible in C. Harder, maybe, but completely possible. And that includes the Object-Oriented paradigm. Anytime you kids do anything procedural in C++, you''re using C. Anytime you enjoy the low-level nature of C++, you''re enjoying an intrinsic property of C. Furthermore, no single language is the best for all things, so C or whatever other language will always have a place (there are times when C++ is simply overkill; its facilities just add overhead with no extra reliability or any of the other things promised).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS