1. Do Doc Examples Need To Repeat The Include Statement?

Since we show the include statement in the function definition, it doesn't seem necessary to put the include statement in the examples.

However, I do understand the need for functioning examples (that is, copy/paste and it works); I'm just not sure people aren't going to understand that you have to include the library that contains the function/procedure you're demoing.

What do y'all think?

new topic     » topic index » view message » categorize

2. Re: Do Doc Examples Need To Repeat The Include Statement?

Hi

From a beginners point of view, a functioning example should be a complete copy / paste and run, not a copy / paste and figure out why it crashes. So yes, I'm for a complete example.

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

3. Re: Do Doc Examples Need To Repeat The Include Statement?

Absolutely yes, they must all be working examples.

Note: there are a few example programs that access a file, those can't work unless that file exists. Those should have an explanation why that is the case.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Do Doc Examples Need To Repeat The Include Statement?

Or create the file.

Chris

new topic     » goto parent     » topic index » view message » categorize

5. Re: Do Doc Examples Need To Repeat The Include Statement?

ChrisB said...

Or create the file.

Chris

Yes, and in the case where a binary file is created, note that the file will not be readable with normal text editors, etc. in case someone wants to look. (I did!)

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu