Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've been programming C++ for almost a year, and I've written complex programs however there are a couple of programming features of C++ which I didn't cover up (Classes & pointers), however I felt ready to develop a desktop application. I didn't get any books nor did I find any REAL documentation. I said to myself "Practicing is the most important thing in programming. I'll do that".

Obviously I didn't learn much. After 4 months of programming in Visual studio C++/CLI I barely understand what I'm doing. I know how to do very basic operations, converting data types, but I am clueless on how the program works, how I add anything except events or how I change my GUI in code and not in the GUI builder.

What should I do? Practice didn't really help, I only know some very easy things since I started working with Visual Studio, but the rest of the concepts leave me clueless. Should I hit the books, or should I just keep practicing?

share|improve this question
    
C++ being an object oriented programming language, I think it is pretty important for you to try and understand these concepts. You may find another aspect of programming, which I consider the most interesting ever! –  appoll May 10 '12 at 20:24

8 Answers 8

up vote 4 down vote accepted

C++/CLI is very bad and not useful, for anything except interop, and has little to do with C++.

Just to note, classes are the single most important thing in C++. If you can't use classes, you can only write tiny little toy programs.

share|improve this answer
3  
Almost giving you -1. A language is almost never "bad" or "good" by itself. C++/CLI may be a bad starting point for learning C++ or the .NET framework, of course, but that is not what you wrote. –  Doc Brown May 10 '12 at 20:23
2  
@DocBrown: While I tend to agree with the sentiment, I'd say C++/CLI is one of those languages that makes it a good thing you said "almost never..." It doesn't compete with Brainfuck or Intercal for sheer awfulness, but still has little to recommend it outside the specific situation cited. –  Jerry Coffin May 10 '12 at 23:06
    
@JerryCoffin: yes but, the need for the interoperability offered by C++/CLI is a situation I have faced several times in the last years, and for that far-from-specific situation C++/CLI is a really good choice. –  Doc Brown May 11 '12 at 11:30
    
It's Microsoft's own advice that it's not useful for anything except interop. –  DeadMG May 11 '12 at 11:44
1  
@Codereview: Regular native C++. Not C++/CLI. –  DeadMG May 11 '12 at 16:00

Yes, you should hit the books. And start with C++ books that cover classes and pointers. Make sure you know these topics well. Then you will want to go for an introductory Microsoft Visual C++ book. Practice is important, but if you don't know what you're doing, practice won't get you anywhere.

share|improve this answer
    
Whereas I agree with your answer, I don't really know what a Visual C++ book is and what it should teach you. Do you mean a manual for the IDE? As otherwise books that claim to teach you Visual C++ in an actual programming related context usually just mess up Visual C++ with C++/CLI or (even worse) MFC and the fact that they're not aware of this term mixing doesn't make them any good. –  Christian Rau May 11 '12 at 9:45
    
@ChristianRau: I found this rather quickly on Amazon: amazon.com/Ivor-Hortons-Beginning-Visual-Programmer/dp/… I haven't read it myself so I can't really say if it's a good one or not, but it's probably a good one to start investigating. If you have better recommendations, I'm sure they'd be welcome! –  FrustratedWithFormsDesigner May 11 '12 at 15:28

Sounds you realized the flaw in your own original thinking. I've always liked this quote (do not remember who said it) which seems to fit very nicely here:

"Practice doesn't make it perfect; perfect practice makes it perfect".

Meaning that if you don't have enough skills to know what you are practicing, you might be doing more damage than good.

Go back and start reading books. They'll show you step-by-step what it takes to get an app up and running. The books won't make you an expert but they'll give you a much better perspective on what it is you should be practicing.

Btw, C++/CLI is a really bad environment for what you are trying to accomplish. As far as I can tell that technology is best for interoperability layers between managed and native code. If you don't need interoperability, stick with C++ if you want to write native apps or pick up C# if you want to write managed apps.

As far as GUI desktop apps go, I would recommend you pick up C# with WPF. I can name several very good books on that but you'd also have to concentrate more on C# itself. And the fact that you skimmed over classes tells me there's a ton of language itself (both C++ and C#) that you should learn.

If you want to stick with C++ the best choice I can think of is the Qt library. That is until Windows 8 and next visual studio come out and introduce XAML to C++ environment.

share|improve this answer
    
Practice makes permanent. –  Crazy Eddie May 10 '12 at 18:27

The thing here is, are you doing C++ development, or developing in some framework/toolkit?

See, you can do desktop apps in C++ - we've used MFC for donkeys years, and while that is now obsolete, the point is that you're 'doing MFC development', not strictly C++ development, it just happens that your MFC apps are written using C++.

So, today, what are you using? There are several toolkits to use, probably the best is Qt which has some good tutorials. If you prefer to use a C-style paradigm, then maybe GTK+ is a good choice. If you want to only use Microsoft technologies (some do, sigh) then HTML is the current choice for Metro apps, and you're sort-of out of luck with C++ GUIs, you can write WPF using C++ in Windows 8 but not before then.

So its great that you're learning something new (a lot of people say this on this site, but they generally mean "learn some new C# tech") and I hope you enjoy C++ GUI programming - Qt is a joy to use, and the new QML features are in a different league to WPF.

PS. The way to learn is to use the GUI builder to create a very simple program, then look at what it generates and extend it manually. I learned a lot of stuff that way, and it taught me a lot more than I realised.

share|improve this answer

Download QT Creator and look at the example programs supplied with it. A lot of them are very useful. Sure, QT has some unique quirks but it's the easiest way I can think of to get you started writing GUI apps.

share|improve this answer

I might be so crazy as to suggest you abandon VS entirely and move over to something like Eclipse, mingw, etc... Maybe even go all out and use Notepad++.

Why? Because VS hides too much important stuff. As you mention...you've written this app but don't know the first thing about how it works. You can't really do that if you're doing all the underlying stuff yourself. You'll be writing stuff by hand, looking up how to do things in the API docs...etc... You'll have to.

When you can do all that fairly easily, then think about bringing VS back into the picture. You might have decided by that point though that it's easier not having to do battle with some massive monstrosity all the time though and chose an IDE that works a touch better.

One thing though...the VS debugger is one of the best around. It's hard to replace. If you use the VS compiler (not the IDE) you can still use the IDE for debugging your program. Up to you whether you want to fight that hard though.

share|improve this answer
    
code::blocks is my favourite –  gbjbaanb May 10 '12 at 20:06

You know, I believe that every thing should be take part in whenever we need that. How does it matter if there is concept out of your defined world and also you have no idea about it? I think you should learn each concept just when you need that of face a problem. Ok. In this method. You can define a new project have some real problem. Then try to solve them and give a solution. I think this is the best practice to learn things.

share|improve this answer

If you're developing a desktop application that is UI-heavy, and maybe does lots of database access, I'd start by asking whether C++ is the best tool in the first place.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.