For a C programmer, knowing the basics of OOP, which of the title's language you think is better?
If you cannot define better, then which is more easy to use knowing plain C? For example, should somebody learn C++ or just go to the newer C#?
For a C programmer, knowing the basics of OOP, which of the title's language you think is better?
If you cannot define better, then which is more easy to use knowing plain C? For example, should somebody learn C++ or just go to the newer C#?
I vote C++.
C# is tied to dotNet, which, at the moment, is unportable.
Further, it is slow, it is easily reverse engineered, it gives no control over memory (uses a garbage collector) and the language itself is flawed, especially in the eyes of many C++ programmers.
Java is also interpreted which means easy reverse engineering and slow execution.
No, C++ is the best language today IMO, because it gives you control over what you want to do and how.
C# limits you to a slow framework, limiting your options.
C++ is as fast as, or faster, than C. It is also backwards compatible with C. And C++ has a great deal of pre-written code.
This means you can fall back to C if you need to communicate with hardware, for example, and yet you can program in high-level programming without sacrificing much speed.
If you already know C, then C++ is definitely the easiest to learn (all you need to learn is the ++ )
Java has these things they call "references", which aren't really references, they're more like pointers, but not quite. It also doesn't have a lot of basic things like a const keyword, destructors, and the option of whether you want to pass by value or by reference...
I would learn Java or C# rather than C++. It would be too easy to get stuck using C habits if you moved on to C++, and it would be easier to learn C# or Java without that burden.
Once you learn either of those two language you can always go back and learn C++ with a different mindset and combine that with your C experience to get the most out of C++.
What kind of development do you want to do? A lot depends on that.
Yeah, everything depends on what you do. Well, don't have anything in mind. I just like "thinking in simple way". Thus more like in C. But I would also want to "upgrade" to something more modern so I can use more modern libraries and all the such.
What you say Dave is the best thing to do. I would advise it for someone new in programming. But since I have learned to program in C I would like first to go to something similar, learn its new features but still programming C-like. Then little by little I ll learn more and more features more and more functions and have a more varied way of programming.
The 3 languages just look very similar to me. And I am kind of indecisive But I ll listen to most advises to go to C++.
>> But since I have learned to program in C I would like first to go to something similar, learn its new features but still programming C-like.
The problem is that to get the most out of C++ you need to avoid many of the habits you learn from C. Modern C++ is very different from C even though you can still code with C style in a C++ program. New C++ programmers with C backgrounds often fall back on their C knowledge instead of learning the new (and usually better) solutions available in C++. This is why I suggest starting with a language that won't let you fall into that trap.
Then would you suggest learning Java before C++?
I'd say it is a tough call, if all you want is to learn more programming languages. Daved's argument is that learning C++ right after learning C tends to cause the learner to stick to C techniques, thus missing out on C++ techniques. On the other hand, learning Java next would mean that you may pick up habits in Java that do not normally apply to C++.
In the end, I think that the choice does not really matter: you will always have to "unlearn" something that does not apply.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
C++ is my first language I am learning. I am doing the tutorials online and will be taking C++ classes at my local college soon. After C++, I plan to try and tackle Java.
>> Then would you suggest learning Java before C++?
In reference to the original question, yes I would choose Java or C# first because the OP already knows C. In general, it really depends. There's nothing wrong with learning C++ first, especially if you've already started.
I think the choice matters, but it won't stop you from being a good programmer, it will just take you down a different path. I would suggest learning a language well enough to use it to learn broader programming concepts before moving on to another language.
You could learn something radically different from C, if you just want to broaden your horizons. You could learn Smalltalk. You could learn Lisp. You could learn Haskell.
Java and C# are pretty much purely object-oriented, but they're still strictly typed (more strictly than C, actually), they use C-style syntax, and generally have a lot of C heritage.
Smalltalk is purely object-oriented (one of the earliest object-oriented languages) - and I mean extremely pure - dynamically typed, and has hardly any similarity to C at all.
Lisp (Common Lisp in particular) is a functional/imperative hybrid with strong meta-programming capabilities. Radically different from C.
Haskell is a strictly functional language. It requires a completely different way of thinking.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Modern JRE's do dynamic recompilation (compiling sections of frequently run code to native code based on runtime profiling), and some people have tried to show that it can be faster than a compiled language such as C++ (with optimizations based on runtime profiling which C++ programs don't have). Theoretically true, but practically, as of now, Java can only be faster than C++ on specially crafted code. But still, while it is generally slower, it's not like 5 times slower like it used to be.Java is also interpreted which means easy reverse engineering and slow execution.
That aside, I vote for C++. C# is too proprietary for my liking, and Java is incomplete (operator overloading, and what people mentioned above). I have a feeling that Java's design assumes that programmers don't know what they are doing. While it is true that I don't know what I am doing, I don't like that feeling . Operator overloading is an example (funny how they have to use it with their string class, but allows no one else to). Pointers, too (what are references doing in there then?).
Not to open a different topic, but can someone tell me what are the BIG differences in Java and C++. Differences on what you can do easily and what you can't. Lets not consider the differences in performance, safety, etc etc
I can't say much details, but as some have already mentioned: Java can't overload operators and Java is purely object-oriented.
That means there are no free functions - everything is inside objects.
Numbers and strings and all that are not objects in C++ - they are data types, so you can't expect "something".length() to work, as it might in Java.
Java does not support generic programming and templates to my knowledge. And I'm sure there's more.
Oh, and Java can't do multiple inheritance, can it (C++ can)?