FAQ topic pointers

D

David Fisher

I have read the FAQ, and I search it quite often. But this time
I didn't know what to search for. Now I know that I could have
searched for "initializaion", and found FAQ 10.6, but hey, I can't
read the whole FAQ through every time I have a question, can I...?

Just a thought ... how about having a sample C++ program for the FAQ that
contains pointers to relevant topics throughout the code ?

For example (assume prefix http://www.parashift.com/c++-faq-lite/ for
references):


/*** Classes and objects: classes-and-objects.html ***/

class ExampleClass // naming conventions: coding-standards.html#faq-27.11
{
// class members private by default: classes-and-objects.html#faq-7.8
int _privateMember; // naming conventions:
coding-standards.html#faq-27.11

public: // member access (public, private and protected):
basics-of-inheritance.html#faq-19.5

/*** constructors: ctors.html ***/

// default constructor: ctors.html#faq-10.4
// (see also Arrays and default constructors: ctors.html#faq-10.5)
ExampleClass();

ExampleClass(int value)
: _privateMember(value) // initialisation lists vs. assignment:
ctors.html#faq-10.6
{
// inline functions in class body: inline-functions.html#faq-9.8
}
};

It could be hard to know where to put some things, and there could be some
duplication - but this could be way to help people locate pointers into the
FAQ.

Or does something like this already exist ?

David F
 
V

Victor Bazarov

David Fisher said:
I have read the FAQ, and I search it quite often. But this time
I didn't know what to search for. Now I know that I could have
searched for "initializaion", and found FAQ 10.6, but hey, I can't
read the whole FAQ through every time I have a question, can I...?

Just a thought ... how about having a sample C++ program for the FAQ that
contains pointers to relevant topics throughout the code ?
[...]
It could be hard to know where to put some things, and there could be some
duplication - but this could be way to help people locate pointers into the
FAQ.

Good idea. Two doubts, though. If (rather, since) such a program does not
exist, would you write one? Once written and placed where available, how to
make sure all newbies actually look at it before posting?

V
 
D

David Fisher

Victor Bazarov said:
In a recent message, "Re: Two questions about...something", Fred H wrote:

Just a thought ... how about having a sample C++ program for the FAQ that
contains pointers to relevant topics throughout the code ?
[...]
It could be hard to know where to put some things, and there could be some
duplication - but this could be way to help people locate pointers into
the FAQ.

Good idea. Two doubts, though. If (rather, since) such a program does not
exist, would you write one? Once written and placed where available, how to
make sure all newbies actually look at it before posting?

Thanks -

I think I would by happy to do this ... depends on available time. The basic
idea might be:

- aim is to give an easily-locatable example of each kind of construct
mentioned in the FAQ
- code does not have to do something particularly useful, but should be
complete (compilable) and correct (no undefined behaviour)
- references are just to FAQ, not to other documents (the C++ standard,
etc.)
- include some examples of errors as well (syntactic or semantic) - but
just stick to the ones that are mentioned in the FAQ

I just wrote and asked Marshall Cline (owner of C++ FAQ Lite) what he
thought about this kind of thing. It's up to him, but it would be helpful to
have a pointer to the sample code on the main FAQ page (it's his document,
though ! :)

David F
 
D

David Fisher

David Fisher said:
[snip]
I just wrote and asked Marshall Cline (owner of C++ FAQ Lite) what he
thought about this kind of thing. It's up to him, but it would be helpful to
have a pointer to the sample code on the main FAQ page (it's his document,
though ! :)

Marshall just sent a reply saying:

Very interesting idea. I suppose one could add to that all sorts of other
stuff, like operator overloading, default parameters, etc. The way I'd like
to do it would be to put links on all those things so that a user can simply
(at least when they view the stuff as HTML) simply click on a syntax-snippet
to get the corresponding subject.

Yes, please go for it. Use some simple syntax, such as <LINK:10.3> to
indicate that the preceding element should link to FAQ 10.3. Whatever
syntax you use, I'll modify it via a Perl script or something and will use
that to build the "real" solution. You can add a few things in as comments,
but as much as possible I'd prefer the hyperlink to go on the code snippet
itself - it will make the example less cluttered.

---

So I'll have a try and see how it goes ...

Code suggestions welcome,

David F
 
G

Gianni Mariani

David Fisher wrote:
....
So I'll have a try and see how it goes ...

Code suggestions welcome,

Does it need to do somthing useful ?

If it does - how about using some of my (yet to be published) library ?
(That'll force me to publish the darn thing).
 
O

osmium

Gianni Mariani said:
David Fisher wrote:
...

Does it need to do somthing useful ?

If it does - how about using some of my (yet to be published) library ?
(That'll force me to publish the darn thing).
 
O

osmium

Gianni said:
Does it need to do somthing useful ?

No, it definitely should *not* be something useful! Teach one thing at a
time, the things you are trying to teach are syntax and semantics. Short
meaningless identifiers so no one struggles to attach some meaning to them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top