Example-centric programming explained

Example-centric programming is an approach to software development that helps the user to create software by locating and modifying small examples into a larger whole. That approach can be helped by tools that allow an integrated development environment (IDE) to show code examples or API documentation related to coding behaviors occurring in the IDE. “Borrow” tactics are often employed from online sources, by programmers leaving the IDE to troubleshoot.[1] The purpose of example-centric programming is to reduce the time spent by developers searching online. Ideally, in example-centric programming, the user interface integrates with help module examples for assistance without programmers leaving the IDE. The idea for this type of “instant documentation” is to reduce programming interruptions.[2] The usage of this feature is not limited to experts, as some novices reap the benefits of an integrated knowledge base, without resorting to frequent web searches or browsing.

Background

The growth of the web has fundamentally changed the way software is built. Vast increase in information resources and the democratization of access and distribution are main factors in the development of example-centric programming for end-user development. Tutorials are available on the web in seconds thus broadening the space of who writes it: designers, scientists, or hobbyists. By 2012 13 million program as a part of their job, yet only three million of those are actual professional programmers.Prevalence of online code repositories, documentation, blogs and forums—enables programmers to build applications iteratively searching for, modifying, and combining examples.

Using the web is integral to an opportunistic approach to programming when focusing on speed and ease of development over code robustness and maintainability. There is a widespread use of the web by programmers, novices and experts alike, to prototype, ideate, and discover.[3]

To develop software quickly programmers often mash up various existing systems. As part of this process, programmers must often search for suitable components and learn new skills, thus they began using the web for this purpose.

When developing software programmers spend 19% of their programming time on the web. Individuals use the web to accomplish several different kinds of activities. The intentions behind web use vary in form and time spent. Programmers spend most of the time learning a new concept, the least time is spent reminding themselves of details of a concept they already know, and in between they use the web to clarify their existing knowledge.

Example-centric programming tries to solve the issue of having to get out of the development environment to look for references and examples while programming. For instance, traditionally, to find API documentation and sample code, programmers will either visit the language reference website or go to search engines and make API specific queries. When trying to learn something new, programmers use web tutorials for just-in-time learning. Additionally, programmers deliberately choose not to remember complicated syntax and instead use the web as an external memory that can be accessed when needed.

Benefits

Some of the benefits of example-centric programming include:

Emergent programming

See also: Emergence. Emergence can be defined as a process whereby larger entities, patterns, and regularities arise through interactions among smaller or simpler entities that themselves do not exhibit such properties. The extensive amount of code publicly available on the web can be used to find this type of patterns and regularities. By modeling how developers use programming languages in practices, algorithms for finding common idioms and detecting unlikely code can be created.

This process is limited to the amount of code that programmers are willing and able to share. Because people write more code than they share online there is a lot of duplicated effort. To fully use the power of the crowd, the effort required to publish code online should be reduced.[6]

Examples

Blueprint Blueprint is a plugin for Adobe Flash Builder that automatically augments queries with code context, presents a code-centric view of search results, embeds the search experience into the editor, and retains a link between copied code and its source. It is designed to help programmers with web searches and allow them to easily remember forgotten details and clarify existing knowledge.

It displays results from a varied set of web pages enabling users to browse and evaluate search results rapidly.

Blueprint is task-specific, meaning that it will specifically search for examples in the programming language.

Redprint Redprint is a browser-based development environment for PHP that integrates API specific "instant example" and "instant documentation" display interfaces. The prototype IDE was developed by Anant Bhardwaj, then at Stanford University on the premise that task-specific example interfaces leave programmers having to understand the example code that has been found, and thus Redprint also includes an API specific search interface.[2] The API specific search interface searches for relevant API specific examples and documentation.
Codex Codex is a knowledge base that records common practices for Ruby. Uses crowdsourced data from developers and searches all code, looking for patterns, that way if someone is coding in a strange way, Codex lets them know that they are doing something wrong.

Codex uses statistical linting to find poorly written code, or code which is syntactically different from well written code, and warn the user, pattern annotation to automatically discover common programming idioms and annotate them with metadata using crowdsourcing, and library generation to construct a utility package that encapsulates emergent software practice.

Codelets[4] A codelet is a block of example code an interactive helper widget that assists the user in understanding and integrating the example.
Bing Code Search [7] Bing Code Search is an extension to Microsoft Visual Studio developed by a team made of people from Visual Studio, Bing and Microsoft Research that allows developers to search code examples and documentation from Bing directly from IntelliSense.

Bing Code Search gathers its code samples from MSDN, StackOverflow, Dotnetperls and CSharp411.

Codota Codota helps developers find typical Java code examples by analyzing millions of code snippets available on sites such as GitHub and StackOverflow. Codota ranks these examples by criteria such as commonality of the coding patterns, credibility of the origin and clarity of the code.The Codota plugin for the IntelliJ IDEA and Android Studio IDEs allows developers to get code examples for using Java and android APIs without having to leave their editor.
UpCodeInUpCodeIn is a source code search engine that allows developers to find and reuse software components from the Internet. A unique feature of UpCodeIn compared to other source code search engines is its ability to find code for syntax element, for example you can find methods with specific parameter type, annotation, variables. UpCodeIn understand syntax of many programming languages like Java, JavaScript, Python and C#.

See also

External links

Notes and References

  1. Book: Scaffidi. Christopher. Brandt. Joel. Burnett. Margaret. Margaret Burnett. Dove. Andrew. Myers. Brad. CHI '12 Extended Abstracts on Human Factors in Computing Systems . SIG: End-user programming . 2012. 1193–1996. 10.1145/2212776.2212421. 9781450310161. 17748945 .
  2. Book: Bhardwaj. Anant. Luciano. Date. Klemmer. Scott. Proceedings of the 24th annual ACM symposium adjunct on User interface software and technology . Redprint . 2011. 21–22. 10.1145/2046396.2046408. 9781450310147. 23031454 .
  3. Book: Brandt. Joel. Guo. Philip. Lewenstein. Joel. Dontcheva. Mira. Klemmer. Scott. Proceedings of the SIGCHI Conference on Human Factors in Computing Systems . Two studies of opportunistic programming . 2009. 1589–1598. 10.1145/1518701.1518944. 9781605582467. 2907348 .
  4. Book: Oney. Stephen. Brandt. Joel. Proceedings of the SIGCHI Conference on Human Factors in Computing Systems . Codelets . 2012. 2697–2706. 10.1145/2207676.2208664. 9781450310154. 9811795 .
  5. Book: Fast. Ethan. Steffee. Daniel. Wang. Lucy. Brandt. Joel. Bernstein. Michael. Proceedings of the SIGCHI Conference on Human Factors in Computing Systems . Emergent, crowd-scale programming practice in the IDE . 2014. 2491–2500. 10.1145/2556288.2556998. 9781450324731. 10.1.1.645.4136. 2840903 .
  6. Book: Lieber. Thomas. Miller. Rob. Adjunct proceedings of the 25th annual ACM symposium on User interface software and technology . Programming with everybody . 101–102. 10.1145/2380296.2380342. 2012. 9781450315821. 1319863 .
  7. Web site: Shiban. Ala. Introducing Bing Code Search for C#. blogs.msdn.com. 17 February 2014 . 8 December 2014.