cant understand what or where to use...

hi .. to all..
my name is Muhammad Waqas ...and i am new to programming ...
i am bit confused in programing....i know that C and C++ is console programming language and C# is for making softwares with GUI ....The qus is that ...i dont understand ...when i will be needing C++ ...taking example of Google Chrome ..it is written in C++ and Assembly but it have GUI........
i hope have i express my qus in detail or you can ask me ..any thing about my qus....
thx..
Last edited on
You are incorrect. C++ is a general purpose language. It is used for GUI programming.
i am using Microsoft VS2008 and write a program it run in dos..why is that ..
and as i am a starter so plz i am so confused that how can i start real programing ....like making my own softwares ...
Last edited on
It is not DOS, it's a Windows Console program.

You need to find a good MFC tutorial. MFC (Microsoft Foundation Classes) is the defacto Windows C++ library.
i dont know how to express my question ...the thing is that i know programing but dont know how to start ...how to make my own softwares...why ...thing like MFC and STL confuted me ...what are these thing ..and when and where to use them....
MFC is the C++ wrapper for the Windows library. You can use it to make your program do whatever Windows can do.
STL (Standard Template Library) is part of C++ and it can be used mainly for it's containers (and algorithms which work with containers) - http://www.cplusplus.com/reference/stl/ http://www.cplusplus.com/reference/algorithm/
closed account (S6k9GNh0)
I don't think he understands what C++ is in general. C++ is very low level. You can do anything with it. When you start an executable it starts a console-based program because that is the default for output. You can create a window by calling certain operating system-based calls but this requires more work, code, and detail. Perhaps you should study the ethics of programming before starting C/++. Try studying a small amount of ASSEMBLY and how assembly works and then try moving to C++. Be sure to try and understand it before moving on though because it does help a lot with confidence and concept understanding.
C++ isn't 'very low level', 'very low level' means assembly...
C++ is an intermediate/medium level programming language.
Try studying a small amount of ASSEMBLY and how assembly works and then try moving to C++.
BAD advice! Never start with assembly; it's hard as hell. And there are very few 'good' tutorials. I read one and now I have to learn it again because the tutorial was outdated, for an assembler written for 16-bit DOS which contains everything in a single segment and a stack inside a <= 64K .COM file... it's a good assembler but it's outdated.

I'd learn something like Python first. It's excellently designed and very easy; but at the same time it's fairly powerful and is a real and mature language. It teaches good programming style through it's forced consistency (throws errors if your indentation is inconsistent or if you use tabs and spaces, not one or the other) and as such is a brilliant first language.

I would learn Python and then C or C+, and maybe asm if you want to do systems programming or speed-critical code.
Last edited on
^I would suggest not learning C at all (if you can avoid it), and just learning C++. I agree Python is probably a better start though.
I would suggest not learning C at all

Unless you want to do systems programming or you want to make GNU programs which are almost all written in C...
Plus most example code should be written in C unless it relates to some specific language other than C. For example, C is not the only language which supports, for example, variadic functions; however as C is probably more popular than the others which do; it would make more sense to have the example code in C than, for example, Haskell or Ruby.

I agree that C++ is better, though. While I don't really use OOP (I don't like it) I think the STL is excellent; vectors, templates, the boolean data type, they are very useful things that C doesn't have.

If you want to know, I don't like OOP because I don't see the advantages of it, although that's probably because I've never learnt it or anything about it and thus I don't see the benefits of it. Similarly I didn't use to see the benefits of pointers until I learnt them (although I recognised a need to learn about them).

I also hate anything to do with databases; which probably stems from my dislike of making databases in horrible programs like MS access.
Last edited on
It is best to learn C++ directly and to never waste time with C. If for some reason you must later program in C, you can quickly learn to give up the conveniences of C++ and learn C style. There won't be unlearning involved, because C simply doesn't support C++ techniques. If you learn C before C++, as I did, you will have to unlearn C style and C constructs.


As for why OOP is useful, have a look at this:
http://en.wikipedia.org/wiki/Object-oriented_programming#Fundamental_concepts_and_features

Obviously it is not the best solution to all problems, but it is useful in many situations.

Oh, and also, from Stroutstrup:

C is better than C++ for small projects, right?
Not in my opinion. I never saw a project for which C was better than C++ for any reason but the lack of a good C++ compiler.
Last edited on
True, but as this guy said on a google result from searching that quote above;
"I spent several months programming in Java. Contrary to its author's prediction, it did not grow on me. I did not find any new insights - for the first time in my life programming in a new language did not bring me new insights. It keeps all the stuff that I never use in C++ - inheritance, virtuals - OO gook - and removes the stuff that I find useful. It might be successful... but it has no intellectual value whatsoever" - Alexander Stepanov

This is a quote which I found on this page http://nuwen.net/gcc.html
This "Alexander Stepanov" guy doesn't like OOP either :)

Since 90% of programmers are incompetent

I hope I'm not part of that 90% :(

Edit:
I've changed my mind. I don't like this guy any more:
In order to program C++, you will need several things. These include:

* A modern computer.
* A compiler.
* An editor.

since when do you need a modern computer to run C++? C++ is just as efficient as C (if not more so in some cases) and C was used for UNIX. The command line editor, ed, was specifically designed to be efficient and not require much memory (hence why '?' is it's error message and why it doesn't print the text in the file unless you tell it to).

I will assume that your computer runs Windows XP. This is the most modern Windows operating system and I have no sympathy for you if you run anything older.

Well that's just ridiculous. "I assume you use windows because it's popular and if you use anything else, tough. If you use some older windows because you don't care for wasting your money just because some faceless company tells you to, or for any other reason*, tough." is essentially what he is saying there.

He then goes on to say how a compiler is, and I quote "magic". What the hell? A compiler isn't "magic" it's just complicated (or "compile-icated" (couldn't resist)). It turns source code into object code or maybe machine code. That's all it does. Then it maybe invokes a linker for you to create binary files. That isn't magic, it's just good programming. Making a physical CPU, motherboard, memory, etc. from a bunch of ICs, transistors and little pieces of metal and having them work together and run software is magic.

Does he just expect everyone else to be stupid? People aren't going to become competent programmers if you treat them like idiots and tell them that software is magic because it's hard to make. That will make them a) feel like children or b) make them pursue some kind of weird cult of wizards (and I don't mean wizardly programmers) who turn software into gold or something.

* Such as some critical software that doesn't work in XP; I've heard alot of this. In fact, the father of one of my friends is in this predicament -- he has some expensive software written fro XP and can't switch to vista because it would be too expensive or possibly the project is discontinued, or maybe both -- I can't remember. The point is that saying something like that is stupid even if that isn't what he meant.

Anyway that's enough raging out of me, I need to go study pointers in-depth :(
Only 7 more chapters... I can't believe this guy wrote so much, I'm glad he did, though, because the tutorial is excellent; http://home.netcom.com/~tjensen/ptr/ I need to understand pointers completely; ins-and-outs... I just wish there was a tutorial on ASM that was this good. I've looked at about ten and they were all irrelevant or bad. About three of them were using NASM (when I specifically searched for "asm +linux at&t +tutorial" in Google) which uses intel syntax (which I don't want because I want to use AT&T syntax. Something to do with how UNIX used to belong to AT&T and how GNU AS usually uses AT&T syntax (although it can use intel syntax, I'd rather use AT&T)).
Last edited on
Topic archived. No new replies allowed.