**Warning: long post** What I don't understand about C++

Last year, during my first year of university, I took two courses in C++ programming. An introductory course, and an advanced course. At the start of the advanced course, my professor, who has a PhD in computer science told us that we would be qualified to have a career in programming, albeit a very dull, limited one.

We covered all the easy stuff, loops, if/else trees, breaks, arrays, iostream, fstream, functions etc. in the introductory course, and in the advanced course we covered classes, templates, exception handling, pointers, and such. I wasn't a prodigy or anything, but I understood it and was able to do everything required for the class.

My concern however, is that we didn't really learn how to do anything with it. For example, we made programs that would track order numbers for a shipping company, or ID numbers and assign it to people, like for a gym membership application. Still, these were solely console applications that would of course close after the program finished and nothing was left of it. No record of any of the information, rendering the whole program useless.

We were not taught how to build interfaces, how to save/store data (well, we learned fstream which I'm assuming leads to saving data types to be used by a program later)

So what I want to know is, what do I do with this? I really enjoy programming and want to continue with it, but I don't really know how to continue. I have a friend who took one, maybe two courses in C for engineering and is off programming robots, motorcycle throttles, etc, and he claims he isn't even very good at programming. He is my roommate and long time friend, and I'd love to be able to work with him, but we have been friends for all our lives and are very competitive, and would rather not swallow my pride and admit I need his help with this.

I understand C++ and C have different uses, but how do I learn how to apply what I know how to program to do anything for me? Is the answer so blatantly obvious that I should give up programming because anyone this dumb can't possibly go any further with it? Was I just not taught it, because it comes in a later class?

Sorry for the long read, but it is a genuine concern. Any help would be greatly appreciated.

Thanks in advance!!

TL;DR: I know how to program but don't know how to do anything practical with it
The possibilities of what you could do with it are nearly limitless. So the real question here is what do you want to do with it?

The answer to that question is the answer to your question.
well for starters, I'd love to be able to help my friend out with some stuff. He is a very talented mechanical engineer and builds a lot of robot's on his spare time.

Or even just figure out how to make the things I know how to program be stand alone programs, that don't need to run from the console that opens when you run your code. I understand you can open it from the project folder, but it still is just a console that doesn't save/read any meaningful data.

I'd like to know how to make, say, a simple office program that a customer service department might use to track customer information.

how do I make a GUI? how do I make the code work with the GUI? how do I make it save the data, and bring it back when it is called?
Yes when I started programming, I thought there were some useless things too such as when I first learn Java as my first language and the prof showed the concat function and I remember distinctly a student asked why concat when you can just write the string as is.

You can think of it this way, the simple sorting and so forth are basics that are used as smaller functions or part of a larger algorithm so when I first learnt merge sort and quick sort and thought those algorithms were impossible to learn, it turns out we don't have to write a lot of these classic algorithms BUT you have to start somewhere to learn the basics first.

Programs can be converted to stand alone to prevent having to have information lost if you save to files or databases (such as with web development where PHP and SQL are intertwined).

In terms of GUI, you can start with JavaSwing using Java. You could also mess around with OpenGL/GLUT in C++ using Microsoft Visual C++ I believe where you can create graphics, 3D gaming too.

One of the hardest task in programming is coming up with algorithms. (If you have some optimization for whatever purpose it could be your next million dollar idea for a start up) or if you are creative too that is a boost.

My brother works for Microsoft and he does more backend stuff like working with Microsoft's compilers but he gets paid almost $90K in his first year. So you can be a backend or frontend programmer. Then there's also web development where you deal with: HTML/CSS/JavaScript/PHP/SQL/AJAX/XML to create some online tool like Facebook. And web development has become more easier and intuitive thanks to CMS (content managments systems) such as Joomla, and especially WordPress. So you don't have to start from scratch to create a webpage but instead learn their APIs. So there are ample opportunities and as for your friend, he obviously has more experience with hardware and how to integrate this low level programming with high level.

I read somewhere a software engineer is the best career for years to come.

I find what's important is master the basics: such as recursion, how to use diferent data structures (benefits of each like Binary search trees vs linked lists vs indexed lists etc), math can be handy but not required unless you are serious about being a graphics/game developer. Then there's low level stuff like my brother w/ dealing with optimizing and improving compilers.

There's also mobile app development. Learning Android SDK or iOS SDK (I think they use Objective C language) and you build a nifty app and sell it for a buck and if it's awesome, rake in some secondary source for money.

There's also testing like unit, integration testing so if you're someone who likes to make program crash, this could be your field. Testing is so important to ensure programs do not only what they're supposed to but don't do what they're not supposed to.

There's also socket programming, so networking using TCP/IP as a tool for creating programs like MSN Messenger.

There's also shell programming like bash where you can create programs through command line OS like Linux (Ubuntu can't go wrong) to create routine tasks. I'm not really familiar with shell programming though...

Another thing to keep in mind is not to reinvent the wheel. What I mean is in your early years learning basics like quick sort or merge sort or how to make a linked list is fine, but down the road when you have to build projects that could take 6 months or more, there are optimized and tested and tried and true code for creating linked lists or writing logs to files that you can use. Libraries are prewrittend code you should learn to take to your advantage.
E.g. Boost library for C++ (for using perl-style regular expressions), PEAR for PHP, jQuery (for JavaScript that has code for basics like creating a slideshow when mouse hovers over buttons etc but of course you should learn the core JavaScript language first) etc.

The best thing about being a programmer/developer, whatever you call yourself is there are tons of resources online to learn. You don't have to take a formal course if you're curious. Google is your best friend to find answers. And practice really sharpens skills.

HTH
Last edited on
s/prewrittened/prewritten/

Your professor lied. Knowing how to do X in language Y means nothing.
Knowing how to think about problems is everything.

If you enjoy programming (as people here do ;-), just start writing stuff you want to do. This will require a lot of research and learning outside of any classroom context, but it is a wall everyone must scale to become a competent programmer.

The more you think about how to make things go the more smart you get. And, yes, that was a reference to what you think it was... And, no, I'm not implying anything here... I should be sleeping now but was kept up helping a friend, so my brain is a little addled at the moment.
how do I make a GUI? how do I make the code work with the GUI? how do I make it save the data, and bring it back when it is called?


The short answer is you ask the operating system nicely to change pixels on the monitor to the colours you want. The operating system provides a number of functions you can call to do this. There are also a number of libraries available to handle much of this for you so you can spend more time thinking: http://en.wikipedia.org/wiki/List_of_widget_toolkits

It must be about time I knocked together a standard answer to this question.
Last edited on
Well, the fact is that, start doing ascii art, or if you want to program ROB0t5, you should invest a little in circuit programming, pic programming, and all of that stuff.

If you want to make videogames, you should learn how to use game engines, and implement your c++ or other language into those.

for a "Magic GUI" you need to draw some Magic drawings, then, you will need to know how to put them inside your app.

if you feel comfortable with your c++ skill, start using the windows api.

You can do whatever you wish, well, almost, you can't for example, fly.
Moschops wrote:
It must be about time I knocked together a standard answer to this question.

When you do, put it in a nice Article and I'll link to it in the FAQ.
Thanks for all the answers, you've all been very helpful. I do know HTML/JavaScript/CSS/Java that I have taught to myself, and as far as the logic behind putting a program together, I'm capable of doing that, so I can learn without a professional at hand.

I'll see what I can do from here using your guidance, and will be sure to come back for help if I get stuck

Thanks again!


Look at not just the little details but the broad spectrum. What do you want to accomplish with your knowledge of software programming??? Get off the little picture get on the train with the big picture. I suffered from the same dilemma, find your passion in the field and accept that its impossible to learn everything. I learned a shitload from just coding by myself and trying and trying things. WINAPI, DirectX, Winsock, Bsd Sockets. Think about what you want to do overall, reach the goal and make modifications to it later when the product is finished.
Hi Patriots12,

I do GUI programming with Qt under Linux using Kdevelop as the IDE. Qt comes with all kinds of help, and is a well known mature application. There is also QDevelop (which is also availble on windows), but that is not as mature as KDevelop.

This is just my 5 cents worth, hope it helps

TheIdeasMan
While I definitely support the idea of learning Qt as by learning how to use Qt you'll be able to create a rather large range of applications with just that one library and some clever thinking...

@TheIdeasMan: What would be the advantages of using QDevelop over Qt Creator, the IDE that comes bundled with the Qt SDK?

-Albatross
@Albatross: Probably none - I just mentioned it as another option. I am not sure what is availible on all the different OS's, I noticed that it was availble on Fedora 16 (Rawhide) and that it was specifically for Qt.

TheIdeasMan
Topic archived. No new replies allowed.