Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hey guys I am really new to the C++ programing I have a little knowledge in C an

ID: 653178 • Letter: H

Question

Hey guys I am really new to the C++ programing I have a little knowledge in C and a bit more in C++, but I do not know them enough to call myself a programmer. I am working as a PHP Web Developer I like being a crafts man and creating things so that is the reason to combine the programming with web development. I think that I could really benefit from both of them and so... My question is:

Is it a good Idea to learn C++ with Qt or not?
Can you give me pros and cons of both?
Note: I do not want to become a programmer and give up the web development I want to combine them both.

Explanation / Answer

For learning C++, Qt has some good things and some bad things.

The good:

It provides the building blocks for everything you might want to do with C++, from network programming and threads to OpenGL and displaying web content.
It has a few tricks up it sleeves to make things a little easier. For example, it uses the parent hierarchy to handle object deletion makes memory leaks much less common. It also uses signals and slots to provide a somewhat sensible way to write event-driven programs.
The bad things are mostly corollaries of the good things:

Because it has everything wrapped up into a nice, cohesive whole, you are de facto encouraged to only use its things. For instance, you'll be using QString and QList instead of std::string and std::list, because that's what you'll get from Qt classes and that's what Qt classes expect you to provide.
When you eventually write non-Qt code with C++, you'll be missing some of the safety nets. You will really have to be responsible with your memory deallocation, and you'll have to learn the other patterns for doing event-driven code in C++.
Without Qt, you'll have to find some external or system library (e.g., outside the C++ standard) for: threads, network programming, GUI programming, graphics rendering (to the screen or to image files), XML parsing, rendering web content, etc. Qt includes classes for all of those things. But if you want to eventually become a generic C++ programmer, you'll need to learn how to program without it.