diff --git a/CONTRIBUTING/index.html b/CONTRIBUTING/index.html index 24e5c48..342945a 100644 --- a/CONTRIBUTING/index.html +++ b/CONTRIBUTING/index.html @@ -1,10 +1,10 @@ -Contributing | GitHub Copilot Patterns & Exercises +Contributing | GitHub Copilot Patterns & Exercises
Contributing -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Contributing to GitHub Copilot Patterns & Exercises #

The goal of the GitHub Copilot Patterns & Exercises Working Group is to collect, document, and publish best practices for GitHub Copilot Patterns & Exercises. To ensure they are easy to understand, evaluate, and apply, we present them in a specific structure.

We welcome your participation, whether you make minor or major contributions, to help this working group function actively.

How to Contribute #

Please consider contributing to GitHub Copilot Patterns & Exercises. Below are some suggestions on how you can contribute.

\ No newline at end of file diff --git a/categories/index.html b/categories/index.html index df892ab..7e585c9 100644 --- a/categories/index.html +++ b/categories/index.html @@ -5,5 +5,5 @@ English
Categories -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ
\ No newline at end of file diff --git a/client-tips/copilot-snippet-handling/index.html b/client-tips/copilot-snippet-handling/index.html index c358ef8..2cf7488 100644 --- a/client-tips/copilot-snippet-handling/index.html +++ b/client-tips/copilot-snippet-handling/index.html @@ -1,10 +1,10 @@ -Copilot Snippet Handling | GitHub Copilot Patterns & Exercises +Copilot Snippet Handling | GitHub Copilot Patterns & Exercises
Copilot Snippet Handling -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Copilot Snippet Handling #

{% hint style=“info” %} While this is accurate as of August 2023, the situation may change as GitHub Copilot and the LLM behind it evolve. Always try to get the most up-to-date information from GitHub. @@ -20,5 +20,5 @@ answer = substruct_numbers(1, 2) + add_numbers( # <GitHub Copilot will suggest the code by reading the tab 1 >

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/client-tips/github-copilot-shortcuts/index.html b/client-tips/github-copilot-shortcuts/index.html index 4762e66..3e1dd5c 100644 --- a/client-tips/github-copilot-shortcuts/index.html +++ b/client-tips/github-copilot-shortcuts/index.html @@ -1,14 +1,14 @@ -GitHub Copilot Shortcuts | GitHub Copilot Patterns & Exercises +GitHub Copilot Shortcuts | GitHub Copilot Patterns & Exercises
GitHub Copilot Shortcuts -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

GitHub Copilot Shortcuts #

Description #

GitHub Copilot provides developers with a set of keyboard shortcuts to accelerate the coding process. These shortcuts make the navigation and interaction with GitHub Copilot’s AI-driven suggestions more intuitive and efficient. In this pattern, we will explore the keyboard shortcuts that are essential for rapid code development with Copilot.

Example #

For example, to accept a suggestion from Copilot, you can simply press the TAB key. Here’s a list of some key shortcuts:

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/client-tips/go-to-definition/index.html b/client-tips/go-to-definition/index.html index 3a0dff1..5261aae 100644 --- a/client-tips/go-to-definition/index.html +++ b/client-tips/go-to-definition/index.html @@ -1,10 +1,10 @@ -Go to definition | GitHub Copilot Patterns & Exercises +Go to definition | GitHub Copilot Patterns & Exercises
Go to definition -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Go to definition #

{% hint style=“info” %} GitHub Copilot will not read all codebases as of August 2023, so there will be occasions when this technique will be necessary. On the other hand, there is a possibility that in the near future this technique will no longer be needed in GitHub Copilot, and this technique may be very limited. @@ -12,5 +12,5 @@ #

When working with a complex codebase, jumping between files or searching through layers of code to find the definition of a particular symbol can be cumbersome. “Go to Definition” is a useful feature in Visual Studio Codethat allows developers to quickly navigate to the definition of a symbol in the current file. This not only enhances productivity but also enables better understanding of the code structure. GitHub Copilot will read open tabs. So, you can also pass relevant code snippets related to the symbol definition to GitHub Copilot

Example #

To use the “Go to Definition” feature in VS Code, simply right-click on the symbol you want to explore and select “Go to Definition.” You can also use the shortcut F12. Here’s how you can do it:

Exerecise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/client-tips/index.html b/client-tips/index.html index 6b1ba9f..4827203 100644 --- a/client-tips/index.html +++ b/client-tips/index.html @@ -5,5 +5,5 @@ English
Client-tips -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ
\ No newline at end of file diff --git a/client-tips/pin-the-file-you-need/index.html b/client-tips/pin-the-file-you-need/index.html index 52b51b6..563591a 100644 --- a/client-tips/pin-the-file-you-need/index.html +++ b/client-tips/pin-the-file-you-need/index.html @@ -1,14 +1,14 @@ -Pin the files you need | GitHub Copilot Patterns & Exercises +Pin the files you need | GitHub Copilot Patterns & Exercises
Pin the files you need -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Pin the files you need #

Description #

The effectiveness of GitHub Copilot depends on the context provided to it. GitHub Copilot searches through open tabs by text similarity, sending snippets to the Large Language Model (LLM), which itself is a complete black box. Therefore, we must be mindful of the context we want to provide. In programming, files such as declaration files (d.ts), test files, and interface files contain a wealth of context information. By using Visual Studio Code’s pinning feature, you can easily access these files when needed and provide information to GitHub Copilot more efficiently.

Example #

Here’s how you can pin a file in Visual Studio Code:

  1. Open the file you want to pin.
  2. Right-click on the file tab.
  3. Select “Pin Tab” from the context menu.

Exerecise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/collaboration/ai-friendly-documentation/index.html b/collaboration/ai-friendly-documentation/index.html index 8af70d3..a695c0c 100644 --- a/collaboration/ai-friendly-documentation/index.html +++ b/collaboration/ai-friendly-documentation/index.html @@ -1,10 +1,10 @@ -AI friendly documentation | GitHub Copilot Patterns & Exercises +AI friendly documentation | GitHub Copilot Patterns & Exercises
AI friendly documentation -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

AI-friendly documentation #

Description #

In the era of GitHub Copilot, an AI powered coding assistance tool, having easily accessible documents in text format becomes crucial. In the AI era, files such as Infrastructure as Code, database table specifications, test requirements, and more have the potential to be instantly transformed into actual code. Rather than dealing with complex Excel, PowerPoint files, PDFs, or image formats, AI will be able to assist your coding efforts collaboratively through text-based documents.

Let’s check if the following files are text-based or AI friendly:

Example @@ -22,5 +22,5 @@ # <Copilot Suggestion Here>

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/collaboration/coaching-on-prompts/index.html b/collaboration/coaching-on-prompts/index.html index 4ea86ed..542bd47 100644 --- a/collaboration/coaching-on-prompts/index.html +++ b/collaboration/coaching-on-prompts/index.html @@ -1,10 +1,10 @@ -Coaching on Prompts and Code Generating Process | GitHub Copilot Patterns & Exercises +Coaching on Prompts and Code Generating Process | GitHub Copilot Patterns & Exercises
Coaching on Prompts and Code Generating Process -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Coaching on Prompts and Code Generating Process #

{% hint style=“info” %} While this sounds reasonable, it is not a systematic or established pattern. @@ -14,5 +14,5 @@

Coached Prompt:

"Develop a Python function that takes two integers as input and returns a list of prime numbers within that range. Ensure the function efficiently handles different ranges, including edge cases."
 

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/collaboration/index.html b/collaboration/index.html index 4cfe143..f988ffd 100644 --- a/collaboration/index.html +++ b/collaboration/index.html @@ -5,5 +5,5 @@ English
Collaborations -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ
\ No newline at end of file diff --git a/design-pattern/ai-readable-naming-convention/index.html b/design-pattern/ai-readable-naming-convention/index.html index 3b43ca3..4f72eb9 100644 --- a/design-pattern/ai-readable-naming-convention/index.html +++ b/design-pattern/ai-readable-naming-convention/index.html @@ -1,10 +1,10 @@ -AI readable naming convention | GitHub Copilot Patterns & Exercises +AI readable naming convention | GitHub Copilot Patterns & Exercises
AI readable naming convention -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

AI readable naming convention #

Description #

The AI readable naming convention focuses on the way we name variables and functions in our code to make them more readable by AI tools like GitHub Copilot. By avoiding generic and common programming names and embracing specific, descriptive names, we create code that both human developers and AI models which powers Copilot, can easily comprehend.

For example, an engineer creating a library system may use generic words such as “dictionary”, “library”, and “stack” for system variable names and function names. But what if the real type of the variable named “dictionaries” was an array? This is just an example, but GitHub Copilot may give the wrong answer when these things pile up. If you need to provide more context, it’s a good idea to type hint or use comments to add context.

By following this pattern, we enhance the effectiveness of GitHub Copilot, leading to more accurate suggestions and increased developers’ velocity.

Example @@ -18,5 +18,5 @@ list_of_dictionaries_in_library: List[str] = ["Merriam-Webster", "Oxford", "Cambridge"]

Exerecise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/design-pattern/consistent-coding-style/index.html b/design-pattern/consistent-coding-style/index.html index d325f54..4b7efc8 100644 --- a/design-pattern/consistent-coding-style/index.html +++ b/design-pattern/consistent-coding-style/index.html @@ -1,10 +1,10 @@ -Consistent coding style | GitHub Copilot Patterns & Exercises +Consistent coding style | GitHub Copilot Patterns & Exercises
Consistent coding style -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Consistent coding style #

Description #

Consistent coding style is crucial in software development, as it not only enhances code readability but also leads to better suggestions from GitHub Copilot. Indentation, tabs, naming conventions, comment writing, language-specific abbreviations, and many other areas of coding style. By adhering to a uniform coding style and pattern, developers find it easier to follow excellent coding practices.

Example @@ -15,5 +15,5 @@ return

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/design-pattern/context-less-architecture/index.html b/design-pattern/context-less-architecture/index.html index ceecc3a..ef60206 100644 --- a/design-pattern/context-less-architecture/index.html +++ b/design-pattern/context-less-architecture/index.html @@ -1,10 +1,10 @@ -Context-less Architecture | GitHub Copilot Patterns & Exercises +Context-less Architecture | GitHub Copilot Patterns & Exercises
Context-less Architecture -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Context-less Architecture #

{% hint style=“info” %} Loosely coupled architectures themselves are also recommended in many cases, and this pattern is consistent with that idea. However, more discussion is needed to tie the context of AI Powered development to the broader architecture discussion and justify it. By all means, let the discussion begin. @@ -36,5 +36,5 @@ pass

These examples demonstrate the transformation from mixed, confusing contexts to clean, well-defined contexts by applying the Context-less Architecture pattern. This approach is especially beneficial when working with GitHub Copilot, considering its limitations in handling large and mixed contexts.

With this architecture, developers, and also GitHub Copilot, can focus on individual components, ensuring that the AI comprehends and accurately contributes to the code development.

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/design-pattern/eliminating-a-tiny-oss-dependency/index.html b/design-pattern/eliminating-a-tiny-oss-dependency/index.html index d9a8fec..f441f8b 100644 --- a/design-pattern/eliminating-a-tiny-oss-dependency/index.html +++ b/design-pattern/eliminating-a-tiny-oss-dependency/index.html @@ -1,10 +1,10 @@ -Eliminating a tiny OSS dependency | GitHub Copilot Patterns & Exercises +Eliminating a tiny OSS dependency | GitHub Copilot Patterns & Exercises
Eliminating a tiny OSS dependency -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Eliminating a tiny OSS dependency #

{% hint style=“info” %} This may be of limited applicability. As more cases are discovered, this maturity level will increase. @@ -15,5 +15,5 @@ end

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/design-pattern/high-level-architecture-first/index.html b/design-pattern/high-level-architecture-first/index.html index 54aeb80..8909dbf 100644 --- a/design-pattern/high-level-architecture-first/index.html +++ b/design-pattern/high-level-architecture-first/index.html @@ -1,10 +1,10 @@ -High-level Architecture First | GitHub Copilot Patterns & Exercises +High-level Architecture First | GitHub Copilot Patterns & Exercises
High-level Architecture First -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

High-level Architecture First #

Description #

When developing a complex system, it is common to dive into the details of the code and lose sight of the overall architecture of the program. When this happens repeatedly, GitHub Copilot also loses sight of its overall architecture. This can lead to misunderstandings and errors. By designing the high-level architecture of the program first and commenting on the function and purpose of each piece of code during development, GitHub Copilot can better understand the context and make more precise suggestions.

Samples @@ -25,5 +25,5 @@ # ...

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/design-pattern/index.html b/design-pattern/index.html index cb1495d..a1f3112 100644 --- a/design-pattern/index.html +++ b/design-pattern/index.html @@ -5,5 +5,5 @@ English
Design-patterns -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ
\ No newline at end of file diff --git a/design-pattern/working-on-small-chunk/index.html b/design-pattern/working-on-small-chunk/index.html index 646ea88..5001795 100644 --- a/design-pattern/working-on-small-chunk/index.html +++ b/design-pattern/working-on-small-chunk/index.html @@ -1,10 +1,10 @@ -Working on small chunks | GitHub Copilot Patterns & Exercises +Working on small chunks | GitHub Copilot Patterns & Exercises
Working on small chunks -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Working on Small Chunks #

Description #

Working on small chunks of code with less context can lead to improved Copilot’s output. Imagine you’re building a complex application with several interconnected components. Instead of trying to generate everything in one go, you break down the task into smaller parts, providing a confined context for Copilot. This approach not only streamlines the development process but also enhances the quality of the generated code.

Some ideas consider context-less architecture in the design phase, but it is difficult to apply a loosely coupled architecture to every project.

Also, changing the architectural design to improve the accuracy of AI tools is not the way to go. This pattern aims to improve GitHub Copilot’s proposal by at least working in small chunks so that the context is as small as possible in the working environment, so that GitHub Copilot does not become overwhelmed by the complexity of the overall project. more controlled, accurate, and efficient code generation that allows you to understand the specific tasks of the clues.

Example @@ -12,5 +12,5 @@ # Ask Copilot to complete this function

Exerecise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/en/sitemap.xml b/en/sitemap.xml index 04a5849..1cdfa73 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -1 +1 @@ -/2023-09-14T00:32:56+09:00/CONTRIBUTING/2023-09-14T00:32:56+09:00/menu/2023-09-14T00:32:56+09:00/collaboration/ai-friendly-documentation/2023-09-14T00:32:56+09:00/design-pattern/ai-readable-naming-convention/2023-09-14T00:32:56+09:00/refactoring/asking-with-open-ended-questions/2023-09-14T00:32:56+09:00/categories//client-tips/2023-09-14T00:32:56+09:00/collaboration/coaching-on-prompts/2023-09-14T00:32:56+09:00/general/code-completion/2023-09-14T00:32:56+09:00/general/code-to-comment/2023-09-14T00:32:56+09:00/general/code-to-document/2023-09-14T00:32:56+09:00/collaboration/2023-09-14T00:32:56+09:00/general/comment-to-code/2023-09-14T00:32:56+09:00/design-pattern/consistent-coding-style/2023-09-14T00:32:56+09:00/design-pattern/context-less-architecture/2023-09-14T00:32:56+09:00/client-tips/copilot-snippet-handling/2023-09-14T00:32:56+09:00/testing/creating-unit-tests/2023-09-14T00:32:56+09:00/design-pattern/2023-09-14T00:32:56+09:00/design-pattern/eliminating-a-tiny-oss-dependency/2023-09-14T00:32:56+09:00/general/2023-09-14T00:32:56+09:00/client-tips/github-copilot-shortcuts/2023-09-14T00:32:56+09:00/client-tips/go-to-definition/2023-09-14T00:32:56+09:00/design-pattern/high-level-architecture-first/2023-09-14T00:32:56+09:00/general/language-translation/2023-09-14T00:32:56+09:00/refactoring/making-the-calculation-part-independent/2023-09-14T00:32:56+09:00/general/object-generation-from-structured-data/2023-09-14T00:32:56+09:00/client-tips/pin-the-file-you-need/2023-09-14T00:32:56+09:00/general/quick-qna/2023-09-14T00:32:56+09:00/refactoring/2023-09-14T00:32:56+09:00/general/regular-expression/2023-09-14T00:32:56+09:00/general/showing-examples/2023-09-14T00:32:56+09:00/testing/specify-test-valiation/2023-09-14T00:32:56+09:00/tags//testing/test-only-what-is-necessary/2023-09-14T00:32:56+09:00/testing/2023-09-14T00:32:56+09:00/general/type-hinting/2023-09-14T00:32:56+09:00/design-pattern/working-on-small-chunk/2023-09-14T00:32:56+09:00/testing/writing-failure-case-first/2023-09-14T00:32:56+09:00/testing/writing-test-cases-in-natural-language-first/2023-09-14T00:32:56+09:00/refactoring/writing-test-code-before-refactoring/2023-09-14T00:32:56+09:00 \ No newline at end of file +/2023-09-14T00:34:37+09:00/CONTRIBUTING/2023-09-14T00:34:37+09:00/menu/2023-09-14T00:34:37+09:00/collaboration/ai-friendly-documentation/2023-09-14T00:34:37+09:00/design-pattern/ai-readable-naming-convention/2023-09-14T00:34:37+09:00/refactoring/asking-with-open-ended-questions/2023-09-14T00:34:37+09:00/categories//client-tips/2023-09-14T00:34:37+09:00/collaboration/coaching-on-prompts/2023-09-14T00:34:37+09:00/general/code-completion/2023-09-14T00:34:37+09:00/general/code-to-comment/2023-09-14T00:34:37+09:00/general/code-to-document/2023-09-14T00:34:37+09:00/collaboration/2023-09-14T00:34:37+09:00/general/comment-to-code/2023-09-14T00:34:37+09:00/design-pattern/consistent-coding-style/2023-09-14T00:34:37+09:00/design-pattern/context-less-architecture/2023-09-14T00:34:37+09:00/client-tips/copilot-snippet-handling/2023-09-14T00:34:37+09:00/testing/creating-unit-tests/2023-09-14T00:34:37+09:00/design-pattern/2023-09-14T00:34:37+09:00/design-pattern/eliminating-a-tiny-oss-dependency/2023-09-14T00:34:37+09:00/general/2023-09-14T00:34:37+09:00/client-tips/github-copilot-shortcuts/2023-09-14T00:34:37+09:00/client-tips/go-to-definition/2023-09-14T00:34:37+09:00/design-pattern/high-level-architecture-first/2023-09-14T00:34:37+09:00/general/language-translation/2023-09-14T00:34:37+09:00/refactoring/making-the-calculation-part-independent/2023-09-14T00:34:37+09:00/general/object-generation-from-structured-data/2023-09-14T00:34:37+09:00/client-tips/pin-the-file-you-need/2023-09-14T00:34:37+09:00/general/quick-qna/2023-09-14T00:34:37+09:00/refactoring/2023-09-14T00:34:37+09:00/general/regular-expression/2023-09-14T00:34:37+09:00/general/showing-examples/2023-09-14T00:34:37+09:00/testing/specify-test-valiation/2023-09-14T00:34:37+09:00/tags//testing/test-only-what-is-necessary/2023-09-14T00:34:37+09:00/testing/2023-09-14T00:34:37+09:00/general/type-hinting/2023-09-14T00:34:37+09:00/design-pattern/working-on-small-chunk/2023-09-14T00:34:37+09:00/testing/writing-failure-case-first/2023-09-14T00:34:37+09:00/testing/writing-test-cases-in-natural-language-first/2023-09-14T00:34:37+09:00/refactoring/writing-test-code-before-refactoring/2023-09-14T00:34:37+09:00 \ No newline at end of file diff --git a/general/code-completion/index.html b/general/code-completion/index.html index 539bc9d..7ecee39 100644 --- a/general/code-completion/index.html +++ b/general/code-completion/index.html @@ -1,10 +1,10 @@ -Code Completion | GitHub Copilot Patterns & Exercises +Code Completion | GitHub Copilot Patterns & Exercises
Code Completion -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Code Completion #

Description #

One of the simplest uses of GitHub Copilot is code completion. Code completion enhances developer productivity by offering potential code snippets as the developer is typing. For example, imagine defining a function in JavaScript. As you input the code below, GitHub Copilot will suggest potential code that could be used inside the function, such as the following code.

Example @@ -20,5 +20,5 @@ }

Exerecise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/general/code-to-comment/index.html b/general/code-to-comment/index.html index a8c1701..a075514 100644 --- a/general/code-to-comment/index.html +++ b/general/code-to-comment/index.html @@ -1,10 +1,10 @@ -Code to Comment | GitHub Copilot Patterns & Exercises +Code to Comment | GitHub Copilot Patterns & Exercises
Code to Comment -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Code to Comment: Generating Comments from Code #

Description #

GitHub Copilot can generate comments from code. When existing code lacks sufficient comments, or to assist other developers in understanding the code, GitHub Copilot can automatically generate explanations in comment form. The following sample demonstrates the Sieve of Eratosthenes algorithm to list prime numbers less than a given number. While this code does not contain comments, GitHub Copilot can create comments to describe the code’s functionality.

Example @@ -42,5 +42,5 @@ sieve[i] = False return primes

Checklist for Further Learning -#

\ No newline at end of file diff --git a/general/code-to-document/index.html b/general/code-to-document/index.html index a2e39ff..aaf6410 100644 --- a/general/code-to-document/index.html +++ b/general/code-to-document/index.html @@ -1,10 +1,10 @@ -Code to Document | GitHub Copilot Patterns & Exercises +Code to Document | GitHub Copilot Patterns & Exercises
Code to Document -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Code to Document #

Description #

Chat-based AI tools can be used to automatically generate descriptions as well as longer texts such as documentation. For example, GitHub Copilot Chat can be leveraged to generate a full code synopsis, API documentation, and even output the entire code with it embedded within the code.

Sample Code @@ -145,5 +145,5 @@ - Response: Detailed information about the deleted recipe

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/general/comment-to-code/index.html b/general/comment-to-code/index.html index 04ddab4..bda283e 100644 --- a/general/comment-to-code/index.html +++ b/general/comment-to-code/index.html @@ -1,10 +1,10 @@ -Comment to Code | GitHub Copilot Patterns & Exercises +Comment to Code | GitHub Copilot Patterns & Exercises
Comment to Code -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Comment to Code Generation #

Description #

GitHub Copilot is capable of generating new code based on the specific text provided by a developer. By defining conditions in the form of comments, GitHub Copilot can create code that responds to the requirements.

Example @@ -21,5 +21,5 @@ // Function arguments: numbers (array) // Return type of the function: number
  • Exercise 2: Test the generated function with different sets of numbers and verify if it returns the correct maximum value.

Checklist for Further Learning -#

\ No newline at end of file diff --git a/general/index.html b/general/index.html index 56522d3..520b0cc 100644 --- a/general/index.html +++ b/general/index.html @@ -5,5 +5,5 @@ English
Generals -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ
\ No newline at end of file diff --git a/general/language-translation/index.html b/general/language-translation/index.html index b3717ad..97db84c 100644 --- a/general/language-translation/index.html +++ b/general/language-translation/index.html @@ -1,10 +1,10 @@ -Language Translation | GitHub Copilot Patterns & Exercises +Language Translation | GitHub Copilot Patterns & Exercises
Language Translation -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Language Translation #

Description #

Sometimes, developers may need to translate code from one language to another, such as from Python to JavaScript or HTML to Markdown. This is where GitHub Copilot shines as a virtual aide. Imagine a scenario where a team is working on a multi-platform project, and they need to quickly convert a Python algorithm into JavaScript for web integration. GitHub Copilot’s Language Translation ability can save hours of manual translation, enabling seamless cross-language development.

Example @@ -16,5 +16,5 @@

Exercise #

Checklist for Further Learning #

\ No newline at end of file diff --git a/general/object-generation-from-structured-data/index.html b/general/object-generation-from-structured-data/index.html index 6633dd8..8a2fe8f 100644 --- a/general/object-generation-from-structured-data/index.html +++ b/general/object-generation-from-structured-data/index.html @@ -1,10 +1,10 @@ -Object Generation from Structured Data | GitHub Copilot Patterns & Exercises +Object Generation from Structured Data | GitHub Copilot Patterns & Exercises
Object Generation from Structured Data -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Object Generation from Structured Data #

Description #

Working with structured data is an everyday task for developers. Transforming data from formats like JSON into objects within your programming language allows for more robust and maintainable code. Imagine you have a list of users, and you want to convert this data into user objects within your application. GitHub Copilot can help you in this transformation process, turning a tedious task into a seamless exercise.

Example @@ -24,5 +24,5 @@ print(user.id, user.name)

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/general/quick-qna/index.html b/general/quick-qna/index.html index b12e8f5..ab6d1cb 100644 --- a/general/quick-qna/index.html +++ b/general/quick-qna/index.html @@ -1,10 +1,10 @@ -Quick Q&A | GitHub Copilot Patterns & Exercises +Quick Q&A | GitHub Copilot Patterns & Exercises
Quick Q&A -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Quick Q&A : A Technique for Fast Interaction with Copilot #

Description #

In the collaborative coding environment, quick interactions and clarifications are often key to efficient development. While GitHub has the “GitHub Copilot Chat” product for more structured and extensive conversations, the “Quick Q&A” technique serves as a lightweight alternative. It enables developers to rapidly engage with Copilot in the code editor for brief one-liner answers and insights. It’s not a distinct feature but a method that leverages commenting for quick interactions with Copilot, making it an agile and handy tool for on-the-spot guidance.

Example @@ -23,5 +23,5 @@ # copilot: Consider using a vectorized approach or caching intermediate results.

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/general/regular-expression/index.html b/general/regular-expression/index.html index 3b2395f..7802e2f 100644 --- a/general/regular-expression/index.html +++ b/general/regular-expression/index.html @@ -1,10 +1,10 @@ -Regular Expression | GitHub Copilot Patterns & Exercises +Regular Expression | GitHub Copilot Patterns & Exercises
Regular Expression -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Regular Expression #

{% hint style=“info” %} Currently, LLMs do not have the ability to properly represent complex regular expressions. @@ -45,5 +45,5 @@ matched = re.findall(regex, sentence)

Exercise #

Checklist for Further Learning -#

\ No newline at end of file diff --git a/general/showing-examples/index.html b/general/showing-examples/index.html index c735a65..d0599d1 100644 --- a/general/showing-examples/index.html +++ b/general/showing-examples/index.html @@ -1,10 +1,10 @@ -Showing Examples | GitHub Copilot Patterns & Exercises +Showing Examples | GitHub Copilot Patterns & Exercises
Showing Examples -
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

Showing Examples #

Description #

Using GitHub Copilot, developers can generate code based on provided examples. This can be incredibly useful when you expect the code that produces a specific output. In this pattern, we’ll explore how to create a Ruby on Rails model from a given example, such as generating JSON.

Example @@ -25,5 +25,5 @@ "price": 19.99 }
  • Exercise 2: Experiment with different attributes and types in the JSON example, then generate the corresponding Rails code.
  • Exercise 3: Test the generated code in a Rails project to ensure that it creates the expected model.
  • Checklist for Further Learning -#

    \ No newline at end of file diff --git a/general/type-hinting/index.html b/general/type-hinting/index.html index 1d76e49..c2ce7a7 100644 --- a/general/type-hinting/index.html +++ b/general/type-hinting/index.html @@ -1,10 +1,10 @@ -Type Hinting | GitHub Copilot Patterns & Exercises +Type Hinting | GitHub Copilot Patterns & Exercises
    Type Hinting -
    Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
    Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

    Type Hinting #

    Description #

    In the world of dynamic typing programming languages, developers often face challenges in understanding code, especially when working on complex systems. Type hinting adds a layer of clarity by explicitly declaring the expected data types. With GitHub Copilot, the integration of type hinting can increase the accuracy of code suggestions, empowering developers and GitHub Copilot to write code more efficiently.

    Imagine you’re working on a project where functions are deeply nested, and tracking the types of variables becomes convoluted. Integrating type hinting also makes the code more readable for your fellow developers.

    Example @@ -12,5 +12,5 @@ return a + b

    Copilot will recognize these type hints and generate code suggestions accordingly.

    Exerecise #

    Checklist for Further Learning -#

    \ No newline at end of file diff --git a/index.html b/index.html index 578f51c..a05dc93 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ English
    -
    Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub doc. Your contribution to make this even better is super welcome!๐Ÿš€ +
    Hi!๐Ÿ‘‹ This is a community-driven, beta document, NOT an official GitHub document. Your contribution to make this even better is super welcome!๐Ÿš€ Please dive in and contribute๐Ÿ™Œ

    GitHub Copilot Patterns and Exercises #

    Welcome to the GitHub Copilot Patterns & Exercises documentation! ๐Ÿ‘‹ This community-driven opensource guide is dedicated to providing best practices for GitHub Copilot. @@ -29,5 +29,5 @@ Yuki Hattori, a Customer Success Architect at GitHub. Throughout its evolution, various community members have reviewed and enriched its content. Dive deep into our contributors’ graph to see the passionate individuals who have shaped this project. Please join us. Let’s explore the wild GitHub Copilot Patterns together.

    LICENSE #

    This document is licensed under a -Creative Commons Attribution-ShareAlike 4.0 International License.


    Thank you for being a part of this journey. Together, we can shape the future of AI Powered Development!