Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Sort of something about C versus C++


saadhamza
 Share

Recommended Posts

Alright so i know a few peopel here reccomend C over C++, and i've personally found it a bit easier to cope with C, but i came across this video.

http://www.youtube.com/watch?v=KlPC3O1DVcg

Would someone that knows more about programming then i do possibly explain to me whether he's right or not? Or whether his points make a difference in your opinion about C over C++. I've heard a lot of people bring up that C++ is the gaming standard, so i'm a bit split now.
Link to comment
Share on other sites

All I'm saying is C++ is a lot of fun and easy to learn if you can stand the mono-tone voice of this guy's tuts: http://www.youtube.com/watch?v=tyVhn0FWWB4&feature=relmfu

He is very thorough and goes in depth on just about everything, definitely an excellent teacher.

Other than that, I can't really tell you whether to choose C or C++ because I never really looked into C :P
Link to comment
Share on other sites

Of course the person who designed C++ will think C++ is better than C, otherwise he wouldn't have made C++.

Everything he describes though is what I detest the whole C++ language for. Object-oriented programming, for instance, doesn't solve any of my problems and it never did. Instead it overcomplicates what I am programming. I have to think of everything as an object, apparently, whilst this is often not applicable. Object-oriented programming causes what I tend to call over- or hyperabstraction. Almost all libraries are abstract by nature, because libraries are abstractions for several functionalities the operating system provides. Almost all of those libraries have been written without an object-oriented design in mind. Therefore using object-oriented programming would add useless overhead to almost all of those libraries, just like cross-platform libraries do. The sole difference being, cross-platform libraries are actually useful, they actually do serve a purpose unlike object-oriented programming.

C serves plenty of features, including object-oriented programming the way it should be done: through structures and functions operating on those structures (because that's what C++ does as well, in the end. It just hides it from you, just like everything you ought to know about the bloody language).

C also proves that inheritance shouldn't be used, unless you have a good reason to use inheritance (and there are only a few). An extending class that inherits a base class is the same as a structure that represents the prior that starts out with the structure representing the latter, with additional data. Now all you need is typecasting, which C does support. To prove my point even more: the diamond problem, which Java avoids by enforcing single parent inheritance, doesn't exist in C, because of the nature of how one should implement classes in C.

Start dealing with real issues like data-aware programming, data-oriented programming and vector-oriented programming (too bad we lack common programming languages for the latter). Which are all beneficial, again, unlike object-oriented programming, and please don't get me started on the entire subject of the useless object-oriented design patterns that are being used by several people.

Yours faithfully,
  Stephan.
Link to comment
Share on other sites

I am going to say something that actually isn't Stephan's C propaganda (to those that consider it propaganda).

I have been using C# recently (a few months). I really liked it in the beginning; it was simple, straight-forward, and easy to work with. Once I wanted to begin working with global variables, things got ugly. I realized that a global variable in an OOP language is never global, but always part of something else. Right off the bat, this immensely complicates things. I actually loathe classes now. I tried my best at organizing my OOP code to fit in with everything. I couldn't do it. Everything that is build using an OOP language should have such a consistent base and format or else nothing will interconnect with one another. After much grief over trying to make C# work for me, I gave up and went immediately to the only language I knew that contained **zero classes: C**.

After studying C for some time, I began to really enjoy its simplicity. Like VB6's simplicity of grouping similar variables together with the use of structs, C does the very same.

tl;dr: C is honestly less complex and easier to work with than any other computer programming language I've come into contact with. Having Stephan only reinforce my theories and ideas of C and how good it actually is makes me feel that much more secure and confident using it.
Link to comment
Share on other sites

I suggest going to C and then later going to C++. As much as I hate classes and OOP, most game development libraries and forums assume OOP. But again, go to C first. Once you learn how to do basic functions in C and learn about how to use vectors, pointers, etc then you should switch to C++ if you want to do game development.

I know I'm going to get bashed on this by Stephan and everyone else, but I have found it to be a lot easier using libraries and getting support when using OOP. It's assumed almost everywhere for some reason.

In support of C though, it does make your life a lot easier and OOP should be avoided in as many instances as practically possible. If C was more widely used then I would use it, but trying to find non-OOP source code gets extremely frustrating.
Link to comment
Share on other sites

I've been put in charge of a support forum for the NHS. It's programmed in ASP.NET and C#. Half of it is closed source compiled binaries made in C#.

I have come to detest this language. The entire thing is overly abstract, the conflicting styles of various developers clash horribly and _everything_ is shoe-horned in to an OO paradigm.

I've also been doing my usual thing of creating small desktop applications to handle tasks which can be automated. C# is the _de facto_ language in the company so I need to use that. My God does it overly complicate the most basic things.

Oh well. As much as I love arguing on the internet, at the end of the day you learn what the most marketable skills. Honestly if you want a job for life you learn some of the most archaic languages you can. If no one else knows how to work your system you're never going to get replaced.

I'll probably pick up this language eventually. It's very popular in Health Care and Finance over here. There are so few people who know how to use it that I'd never be without work. [http://en.wikipedia.org/wiki/MUMPS](http://en.wikipedia.org/wiki/MUMPS)
Link to comment
Share on other sites

@S.J.R.:

> I am actually questioning myself why you are looking for code, and why you seem to lack the ability to rewrite the object-oriented code as purely imperative code.
>
> Yours faithfully,
>   Stephan.

Pretty easy answer that we both know. ;]
Link to comment
Share on other sites

@S.J.R.:

> I am actually questioning myself why you are looking for code, and why you seem to lack the ability to rewrite the object-oriented code as purely imperative code.

I'm learning. I copy code and study it. So far I have found very little tutorials on non-OOP game programming. As I said, I try to stick to non-OOP when I can, but it's the standard around a lot of the forums I post on. I agree with what you're saying completely.

@Scrooge:

> Pretty easy answer that we both know. ;]

I find that extremely funny coming from someone like yourself.
Link to comment
Share on other sites

@Jungle:

> Seriously, if most of the college courses I'm looking at didn't include C++ then I'd never look at it. I just want to get ahead of the game.

That's honestly the only reason why these languages are "the future;" most enthusiasts follow along the same path as modern OOP developers do: simplicity > practicality.
Link to comment
Share on other sites

@Captain:

> What the duck guys. Dennis Ritchy's dead and we're still debating over his masterpiece?

When comparing C to Lisp, then what would Lisp be? The programming language of the gods?

@Jungle:

> Seriously, if most of the college courses I'm looking at didn't include C++ then I'd never look at it. I just want to get ahead of the game.

My university is like: we are only interested in Assembly (x86, MIPS and Harvard-like generally) and C89 (C99 they don't mind) as for computer science. Yes, they do teach Java, but only because they are then allowed to call the curriculum a CS-curriculum according to IEEE (all the professors actually think the language is useless and terribly designed, and tend to avoid it as much as possible). They also take a look at Ruby, Prolog, Erlang, Haskell, Clojure/Lisp, Io and Scala (as in you get to work with each of those for a week, just to learn about other useful paradigms).

Yours faithfully,
  Stephan.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...