Example-centric programming

Last updated

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. [1]

Contents

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. [3] 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. [3]

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. [2] 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. [3]

Benefits

Some of the benefits of example-centric programming include:

Emergent programming

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. [5]

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 [1]

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 [2]

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 [5]

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.

UpCodeIn

UpCodeIn is a source code search 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

Related Research Articles

<span class="mw-page-title-main">Software</span> Non-tangible executable component of a computer

Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work.

An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as NetBeans and Eclipse, contain the necessary compiler, interpreter, or both; others, such as SharpDevelop and Lazarus, do not.

<span class="mw-page-title-main">Java (programming language)</span> Object-oriented programming language

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages. As of 2019, Java was one of the most popular programming languages in use according to GitHub, particularly for client–server web applications, with a reported 9 million developers.

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations that are often referred to by their own names. Almost all Windows programs interact with the Windows API. On the Windows NT line of operating systems, a small number use the Native API.

A software development kit (SDK) is a collection of software development tools in one installable package. They facilitate the creation of applications by having a compiler, debugger and sometimes a software framework. They are normally specific to a hardware platform and operating system combination. To create applications with advanced functionalities such as advertisements, push notifications, etc; most application software developers use specific software development kits.

AspectJ is an aspect-oriented programming (AOP) extension created at PARC for the Java programming language. It is available in Eclipse Foundation open-source projects, both stand-alone and integrated into Eclipse. AspectJ has become a widely used de facto standard for AOP by emphasizing simplicity and usability for end users. It uses Java-like syntax, and included IDE integrations for displaying crosscutting structure since its initial public release in 2001.

A programming tool or software development tool is a computer program that software developers use to create, debug, maintain, or otherwise support other programs and applications. The term usually refers to relatively simple programs, that can be combined to accomplish a task, much as one might use multiple hands to fix a physical object. The most basic tools are a source code editor and a compiler or interpreter, which are used ubiquitously and continuously. Other tools are used more or less depending on the language, development methodology, and individual engineer, often used for a discrete task, like a debugger or profiler. Tools may be discrete programs, executed separately – often from the command line – or may be parts of a single large program, called an integrated development environment (IDE). In many cases, particularly for simpler use, simple ad hoc techniques are used instead of a tool, such as print debugging instead of using a debugger, manual timing instead of a profiler, or tracking bugs in a text file or spreadsheet instead of a bug tracking system.

Clarion is a commercial, proprietary, fourth-generation programming language (4GL), multi-paradigm, programming language and integrated development environment (IDE) from SoftVelocity used to program database applications. It is compatible with indexed sequential access method (ISAM), Structured Query Language (SQL), and ActiveX Data Objects (ADO) data access methods, reads and writes several flat file desktop database formats including ASCII, comma-separated values (CSV), DOS (binary), FoxPro, Clipper, dBase, and some relational databases via ODBC, Microsoft SQL Server, Sybase SQL Anywhere, and Oracle Database through the use of accelerated native database drivers, and XML, Clarion can be used to output to HTML, XML, plain text, and Portable Document Format (PDF), among others.

A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging from widely used languages for common domains, such as HTML for web pages, down to languages used by only one or a few pieces of software, such as MUSH soft code. DSLs can be further subdivided by the kind of language, and include domain-specific markup languages, domain-specific modeling languages, and domain-specific programming languages. Special-purpose computer languages have always existed in the computer age, but the term "domain-specific language" has become more popular due to the rise of domain-specific modeling. Simpler DSLs, particularly ones used by a single application, are sometimes informally called mini-languages.

In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard way to build and deploy applications and is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate the development of software applications, products and solutions.

<span class="mw-page-title-main">X Toolkit Intrinsics</span>

X Toolkit Intrinsics is a library that implements an API to facilitate the development of programs with a graphical user interface (GUI) for the X Window System. It can be used in the C or C++ languages.

Google Developers is Google's site for software development tools and platforms, application programming interfaces (APIs), and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers using Google's developer products.

<span class="mw-page-title-main">JADE (programming language)</span>

JADE is a proprietary object-oriented software development and deployment platform product from the New Zealand-based Jade Software Corporation, first released in 1996. It consists of the JADE programming language, Integrated development environment and debugger, integrated application server and object database management system.

End-user development (EUD) or end-user programming (EUP) refers to activities and tools that allow end-users – people who are not professional software developers – to program computers. People who are not professional developers can use EUD tools to create or modify software artifacts and complex data objects without significant knowledge of a programming language. In 2005 it was estimated that by 2012 there would be more than 55 million end-user developers in the United States, compared with fewer than 3 million professional programmers. Various EUD approaches exist, and it is an active research topic within the field of computer science and human-computer interaction. Examples include natural language programming, spreadsheets, scripting languages, visual programming, trigger-action programming and programming by example.

An open API is a publicly available application programming interface that provides developers with programmatic access to a software application or web service. Open APIs are APIs that are published on the internet and are free to access by consumers.

ZK is an open-source Ajax Web application framework, written in Java, that enables creation of graphical user interfaces for Web applications with little required programming knowledge.

<span class="mw-page-title-main">API</span> Software interface between computer programs

An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build or use such a connection or interface is called an API specification. A computer system that meets this standard is said to implement or expose an API. The term API may refer either to the specification or to the implementation.

Software archaeology or source code archeology is the study of poorly documented or undocumented legacy software implementations, as part of software maintenance. Software archaeology, named by analogy with archaeology, includes the reverse engineering of software modules, and the application of a variety of tools and processes for extracting and understanding program structure and recovering design information. Software archaeology may reveal dysfunctional team processes which have produced poorly designed or even unused software modules, and in some cases deliberately obfuscatory code may be found. The term has been in use for decades.

GitHub Copilot is a cloud-based artificial intelligence tool developed by GitHub and OpenAI to assist users of Visual Studio Code, Visual Studio, Neovim, and JetBrains integrated development environments (IDEs) by autocompleting code. Currently available by subscription to individual developers and to businesses, the tool was first announced by GitHub on 29 June 2021, and works best for users coding in Python, JavaScript, TypeScript, Ruby, and Go.

References

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