What are the most F.A.Q. on this forum?

Pages: 12345
C++ is specifically a superset of C90 (with minor unavoidable differences). I don't think it much of a stretch to answer C questions on a C++ forum, considering how tightly bound the two languages are. Especially given that googling around C questions will bring you here.

Personally, I learned C before C++, but became really proficient with them only after years of messing with, among other things, other languages.

However, you do have a point, especially given that googling around C++/CLI questions will bring you here.

Does this forum have a policy on stuff like that? Some sites will politely tell you that, simply, it is an X forum, and you need to visit the Y forum for help with your question. Perhaps again an Article is a good idea for CLI? Or a FAQ subsection for CLI/MFC/etc?

I personally think that pointers are very straight-forward, but they do need to be properly explained. (We'll see if I can do that succinctly.)

I agree that homework questions are significant. What I am saying is simply that we should not provide a cheat-n-answer for every student taking their first C++ course to solve the star pyramid problem, or anything like that.

Perhaps the FAQ should answer questions like that with something along the lines of:
"Alas, you need to figure this stuff out to begin to understand the concepts underlying all future study in computer programming. However, here are some things/techniques/idioms that you need to know in order to be able to solve your homework question. We suggest you begin with them and then think about how to apply your new knowledge to solving the problem." (Please remember, that tact is much more important in an actual FAQ than I use here, where bluntness and brevity should suffice.)

You may have a good point though: I can see a "Common Homework Problems" section of the FAQ listing things like "Star Pyramid" and "Towers of Hanoi" and "Palindromes" and the like. Simple questions like "how do I read a file" really only need a pointer to the Tutorial.

My $0.02
Does this forum have a policy on stuff like that? Some sites will politely tell you that, simply, it is an X forum, and you need to visit the Y forum for help with your question. Perhaps again an Article is a good idea for CLI? Or a FAQ subsection for CLI/MFC/etc?

Well, the windows forum does list C++/CLI in it subtitle. So we can't really ignore it. At the very least the FAQ should make the reader aware that they (C++ and C++/CLI) are not the same. But that does lead to where to drawn the line. If you are using C++/CLI then you are targeting the CLR, that really has nothing to do with C++.
A dedicated C++/CLI section would increase traffic quite a bit, I'd assume. I know what a few of us here have quite a bit of experience with the .NET framework, so member competence shouldn't be an issue. I personally find the .NET framework to be absolutely great to work with, and I haven't written any windows-target GUIs in any other languages since I learned it. Then again, I've had the benefit of not having to support any legacy apps.
Last edited on
Duoas wrote:
I agree that homework questions are significant. What I am saying is simply that we should not provide a cheat-n-answer for every student taking their first C++ course to solve the star pyramid problem, or anything like that.

I am well-aware of this concern (you are not alone). It's debatable, IMO, but that doesn't change the fact that those questions are asked frequently. A discussion that breaks it down row by row and explains the purpose of for loops may suffice.

That's where I am not too sure about it.

There ought to be some struggle involved in figuring out problems. Unless you have an exceedingly bad professor (who only gives scrambled notes and textbooks are not available and you live away from the library and have no access to the internet) then you should have had at least some good reading about loops and how to employ them.

In the proper pedagogy, exercises like the star pyramid are designed to allow students to put in practice a variation on something already covered in class/in the textbook. The student must struggle to discover the relationship between the loop variable and the number of stars to print, and then recognize that printing a sequence of stars is simply a job for a (another) loop.

If you spoon feed students too much, they go away having an underdeveloped, yet requisite, skill in problem solving for computer programming, and a false confidence in their "ability" to "find solutions."

You have won me over to the idea of having a homework problems section in the FAQ, but I still think that we need to be very careful to avoid any simple walk-throughs, answers, or even some obvious hints. If we do that, I think we will be working against the goals of instructors and honest students alike.

An aside to explain. My first time through calculus I got a D. (I took it again to get a better grade.) I very distinctly remember sitting in class and having the discussion abruptly go over my head. I thought maybe I had unknowingly dozed-off for a few minutes. Mind you, I had kept up on my homework and readings!

As I struggled to get my head around it, it usually came before too long. But I had particular trouble integrating a common function -- so I went to the university "help center" to ask for help. The student there who actually knew calculus said, "Oh, I know this one," and proceeded to solve it.

That didn't help me. In fact, it rather upset me, because I felt cheated of learning how to think through the problem. I went home and for a solid week spent extra time working through weird integrals until I began to recognize and understand the common patterns, until it was blindingly obvious how the problems were solved.

Just showing someone the answer doesn't equip them to work out answers themselves.
Duoas wrote:
What do you dislike about Zaita's article?

It's short and a bit incoherent. It mentions cin and getline problem but doesn't say how to solve it. It mentions that cin >> stringvar doen't check length (I assume he meant cin >> charptrvar), but there is no explanation of the dangers of that. He uses stringstream without explaining what it is. If I were a beginner, the line "if(myStream >> myNumber)" would leave me utterly confused. Lastly, it doesn't mention the internal flags at all.
That is true, but Zaita is using a hackerism that demonstrates through example.

I agree that it could use some better organization and cleanup though.

I don't think a FAQ need go into great detail about everything a piece of "Right Way" code works... All learning with programming takes some idioms on faith -- until the programmer understands it better.

But then... perhaps the user wants details. I think a FAQ should answer a question as simply as possible, and provide links for more detail.
I don't think a FAQ need go into great detail about everything a piece of "Right Way" code works...
Then it's somewhat of a cookbook we're talking about? I guess you really can't fit a proper explanation in a faq.. I find cookbooks very useful when I want to learn a new language. It's hard to say whether a cookbook is any good for someone who lacks basics though..
Then it's somewhat of a cookbook we're talking about?
Er, maybe. A FAQ should be a good answer to frequent questions. Some questions are basically asking for code snippets.

My Clear the screen Article ( http://www.cplusplus.com/articles/4z18T05o/ ) takes exactly that approach: name your system etc and here is the code to clear the screen, plus some small lecturing about it, including an introductory proviso against just doing it because you can and a link to more information you should consider before doing it.

FAQs about goto and "NULL for integers" will probably have little to no code, and more an expository romp explaining what is a better way to think about it (in terms of C and C++).

Remember, all this is my opinion, so if you disagree please post so we can get a consensus before these FAQs start getting drafted.
twicker wrote:
Which would you say are the most frequently asked questions here?
The FAQ article (information section) badly needs a rewrite, and the forum's input can be really valuable for that.

The Current FAQ[1] asks:
C++ Language FAQ
What is C++?
Is it necessary to already know another programming language before learning C++?
How can I learn C++?
What is OOP: Object-oriented programming?
Is C++ a proprietary language?
What is ANSI-C++?
How may I know if my compiler supports ANSI-C++?
How can I make windowed programs?
What is Visual C++? And what does "visual programming" mean?

While I think that a FAQ to rival parashift[2] would be a noble effort, I think that it may well be best to just limit the scope initially to what would be appropriate for the information section initially.

To handle a larger FAQ would probably require some collaborative editing tools and/or maybe a forum dedicated to the production of the FAQ.

'The first rule of FAQ club...'

Grey Wolf

[1] http://www.cplusplus.com/info/faq/
[2] http://www.parashift.com/c++-faq-lite/
I agree that our FAQ should be relatively simple, and in no way should we even try to rival parashift's. However, as it stands the current FAQ is rather small...

Part of this discussion, I think, is that twicker would like to expand the FAQ a bit for several purposes:

    1 - to bring it up-to-date
    2 - to increase its use to match the prominence of this site on the web
    3 - to have a clear, well-thought answer rather than much of the scattered stuff and misinformation that winds-up in the forums.

On this last one I have found that even my good responses are often scattered around several posts, and that correct information has to compete equally with incorrect information in a thread. I commonly find that I will post an answer to "how do I clear the screen" to have it immediately followed by some newbie HS-student posting "just use system(cls) man". It would be nice to have a simple reference to a common question that says: "read this, it will cover most (if not all) your questions about this issue," and that really does provide a succinct, easily digestible read and links to more reading for those who care.

Again, I don't think we are looking to go overboard on this. The tools we already have are sufficient. Twicker can easily provide some sort of test/submitted for approval spot that exists until the FAQ has finally finished the vetting process. I was even going to use my own web space to throw some mock-up ideas that we could discuss and vote on here.

Grey Wolf you don't accept PMs.
Last edited on
Q: What is the best book to learn C++ from?

A: Highly commended books include:
~ Programming: Principles and Practice using C++ by Stroustrup [For absolute beginners]
~ C++ Primer, Fourth Edition by Lippman, Lajoie and Moo
~ The C++ Programming Language, Third Edition by Stroustrup [For experienced Programmers]
~ etc.. {need a couple more ?}

Books are subjective, you may not like a book that has been recommended by others.
The best advice would be to make a list of potential books and then go to your local
bookstore or library. Spend some time reading and decide which one best gels with you.

Also See: Book Of Brilliant Things. http://www.cplusplus.com/articles/GLzyhbRD/

Note: I am going to rework Book Of Brilliant Things, it looks like it got a bit mangled.

Last edited on
I think the FAQ should go into greater detail regarding Windowed applications / Multimedia / Networking, name some IDE's that are actually still being maintained and warn of tools that aren't. Some introduction - or better, links to introductions - to using either the GNU toolchain or Visual C++ should probably go somewhere in there as well.

Oh, and a quick note on that you'd first have to pick up some basic programming skills before attempting to write complete games. I mean, something like TicTacToe or guessing numbers is probably fine, but we all know that anything larger requires at least some more organizational skills than the typical beginner has or could have, even if no part in itself is particularily hard to program.

While we're at it, some mention of popular coding conventions and file organization should go in there as well - while it's not strictly C++ related, it's an important topic that might take a beginner a while to stumble across on his own (especially people with a mathematical background are often prone to using 1 letter variables after all).

Oh and maybe drop a hint somewhere that it's probably a good idea to write your code in english, especially if it's something that will at some point require you to seek help somewhere.

I'd also find a section about some more "meta" stuff, like source control, or how to publish open source software useful.

Actually, I'm derailing quite a bit from what you'd normally think of when hearing "C++ FAQ", aren't I? Sorry, that's the result of my latest brain wiki walk storming.
Writing games is #26
Most of those other things I think are Article things, methinks.

I think it is an interesting idea to have some FAQs be a simple reference to an article, maybe? I'm not entirely convinced, though.
'The first rule of FAQ club...'

Can we all agree on the following:

1 - FAQs should have the following format: a terse, simple answer followed by a more detailed answer, plus relevant links for more in-depth reading.

2 - Homework questions should be "you need to figure this out on your own", with a possible additional reading on relevant skills that the student will have already covered in class.


Is anyone else willing/got the time to help put some meat on the bones so to speak?
We still need to formulate specific questions for the areas that have been identified.

I agree that most of these are questions that are best answered in an article - actually, linking to articles would be what I had in mind as well.

@Grey Wolf

I agree with 1/2. Do you think we should just formulate the questions, or first collect some data on exactly how these questions are normally asked? I ask this because many of these are typical beginner questions asked by people who might not be familiar with a lot of technical vocabulary.

Sorry, by 'formulate specific questions', I mean decide what it is that usually gets asked and how to phrase a question so that people can recognise that that is the question that they want answering.
Grey Wolf + 1

I had also been thinking about how to list questions in the FAQ so that the user will recognize it.
Perhaps we should list multiple questions to link to a single answer, when multiple ways of asking the same question exist.
I have posted updates. See http://www.cplusplus.com/forum/lounge/60389/#msg326397 and the link to my mockup site.

What I would like feedback on is:

    1. presentation
    2. appropriateness
    3. correctness

Remember that this is just a mockup, and (I think) I do not have access to this site's markup engine to make fancy duplicates -- my html and css skills are fairly basic and not the point anyway. Also, I have not yet run anything through spell-checkers or HTML/CSS validators.

In particular, I would like review on the following:

    1. home page
    2. introduction: 001, 002, 006, 009, 003, 004 (the first six items)
    3. arrays, etc: contents, 008-3, 078, 008-2, 055

I would also like some help drafting some of the sections... If you feel like writing a little markup (please use what I have provided so I can just stick what you write into my markup without much grief), please PM me or send me at michael.thomas.greer over on google's mail.

Please do not PM or mail me discussion items, such as what you think needs to be fixed or done. Post that here.

Very nice work so far! I see it's incomplete, I'm so glad for that - we wouldn't want you slaving away!
Pages: 12345