Skip to content

Should code examples be self-contained? #303

@rcseacord

Description

@rcseacord

What should our code examples look like?

Should the code be copy-pastable so it will compile?
If that's the case, having at a minimum a main() { /* ... */ } visible in every example is helpful or we should communicate somehow that it may be needed when people are copy-pasting snippets.

Or maybe code snippets should be in self contained functions that won't build without a main?

Metadata

Metadata

Assignees

Labels

contributor experienceRelated to making contributions easierdocumentationImprovements or additions to documentationhelp wantedExtra attention is neededquestionFurther information is requested

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions