Software Coding Example
A Software Coding Example is a software fragment that is an example (demonstrating programming concepts and implementation techniques).
- AKA: Code Sample, Programming Example, Code Demonstration.
- Context:
- It can typically demonstrate Programming Patterns through implementation techniques.
- It can typically illustrate Software Design through code structures.
- It can typically explain Algorithm Implementation through step-by-step code.
- It can typically showcase Best Practices through practical implementations.
- ...
- It can be associated to a Software Coding Question.
- It can be the output of a Software Coding QA Task.
- It can support Software Documentation through example code.
- It can facilitate Code Learning through demonstration snippets.
- ...
- It can be an Imperative Programming Example, a Functional Programming Example, Object Oriented Programming Example, Declarative Programming Example, Concurrent Programming Example.
- It can illustrate a Programming Concept.
- It can illustrate a Syntactic Nuance.
- ...
- It can range from being a Pseudo Code Example to being a Production Code Example, depending on its implementation completeness.
- It can range from being a Basic Code Sample to being a Complex Implementation Example, depending on its complexity level.
- It can range from being a Single Line Example to being a Full Program Example, depending on its code scope.
- ...
- It can range from being
- a Data Reading Coding Sample Fragment for input processing,
- a Data Structure Definition Coding Sample Fragment for data organization,
- a Control-Flow Coding Sample Fragment for execution flow,
- a Data Transformation Coding Sample Fragment for data processing,
- a Data Outputting Coding Sample Fragment for result presentation,
- a Predictive Modeling Coding Sample Fragment for model implementation,
- a Error Handling Coding Sample Fragment for exception management,
- a Integration Coding Sample Fragment for system connection,
- a Testing Coding Sample Fragment for code verification,
- ...
- Example(s):
- Programming Language Examples, such as:
- Python Coding Examples for python implementations.
- Java Coding Examples for java implementations.
- Scala Coding Examples for scala implementations.
- R Coding Examples for r implementations.
- SQL Coding Examples for database querys.
- Prolog Coding Examples for logic programming.
- Perl Coding Examples for text processing.
- Implementation Type Examples, such as:
- ...
- Programming Language Examples, such as:
- Counter-Example(s):
- a Software Test, which verifies code functionality rather than demonstrates implementation techniques.
- a Writing Style Example, which demonstrates text formats rather than code structures.
- a Code Comment, which explains code purpose rather than demonstrates implementation.
- See: Data Structure, Software Program, Code Pattern, Programming Tutorial, Learning Resource.
References
2018
- (Horton & Parnin, 2018) ⇒ Eric Horton, and Chris Parnin. (2018). “Gistable: Evaluating the Executability of Python Code Snippets on GitHub.” arXiv preprint arXiv:1808.04919
- ABSTRACT: Software developers create and share code online to demonstrate programming language concepts and programming tasks. Code snippets can be a useful way to explain and demonstrate a programming concept, but may not always be directly executable. A code snippet can contain parse errors, or fail to execute if the environment contains unmet dependencies.
This paper presents an empirical analysis of the executable status of Python code snippets shared through the GitHub gist system, and the ability of developers familiar with software configuration to correctly configure and run them. We find that 75.6% of gists require non-trivial configuration to overcome missing dependencies, configuration files, reliance on a specific operating system, or some other environment configuration. Our study also suggests the natural assumption developers make about resource names when resolving configuration errors is correct less than half the time.
We also present Gistable, a database and extensible framework built on GitHub's gist system, which provides executable code snippets to enable reproducible studies in software engineering. Gistable contains 10,259 code snippets, approximately 5,000 with a Dockerfile to configure and execute them without import error. Gistable is publicly available at this https URL
- ABSTRACT: Software developers create and share code online to demonstrate programming language concepts and programming tasks. Code snippets can be a useful way to explain and demonstrate a programming concept, but may not always be directly executable. A code snippet can contain parse errors, or fail to execute if the environment contains unmet dependencies.