C++ or ...
-
Hi everyone, I have a question, if you see forums on the codeproject they are active forums like Visual C++ / MFC,C#,... and at all forums Visual C++ / MFC is a busy forum (of course except the Lounge)but my question is does Visual c++ is a live language or not,maybe you want to know why I ask this question I want to know does start to learn C++ is correct (because c++ isnt new istead C# or other languages) or I must to start with C# or other language? If you want to decide whats your choice? Thanks
C++ is a tough language to learn from scratch. I'd go with C#, or why not Visual Basic.Net? Why worry about all that memory management stuff? I taught myself Basic (in 1981) on a computer without a stinking manual (thank you very much Ohio Scientific) and I was forced to learn a bit of Machine Language (Assembly) as well, and I've converted to the newer languages, after a 20 year hiatus (don't ask), without any problem, except with C++. I mean, why bother with all that extra stuff, when the computer will do it for you! Plus, I hate to use the brother card, since I'm 40, but my older brother, who practically built the entire internet his-self is of the opinion that C++ is a pain, use C# or VB.Net -- before adding that learning VB.Net is useless, since MS is phasing it out and not to wake him up to ask stupid questions anymore, he's building the internet in his sleep! OK, I'm done.
Shohom67
-
I think it is really funny everyone in this thead is using C# syntax instead of C++ syntax. It should be
if (bUseCPlusPlus) MessageBox(NULL, "You have the Spiderman lunchbox.", "A True Man", MB_OK); else MessageBox(NULL, "You hunt and kill and eat raw meat.", "Very Girly Man", MB_OK);
Realistically speaking, I use C# strictly because I am a contract software developer and I work for companies that have chosen either C# or VB as their line of business software platform and I don't have the luxury of changing their choices nor do I need to. Language is quickly becoming more of a lifestyle choice in .Net than a limiting factor on functionality. My main constraint is time/maintainability and C# really comes through on that, particularly with the addition of generics and other features in VS2005. I changed from Vb.Net before that and from C++ before that and COBOL before that and ASM360 before that and Univac Basic before that and FORTRAN before that. So I say when in Rome do as the Romans. No man is an island, so program in whatever language is the most ubiquitous in your world so that you can most easily partner with others to make the most amazing software possible.
-
Hi everyone, I have a question, if you see forums on the codeproject they are active forums like Visual C++ / MFC,C#,... and at all forums Visual C++ / MFC is a busy forum (of course except the Lounge)but my question is does Visual c++ is a live language or not,maybe you want to know why I ask this question I want to know does start to learn C++ is correct (because c++ isnt new istead C# or other languages) or I must to start with C# or other language? If you want to decide whats your choice? Thanks
They are all wrong start with Scheme or Lisp. C++ is very much alive and well, if you played a game recently odds are it was in c++. If you are learning this as your first language c++ might make your head hurt if you have no other programming experience, pointers, garbage collection, assuming unmanaged c++. Don't get caught up in the language, it's mostly just syntax. Learn the bigger abstract ideas that drive the language and you will easily be able to learn syntax for languages fairly quickly.
-
Really, the language itself is just semantics. The underlying issue is to get a fell for how things are supposed to work. An expert with the language can still write crappy code. Think OO. Think Framework. As a very wise programmer once told me, 'Programmers are going to be cheap. Move up the food chain. Think architecture.'
I completely agree. I am needing to fill some holes in my UML study and other architecture and design issues in order to move forward a project I'm working on. 3 and 4 story buildings are ok, but then you try to build a 12 story building and the thing just topples. So, 'back to the drawing board'...
-
Forget learning MFC - there is nothing to learn from it except bad style. I would start by learning C from Kernighan & Ritchie. The language is simple with 32 keywords and is quick to learn. As well as several other languages being similar to it, the main advantage will be your gain in understanding of the stack and heap. It has been shown that good programmers have a consistent model of what a computer is doing to their program, whereas dodgy ones don't. Working with this book will help give you that model. The book is marvelously written and should instill you with an enthusiam for programming which you might not get from other texts. The managed languages hid most of this stack and heap usage from you but is very useful to know what is happening a little under the hood, so you can understand why performance problems occur, what the garbage collector is doing, etc. Type in and run the examples from the book and then do the exercises - it won't take long. Then learn something like Java or C# rather than C++. This will help with your design, imersing your in a more OO way of doing things than you would get from starting with C++, which is very powerful but, because it supports nearly all design and programming styles it is easy for you to go off in the wrong way, such as structural programming. Then you can learn C++ if you want more power, such as with generic programming, or even using the scoping style that C++ destuctors allow you. Avoid any book by Herb Schildt. Avoid the Java in a Nutshell books on O'Reilly. I haven't looked at the Petzold C# books but I would be wary based on his programming style from his Windows books. If you are going to learn C++ then Accelerated C++ by Andrew Keonig approaches the matter in a more modern style. You could then profitably read The C++ Object model by Stanley Lippman, assumming that you have read the Kernighan and Ritchie book. www.accu.org has a good book review list as well. regards, Andrew
Andrew Drummond wrote:
Forget learning MFC - there is nothing to learn from it except bad style.
Could you please explain this more?
// "Life is very short and is very fragile also." Yanni
while (I'm_alive)
{
cout<<"I love programming.";
} -
They are all wrong start with Scheme or Lisp. C++ is very much alive and well, if you played a game recently odds are it was in c++. If you are learning this as your first language c++ might make your head hurt if you have no other programming experience, pointers, garbage collection, assuming unmanaged c++. Don't get caught up in the language, it's mostly just syntax. Learn the bigger abstract ideas that drive the language and you will easily be able to learn syntax for languages fairly quickly.
> As I'm reading these answers, it seems as if the people with a lot of C++ experience, and have > really given C# a chance, really prefer C#. And those who are reluctant to try it or don't have > enough C++ experience to know what a nightmare it can be, are religiously against something > new... anyone else get that feeling? Quite the opposite, I get the feeling people who claim to understand C++, claim to have used more than 90% of it while it is far more likely it is something close to 10%. Oh ma look: Web-page with ___, Class as XML, SqlReader as untyped data, Designer to freedom etc, etc. I got into C# before it went public, heck even Java when Netscape was the only decent browser, and studied Smalltalk environments. It is mostly syntactic differences and all the perceived difference in semantics are easily emulated. It does not apply in reverse. I worked on translators and studied compilers and VMs and over time (12 years with 'managed' stuff) C++ just beats the hell out of all of them. That is why they write those platforms in C++, because it gives them the power to boot (read it as:exist), and when you dig into their source code a bit you see they are not even using 50% of the modern C++ in your favourite candy/chocolate/beloved runtime. Many times I see comments such as 'I worked with it longer than that', without any hint they actually improved their knowledge of C++ on weekly basis or that they utilised anything like reverse iterators, more than 5 algorithms, template template arguments or typelists (most of which Java and C# cannot even touch to date). And I agree with the poster on Lisp, it is probably a great place to look into as well. Sure C# and Java can be more productive, but 90% of the time it doesn't make you learn anything new. It dumbs you down in fact for the golden torch that is productivity. Of course it matter hence you use the right tool for the right job, you know to get paid, but when you I see messages like others wrote on 'bad', almost inferior etc it makes me laugh. Money is not everything and attempting to gain knowledge is as satisfactory. 90% of your language advanced features are stolen from C++ concepts and still handicapped. And sure C++ is for mature developers (MFC is a mess because of C++ compiler history primarily, templates or runtime info was not even agreed on back then). C++ is very complex (price you pay for great expressive power), it is even more difficult to start right with it, and they estimate there are only around a 100 or so
-
Andrew Drummond wrote:
Forget learning MFC - there is nothing to learn from it except bad style.
Could you please explain this more?
// "Life is very short and is very fragile also." Yanni
while (I'm_alive)
{
cout<<"I love programming.";
}'cos it doesn't exhibit very good design. Classes with massive interfaces including methods factored down to the base when they have no business being there as they only apply to a specialised case. The ATL class however is much more interesting but is only worth looking at if you decide to go the C++ route and are studying generic programming techniques, which are one of the major reasons for going with C++ rather than Java or C#. Even if you end up with C++, going through Java (or C#) is still to be recommended as your C++ style will benefit. I would also going Java rather than C# myself. Programming books written by people with a Unix background, and particular AT&T, tend to show much better style than anything written by people with a Windows background. C# books would tend to come from the latter.
-
'cos it doesn't exhibit very good design. Classes with massive interfaces including methods factored down to the base when they have no business being there as they only apply to a specialised case. The ATL class however is much more interesting but is only worth looking at if you decide to go the C++ route and are studying generic programming techniques, which are one of the major reasons for going with C++ rather than Java or C#. Even if you end up with C++, going through Java (or C#) is still to be recommended as your C++ style will benefit. I would also going Java rather than C# myself. Programming books written by people with a Unix background, and particular AT&T, tend to show much better style than anything written by people with a Windows background. C# books would tend to come from the latter.
First off, the fellows question is: but my question is does Visual c++ is a live language or not,...I want to know does start to learn C++ is correct (because c++ isnt new istead C# or other languages)? In my opinion, comparing MFC with c# or Java is not true. Needless to say that, while C++, C#, Basic and Java are each one a separate language, MFC is not. So this is not a true comparison. Second:
Andrew Drummond wrote:
there is nothing to learn from it except bad style
Totally disagree, I learned a lot of good things from MFC;), but more realistically, what you call bad style or perhaps more accurately bad OOP style, is some part because of the fact that MFC is a low level framework, wrapping Win APIs, which are C based. That is, you have to work with structures, event driven, bad object design (like we mostly need to call Create,...) which could be better of course. What I expected to be said, was that you introduce C++, then name different technologies and their pros and cons. This way one might compare MFC with CodeJock, WTL, ATL, Qt, etc. But C# actually is another programming language with another technology.
Andrew Drummond wrote:
Classes with massive interfaces including methods factored down to the base when they have no business being there as they only apply to a specialised case.
However I don't understand this clearly, either because I'm not a native English, or I'm not an expert yet, but this seems not to be so much problem for some one who learns MFC. In fact there are bigger problems that I can name and there are with all technologies. Nothing is perfect.
Andrew Drummond wrote:
Even if you end up with C++, going through Java (or C#) is still to be recommended as your C++ style will benefit.
Again disagree, Standard C++ does not have what C# or Java introduce, like Garbage collection, Thread pool, etc. These are modern technologies (I think some of them considered in C++ 0x, however.)
Andrew Drummond wrote:
I would also going Java rather than C# myself. Programming books written by people with a Unix background, and particular AT&T, tend to show much better style than anything written by people with a Windows background. C# books would tend to come from the latter.
This is another story;)
-
First off, the fellows question is: but my question is does Visual c++ is a live language or not,...I want to know does start to learn C++ is correct (because c++ isnt new istead C# or other languages)? In my opinion, comparing MFC with c# or Java is not true. Needless to say that, while C++, C#, Basic and Java are each one a separate language, MFC is not. So this is not a true comparison. Second:
Andrew Drummond wrote:
there is nothing to learn from it except bad style
Totally disagree, I learned a lot of good things from MFC;), but more realistically, what you call bad style or perhaps more accurately bad OOP style, is some part because of the fact that MFC is a low level framework, wrapping Win APIs, which are C based. That is, you have to work with structures, event driven, bad object design (like we mostly need to call Create,...) which could be better of course. What I expected to be said, was that you introduce C++, then name different technologies and their pros and cons. This way one might compare MFC with CodeJock, WTL, ATL, Qt, etc. But C# actually is another programming language with another technology.
Andrew Drummond wrote:
Classes with massive interfaces including methods factored down to the base when they have no business being there as they only apply to a specialised case.
However I don't understand this clearly, either because I'm not a native English, or I'm not an expert yet, but this seems not to be so much problem for some one who learns MFC. In fact there are bigger problems that I can name and there are with all technologies. Nothing is perfect.
Andrew Drummond wrote:
Even if you end up with C++, going through Java (or C#) is still to be recommended as your C++ style will benefit.
Again disagree, Standard C++ does not have what C# or Java introduce, like Garbage collection, Thread pool, etc. These are modern technologies (I think some of them considered in C++ 0x, however.)
Andrew Drummond wrote:
I would also going Java rather than C# myself. Programming books written by people with a Unix background, and particular AT&T, tend to show much better style than anything written by people with a Windows background. C# books would tend to come from the latter.
This is another story;)
I accept your suggestion that you are not an expert yet... First off, I asnswered this question of yours: "Forget learning MFC - there is nothing to learn from it except bad style. Could you please explain this more?" Whereas you may have learned some good things from MFC (I doubt it) I would bet that you have learnt a lot more bad things. If you read "Inside MFC" they suggest that the first version of MFC was a sophisticated framework but they were told that it was too high-level and to come up with something simpler, so that your average programmer could understand it. Personally I can't believe this. "Standard C++ does not have what C# or Java introduce, like Garbage collection, Thread pool, etc." These are easy to introduce via libraries, such as Boost or ones that you write yourself if you have the competance. If you don't have the competance then you can just use languages like C# or Java where they exist, where they are very likely to be implemented in C++ anyway. In addition C++ supports even more modern programming styles, like generic programming, that Java and C# don't and cannot. If you need garbage collection then perhaps you should keep away from C++ until you are a bit more competant. I also can't see what you are disagreeing with. I said that your C++ programming style would benefit from exposure to C# or Java, where OO styles are highly visible. In particular it will drive home the benefits of interface-based programming style. What's to disagree with? The combination of generic programming styles and interface-based styles cover a design space that is much richer than that in Java or C#. I also haven't mentioned the XUnit type frameworks which are much more likely to come across in Java or C#, which might introduce you the benefits of TDD styles. Once you are convinced you can then use the CxxUnit framwork in C++. That's better than going the other way round as CxxUnit is not as easy to set up as, say JUnit. Once exposed to Java or C# you may find that there is no need to go to C++ anyway, which is becoming increasingly likely unless you write performance led software. Learning C++ first and then finding that you don't need it is a bit of waste of time.
-
I accept your suggestion that you are not an expert yet... First off, I asnswered this question of yours: "Forget learning MFC - there is nothing to learn from it except bad style. Could you please explain this more?" Whereas you may have learned some good things from MFC (I doubt it) I would bet that you have learnt a lot more bad things. If you read "Inside MFC" they suggest that the first version of MFC was a sophisticated framework but they were told that it was too high-level and to come up with something simpler, so that your average programmer could understand it. Personally I can't believe this. "Standard C++ does not have what C# or Java introduce, like Garbage collection, Thread pool, etc." These are easy to introduce via libraries, such as Boost or ones that you write yourself if you have the competance. If you don't have the competance then you can just use languages like C# or Java where they exist, where they are very likely to be implemented in C++ anyway. In addition C++ supports even more modern programming styles, like generic programming, that Java and C# don't and cannot. If you need garbage collection then perhaps you should keep away from C++ until you are a bit more competant. I also can't see what you are disagreeing with. I said that your C++ programming style would benefit from exposure to C# or Java, where OO styles are highly visible. In particular it will drive home the benefits of interface-based programming style. What's to disagree with? The combination of generic programming styles and interface-based styles cover a design space that is much richer than that in Java or C#. I also haven't mentioned the XUnit type frameworks which are much more likely to come across in Java or C#, which might introduce you the benefits of TDD styles. Once you are convinced you can then use the CxxUnit framwork in C++. That's better than going the other way round as CxxUnit is not as easy to set up as, say JUnit. Once exposed to Java or C# you may find that there is no need to go to C++ anyway, which is becoming increasingly likely unless you write performance led software. Learning C++ first and then finding that you don't need it is a bit of waste of time.
Andrew Drummond wrote:
I also can't see what you are disagreeing with.
I disagree with this part: " going through Java (or C#) is still to be recommended as your C++ style will benefit", While my OO style would benefit of these languages, but there are a lot of things introduced in such languages that prevent a learner from learning standard c++(Consider sealed in c# and packaged in Java. I know we can implement sealed in c++ and I think they are adding similar capability, I could not think of something else quickly here). I hope I'm clear here, because describing what I mean is really difficult in a foreign language(I hope you excuse me because of this.)
Andrew Drummond wrote:
If you don't have the competance
I wrote my own version. So I'm not that much beginner actually;)
Andrew Drummond wrote:
If you need garbage collection
I really hate it, and I think I don't need it.
Andrew Drummond wrote:
Once exposed to Java or C# you may find that there is no need to go to C++ anyway, which is becoming increasingly likely unless you write performance led software.
Agreed
Andrew Drummond wrote:
Learning C++ first and then finding that you don't need it is a bit of waste of time.
Do you think learning c++ these days, is a waste of time because we really don't need it?
// "Life is very short and is very fragile also." Yanni
while (I'm_alive)
{
cout<<"I love programming.";
} -
Andrew Drummond wrote:
I also can't see what you are disagreeing with.
I disagree with this part: " going through Java (or C#) is still to be recommended as your C++ style will benefit", While my OO style would benefit of these languages, but there are a lot of things introduced in such languages that prevent a learner from learning standard c++(Consider sealed in c# and packaged in Java. I know we can implement sealed in c++ and I think they are adding similar capability, I could not think of something else quickly here). I hope I'm clear here, because describing what I mean is really difficult in a foreign language(I hope you excuse me because of this.)
Andrew Drummond wrote:
If you don't have the competance
I wrote my own version. So I'm not that much beginner actually;)
Andrew Drummond wrote:
If you need garbage collection
I really hate it, and I think I don't need it.
Andrew Drummond wrote:
Once exposed to Java or C# you may find that there is no need to go to C++ anyway, which is becoming increasingly likely unless you write performance led software.
Agreed
Andrew Drummond wrote:
Learning C++ first and then finding that you don't need it is a bit of waste of time.
Do you think learning c++ these days, is a waste of time because we really don't need it?
// "Life is very short and is very fragile also." Yanni
while (I'm_alive)
{
cout<<"I love programming.";
}Depends what you are programming as to whether you need it. Ask Corel who tried to rewrite their office suite in Java. Or ask MS why they haven't rewritten Office in C#. Maybe Vista is written in C# - which is why it is so resource hungary?
-
Well Java would be my prefered language, it's more open and portable. Choose wise.
stefankruzel wrote:
Well Java would be my prefered language, it's more open and portable.
More open and portable than what? C++ is completely open, with a established procedure for changes to the language. Anyone can join the committee with full voting rights to effect changes. On the other hand, both Java & C# are closed preprietary languages, controlled by a single company. Both have forums where average users can suggest changes, but the final decision on what goes into the language remains exclusively with the owning company. Both companies provided implementations covering their own OS, and the most commonly used OS. Both provide a specification and allow other vendors to write implementation. Both have implementations for Linux and OSX provided by third-parties.
Truth, James