From C to ?

Started by
19 comments, last by slicer4ever 10 years, 1 month ago

So I want to move on from C to an object oriented language. (C++, C# or Java)

My C knowlege is not that advanced.

But I have learned all the basics of the language. (pointer,arrays, structures, input output files, dynamic memory)

I don't plan to move on Java because I am going to learn it along with my university class next year.

This leaves me with C++ and C#. I think it's best for me to move on to C++. But there's a big fuss on learning C++ the C way. And because I know C I don't want to start using C in C++. This is something I want to avoid.

So I want a book that doesn't learn you to program the C way in C++. I don't care if it's an super introductory book I don't mind. I just want the book to explain well the object oriented concepts and the best way to program in C++.

Thanks smile.png

Failure is not an option...

Advertisement

If you're still learning some of the basics of C it may be worth spending more time with C before moving on -- have you actually written any small programs or games using the language, or only worked through your book/tutorials? If you wanted to make a small game with C you could consider using a library such as SDL or Allegro to write some simple graphical games such as a Pong or Breakout clone; the experience of writing a complete program -- even if it's a small one -- can be an invaluable learning experience.

It's absolutely your decision however, and there's not really any correct or incorrect approach. If you feel you're ready to move on to C++ I'd recommend C++ Primer (5th Edition); it's an excellent book that's been updated to the latest standard (C++11) and attempts to focus on best practices and proper modern use of the language rather than simply showing you the syntax. If you're looking for an online resource (either as an alternative, or to supplement your book) my suggestion would be LearnCpp.com.

Hope that helps! smile.png

- Jason Astle-Adams

On Youtube you can find long presentations form Stroustrup where he talks about how not to look at at C++ as C with classes and how to do things the C++11 way. They might sound a bit advanced though.

This was the last one I saw: "The Essence of C++: With Examples in C++84, C++98, C++11, and C++14"

Jumping into c++ and the cplusplus.com pdf

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy

If your goal is as stated, to learn an object-oriented language then I think C# is the one to choose of the three.

Java, as you mention, is something you will learn at university anyway.

C++ is an old, large, complex language and has plenty of things in it that don't relate to OO. As I get older I like C++ less and less (or rather I dislike it more and more), the infuriating anachronisms of C++ make it a language I'd advise people to stay away from unless they have no choice.

C# is Java-esque, so it will give you an edge when learning Java at uni. But it is actually a much nicer language than Java (and C++, but that's setting a pretty low bar anyway).

Another good candidate is Python, btw.

If I absolutely had to use a systems language and had my choice of them then I would skip C++ and go straight to Rust or Go.

Once you know the C#/Java way of doing things you might actually have a better idea how to approach C++. C-style C++ results in questionable code (unless it was done for a good reason) but C#/Java-style C++ is not a bad place to start and then you can selectively bring in some of the actually-nice C++ features like free-functions, typedefs, better-generics (templates, but don't go overboard with them), deterministic destruction, const, auto, maybe some others. A lot of the C++ language you just want to ignore day-to-day really (javascript's headed that way too).

I learned C++ right after C, and I do not regret it.

When I needed Java, it took me two days to be capable enough for the tasks.

I studied C# to code a tool, and even though it took me longer than Java to get the hang of, the learning was also fast and easy enough.

But I like to learn languages as I need them. It reinforces the concept that they are the tools; and that I am not their programmer.

The only times where I research new languages that I won't really need (notice I said research, not learn) is when I am evaluating new technologies, what I do from time to time. Still, this research process should never take over two days.

And as you said you'll be needing Java, I'd go for it.

I guess the best C++ book recommendation I can give you, following what you asked, is C++ for dummies.

I wouldn't go on C++ right now. Main problem is that there's no such thing as "C++" to start with. I mean just read this:


On Youtube you can find long presentations form Stroustrup where he talks about how not to look at at C++ as C with classes and how to do things the C++11 way. They might sound a bit advanced though (1).

This was the last one I saw: "The Essence of C++: With Examples in C++84, C++98, C++11, and C++14" (2)

Here's what I read "between the lines":

  1. The new, non-broken way. But wait, because the new not-broken way is complex.
  2. 4 versions. Four.

I'd probably go C# right now. Java left me a bitter taste and not in the good way.

Previously "Krohm"


I wouldn't go on C++ right now. Main problem is that there's no such thing as "C++" to start with.

Oh, come on.

I'm so happy that C++ is evolving again, after so many years of standstill. Simply take a modern compiler like MSVC or GCC and take off. There are still some minor restrictions regarding C++11 support, but well, if it's not one thing, it's another.

And regarding different versions: What C# version are you going to learn: 3, 4, 5? And what .net framework: 3.5, 4.0, 4.5?

Guys I am determined to learn C++ and do some serious stuff with it until the end of the year. :P

I will take a look at the books you recommended me.

I already started with C++ Primer as it is the most advanced and will get me quickly moving. (see if I can keep up with it)

Thanks for your suggestions!

Failure is not an option...

I'd probably go C# right now. Java left me a bitter taste and not in the good way.

If you want an even more bitter taste, try using C# with Windows Metro... They cut out loads of classes for their core profile and does tend to cause quite a few headaches.

Whilst C++ is a perfectly robust language, the only one I have known not to evolve in any radical way (for many years) is C.

... Oh wait, you say that there is now <stdbool.h>? C99 is Madness!

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

This topic is closed to new replies.

Advertisement