Page 1 of 1

C++ expert ?

Posted: Sun Dec 26, 2004 4:58 pm
by SmartBoy
Hello ..

i want ask , how i can be expert in c/c++ ?

like bulid GUI app and OS and other .

thanks ;)

Re:C++ expert ?

Posted: Mon Dec 27, 2004 2:03 am
by cloudee1
By learning and applying! :-\

Re:C++ expert ?

Posted: Mon Dec 27, 2004 4:00 am
by durand
The guy (Bjarne Stroustrup) who made C++ has a few useful links and papers which you can read:

http://www.research.att.com/~bs/C++.html

Re:C++ expert ?

Posted: Tue Dec 28, 2004 9:11 am
by Solar
And patience. C++, while being a powerful language indeed, is also among the ugliest beasts alive. Mastership in C++ takes a couple of years of applying what you've learned and absorbing new lessons as they come.

Re:C++ expert ?

Posted: Wed Dec 29, 2004 5:08 am
by Perica
..

Re:C++ expert ?

Posted: Wed Dec 29, 2004 2:50 pm
by Candy
Perica wrote: You know what they say... practice makes perfect.
There is also a reasoning. Practice makes perfect. Nobody's perfect. Why practice?


On the other hand, not even a compiler knows perfect C++. For practical purposes however, you need to know the language your compiler accepts and understands, not so much the standard C++. It's a good thing to know, but it's not practical.

To get back to your topic, how do you become an expert? Well, try out all sorts of things. Make small programs that do one thing. Try out some other ideas, such as making two programs work together that don't share a memory space, two that do (threads), cooperate with a standard interface (http?), work together in an interface, try to figure out yourself how to make a general X of some type, such as a general server, transforming program or command line program. Learn some library interfaces, and use them so much that you know what's good and what isn't good about them. Think up a way to design them. Then, search the internet and any other place about methods that other people have thought up. Learn about design patterns, and how to apply them correctly, and only in the appropriate places. Talk to others, converse about designs and always consider all limitations of your own designs. Don't hesitate to be open about your choices and always be open to what others have to tell you about them. Even if it's a negative comment, you can and should still learn from it.

Only when you can explain your choices and come up with *some* design for any possible situation, can you be a professional software engineer. Note, this is further than a C++ programmer. You in a way should not become a c++ programmer without a hint of designing methodics, that'd be like somebody using a pencil, paper and a bunch of metric tools calling himself an architect. He could make a house, but he couldn't make things that a real architect could make.

Re:C++ expert ?

Posted: Sun Jan 09, 2005 1:00 pm
by mystran
Just to give people some insight on how hard C++ is to completely master, I would like to mention that just yesterday I was hacking some awful C++ overloading stuff, writing Lua bindings for a project. Anyway, in C++ you can overload pretty much everything, but the correct version is always selected by parameters.

I needed more. I needed to overload a function based on it's return type instead. Now, I've been programming C++ over 7 years (at least). I would think I know the language pretty damn well, including common problems different compilers have for stuff like templates. And I certainly did know that you can overload the assignment operator, but you can only overload it inside your class definition, which means you need to be writing the target of the assignment.

What I must have either have missed for seven years (or forgotten at some point), is that you also overload the cast operators. WHAT? Well, when you use an integer in a floating point operation, it is automatically converted. Similarly, you can force that conversion by writing:

Code: Select all

  int i = 1;
  float f = (float) i;
Obviously the above would work without the explicit "cast" in this case. The interesting thing though, is that it's possible to write such conversions for classes. And the really interesting thing is that it's done in the "source" class, the class from which we convert:

Code: Select all

class Foo {
  operator int() {
    return 0;
  }
};
The above would make objects of class Foo convertible to integers, in this case with a constant value of 0. Quite esoteric syntax isn't it? Anyway, I thought I knew C++. Still, I had missed such an useful construct for all that time.

So, don't expect to learn C++ fast. There's a LOT of stuff in there.

As for what Candy says, I think it's not enough to know Standard C++ OR what your compiler accepts. You need to know both. In fact, you also need to know what other compilers accept. The union of all the existing dialect of C++ is what you need, so you can actually hope to write portable code. Oh, and C++ isn't static. Some perfectly valid C++ of mine from 5 years ago doesn't compile with recent compilers anymore, because the standard has changed. Not much, but enough to make recent gcc complain.

Re:C++ expert ?

Posted: Mon Jan 10, 2005 1:58 am
by Solar
mystran wrote: Oh, and C++ isn't static. Some perfectly valid C++ of mine from 5 years ago doesn't compile with recent compilers anymore, because the standard has changed. Not much, but enough to make recent gcc complain.
The standard hasn't changed. There was only one formal C++ standard so far, ISO/IEC 14882:1998. To my knowledge, that standard hasn't even been amended yet. Everything before that were either the de-facto AT&T 1.0, 2.0 or 3.0 "standards" or draft versions of what became the ANSI/ISO standard. Your "perfectly valid" code wasn't. 8)

That being said, there is an update to the C++ standard library just around the corner, but I don't expect significant changes to the C++ language proper anytime soon.