<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Thomas Fline</title>
    <description>The latest articles on DEV Community by Thomas Fline (@fengtan).</description>
    <link>https://dev.to/fengtan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F596844%2F7acde9fb-c05f-45a5-9402-73604f73f3f4.jpg</url>
      <title>DEV Community: Thomas Fline</title>
      <link>https://dev.to/fengtan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fengtan"/>
    <language>en</language>
    <item>
      <title>AI-assisted Drupal development: testing GitHub Copilot</title>
      <dc:creator>Thomas Fline</dc:creator>
      <pubDate>Wed, 21 Jul 2021 16:29:16 +0000</pubDate>
      <link>https://dev.to/fengtan/ai-assisted-drupal-development-testing-github-copilot-4cgp</link>
      <guid>https://dev.to/fengtan/ai-assisted-drupal-development-testing-github-copilot-4cgp</guid>
      <description>&lt;p&gt;On June 29, 2021 GitHub &lt;a href="https://github.blog/2021-06-29-introducing-github-copilot-ai-pair-programmer/" rel="noopener noreferrer"&gt;announced&lt;/a&gt; &lt;a href="https://copilot.github.com/" rel="noopener noreferrer"&gt;GitHub Copilot&lt;/a&gt;, an Artificial Intelligence (AI)-based assistant that helps developers write code.&lt;/p&gt;

&lt;p&gt;The tool is currently only available as a &lt;a href="https://marketplace.visualstudio.com/items?itemName=GitHub.copilot" rel="noopener noreferrer"&gt;VS Code extension&lt;/a&gt; and access is gradually granted via a &lt;a href="https://github.com/features/copilot/signup" rel="noopener noreferrer"&gt;waiting list&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I was fortunate to join the program a few days ago and tested it against Drupal 9.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;Details can be found on the &lt;a href="https://copilot.github.com/" rel="noopener noreferrer"&gt;GitHub Copilot&lt;/a&gt; page. In short:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://openai.com/" rel="noopener noreferrer"&gt;OpenAI&lt;/a&gt; trained an AI model against billions of lines of code stored in public repositories&lt;/li&gt;
&lt;li&gt;That model is accessible via a service hosted by GitHub&lt;/li&gt;
&lt;li&gt;As the developer types code in VS Code, the latter sends queries to the GitHub service, which then tries to understand the developer's intent and responds with code suggestions&lt;/li&gt;
&lt;li&gt;The service improves over time as it gathers information about whether developers accept or reject code suggestions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While this mechanism may give rise to security concerns (snippets of your local, private code will be sent to GitHub), the &lt;a href="https://copilot.github.com/#faqs" rel="noopener noreferrer"&gt;FAQ section&lt;/a&gt; and &lt;a href="https://docs.github.com/en/github/copilot/about-github-copilot-telemetry" rel="noopener noreferrer"&gt;this page&lt;/a&gt; provide some clarification. In particular:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your private code will not be offered as suggestions to others developers&lt;/li&gt;
&lt;li&gt;Only select employees at GitHub, OpenAI and Microsoft will have access to the parts of your code that were sent to the GitHub service&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What else is there
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot is not the first AI-based assistant for developers.&lt;/p&gt;

&lt;p&gt;Microsoft released &lt;a href="https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode" rel="noopener noreferrer"&gt;Visual Studio IntelliCode&lt;/a&gt; (based on &lt;a href="https://en.wikipedia.org/wiki/GPT-2" rel="noopener noreferrer"&gt;GPT-2&lt;/a&gt;) in 2018. It &lt;a href="https://github.com/MicrosoftDocs/intellicode/issues/92" rel="noopener noreferrer"&gt;does not support PHP&lt;/a&gt; though.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.tabnine.com/" rel="noopener noreferrer"&gt;Tabnine&lt;/a&gt; (available for both &lt;a href="https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; and &lt;a href="https://plugins.jetbrains.com/plugin/12798-tabnine-ai-code-completion-js-java-python-ts-rust-go-php--more" rel="noopener noreferrer"&gt;JetBrains&lt;/a&gt;) is also based on GPT-2. It works OK but seems to have a fairly limited knowledge of Drupal. I could not make it implement a &lt;a href="https://www.drupal.org/docs/creating-custom-modules/understanding-hooks" rel="noopener noreferrer"&gt;Drupal hook&lt;/a&gt; for me, for instance.&lt;/p&gt;

&lt;p&gt;GitHub Copilot, for its part, supports PHP and is based on Codex, an extension of &lt;a href="https://en.wikipedia.org/wiki/GPT-3" rel="noopener noreferrer"&gt;GPT-3&lt;/a&gt; which was trained on a much larger set of code than GPT-2 and so hopefully has a better understanding of Drupal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hello, AI
&lt;/h2&gt;

&lt;p&gt;Let's start by creating a blank PHP file in VS Code and typing some trivial code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frucfwwcn199z6d1m1hk0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frucfwwcn199z6d1m1hk0.png" alt="PHP code with comment that shows intent to compute an average" width="470" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copilot rightly understood from the comment I wrote that I wanted to compute the average of &lt;code&gt;$ratings&lt;/code&gt; and offered me a line of code that does just that. Then I just have to hit &lt;code&gt;Tab&lt;/code&gt; to accept the snippet. Neat.&lt;/p&gt;

&lt;p&gt;Now, instead of writing a comment, let's define a function &lt;code&gt;computeAverage()&lt;/code&gt; and see what Copilot offers:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmnnyq9f2i4xgzwv7g8k8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmnnyq9f2i4xgzwv7g8k8.png" alt="PHP code with function name that shows intent to compute an average (start writing code)" width="374" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvunc2kt1875vy85mwuea.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvunc2kt1875vy85mwuea.png" alt="PHP code with function name that shows intent to compute an average (all code written)" width="375" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I just had to hit &lt;code&gt;Tab&lt;/code&gt; repeatedly as suggestions showed up to come up with a complete function that computes the average.&lt;/p&gt;

&lt;p&gt;Note that only single-line suggestions are offered in PHP. Multi-line suggestions are only supported for Python, JavaScript, TypeScript, Ruby and Go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you know about Drupal ?
&lt;/h2&gt;

&lt;p&gt;Now let's try Copilot against a fresh Drupal project and see if it is of any help. The model is claimed to have been trained on billions of lines of public code, so hopefully that includes Drupal core and contrib.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;composer create-project drupal/recommended-project drupal 9.2
&lt;span class="nv"&gt;$ &lt;/span&gt;code drupal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's create a file (and its parent directories) at &lt;code&gt;web/modules/custom/mymodule/src/Form/MyForm.php&lt;/code&gt;, insert a comment at the top describing what kind of Drupal form we want to build and see if any suggestion shows up:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fslcvnbwll092fxkn0yax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fslcvnbwll092fxkn0yax.png" alt="Copilot suggests namespace that complies with Drupal standards" width="571" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After typing &lt;code&gt;namespace&lt;/code&gt;, Copilot suggests a properly formatted &lt;a href="https://www.drupal.org/docs/develop/standards/psr-4-namespaces-and-autoloading-in-drupal-8" rel="noopener noreferrer"&gt;PSR-4 Drupal namespace&lt;/a&gt;. That is a good sign. &lt;/p&gt;

&lt;p&gt;Let's accept the suggested namespace, and keep going by typing &lt;code&gt;class&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmtcczmw1di12mnfo36k2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmtcczmw1di12mnfo36k2.png" alt="Copilot suggests class that complies with Drupal standards" width="570" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copilot suggests a proper class name and extends the right parent class. It sounds like it knows about Drupal. Awesome !&lt;/p&gt;

&lt;h2&gt;
  
  
  Can you write that Drupal module for me ?
&lt;/h2&gt;

&lt;p&gt;Let's keep hitting &lt;code&gt;Tab&lt;/code&gt; as suggestions show up and insert a few PHP comments here and there. Copilot ends up writing the entire class:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft6zrjzmruvhgrdntslx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft6zrjzmruvhgrdntslx9.png" alt="Copilot wrote the whole form, with a few glitches" width="800" height="1818"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It looks pretty good:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The AI implemented exactly the right methods (&lt;code&gt;getFormId()&lt;/code&gt;, &lt;code&gt;buildForm()&lt;/code&gt;, &lt;code&gt;validateForm()&lt;/code&gt;, &lt;code&gt;submitForm()&lt;/code&gt;) albeit with deprecated signatures&lt;/li&gt;
&lt;li&gt;The contents of each method makes sense&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://www.drupal.org/docs/develop/standards/coding-standards" rel="noopener noreferrer"&gt;Drupal coding standards&lt;/a&gt; are generally observed, with the notable exception of the array syntax&lt;/li&gt;
&lt;li&gt;The field titles were wrapped in a &lt;code&gt;t()&lt;/code&gt; function, which again demonstrates some Drupal-specific knowledge&lt;/li&gt;
&lt;li&gt;The Email field was defined with type &lt;code&gt;email&lt;/code&gt; instead of &lt;code&gt;textfield&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few mishaps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arrays were formatted using the &lt;a href="https://www.php.net/manual/en/language.types.array.php#language.types.array.syntax" rel="noopener noreferrer"&gt;long syntax&lt;/a&gt;. That policy was &lt;a href="https://www.drupal.org/node/2135291" rel="noopener noreferrer"&gt;changed&lt;/a&gt; several years ago. Maybe Copilot was trained against projects that still use the long syntax and/or is not aware that I am writing code for Drupal 9 instead of Drupal 7. That being said, a well-configured &lt;a href="https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs" rel="noopener noreferrer"&gt;phpcs extension&lt;/a&gt; would quickly bring this to the developer's attention.&lt;/li&gt;
&lt;li&gt;Function &lt;code&gt;drupal_set_message()&lt;/code&gt; was introduced even though it was &lt;a href="https://www.drupal.org/node/2774931" rel="noopener noreferrer"&gt;deprecated&lt;/a&gt; a few years ago. Again, Copilot may not be aware that I am writing code specifically for Drupal 9. The &lt;a href="https://marketplace.visualstudio.com/items?itemName=bbeversdorf.drupal-check" rel="noopener noreferrer"&gt;drupal-check extension&lt;/a&gt; would likely catch this.&lt;/li&gt;
&lt;li&gt;Both fields were made mandatory in &lt;code&gt;buildForm()&lt;/code&gt; even though the comment I typed suggested that I wanted only the Name field to be required.&lt;/li&gt;
&lt;li&gt;The methods were implemented with deprecated signatures (&lt;code&gt;$form_state&lt;/code&gt; is supposed to be a &lt;code&gt;FormStateInterface&lt;/code&gt; object, not an array). The &lt;a href="https://www.drupal.org/node/2310411" rel="noopener noreferrer"&gt;change&lt;/a&gt; happened several years ago.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, the suggestions make sense and look rather helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying to fool the AI
&lt;/h2&gt;

&lt;p&gt;Let's create a file at &lt;code&gt;web/modules/custom/mymodule/mymodule.module&lt;/code&gt; and prompt Copilot to offer code that displays user-entered content:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5q9w5h85k19n5qbubp2o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5q9w5h85k19n5qbubp2o.png" alt="Copilot suggests code that includes protection against XSS attacks" width="704" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First off, Copilot retrieved the argument from the URL &lt;em&gt;the Drupal way&lt;/em&gt;, but using the Drupal 7 function &lt;code&gt;arg()&lt;/code&gt; which was &lt;a href="https://www.drupal.org/node/2274705" rel="noopener noreferrer"&gt;deprecated&lt;/a&gt; in Drupal 8.&lt;/p&gt;

&lt;p&gt;Still, the code makes use of a &lt;code&gt;t()&lt;/code&gt; function and a safe &lt;code&gt;@&lt;/code&gt; placeholder, which brings protection against &lt;a href="https://en.wikipedia.org/wiki/Cross-site_scripting" rel="noopener noreferrer"&gt;XSS attacks&lt;/a&gt;. The code looks secure.&lt;/p&gt;

&lt;p&gt;Now let's do something similar with a SQL query:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp3kl6hkmd01kbr1ndqh6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp3kl6hkmd01kbr1ndqh6.png" alt="Copilot suggests code that includes protection against SQL injections, but with deprecated code (start of code)" width="528" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fftdxy2tkmkzismd36hnh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fftdxy2tkmkzismd36hnh.png" alt="Copilot suggests code that includes protection against SQL injections, but with deprecated code (code complete)" width="527" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The suggested code makes use of the &lt;a href="https://www.drupal.org/docs/drupal-apis/database-api" rel="noopener noreferrer"&gt;database API&lt;/a&gt;, which includes a protection against &lt;a href="https://en.wikipedia.org/wiki/SQL_injection" rel="noopener noreferrer"&gt;SQL injections&lt;/a&gt;. Again, the code looks secure. However, it is based on the &lt;a href="https://www.drupal.org/node/2993033" rel="noopener noreferrer"&gt;deprecated&lt;/a&gt; function &lt;code&gt;db_select()&lt;/code&gt;. Let's give Copilot a hint:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1oehozxww5r818ucr2hi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1oehozxww5r818ucr2hi.png" alt="Copilot suggests code that includes protection against SQL injections, and is not deprecated (start of code)" width="503" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F116xjn1nrlkb9m06k6p7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F116xjn1nrlkb9m06k6p7.png" alt="Copilot suggests code that includes protection against SQL injections, and is not deprecated (code complete)" width="501" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This time Copilot suggested code that makes use of the up-to-date function &lt;code&gt;\Drupal::entityQuery()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can we talk ?
&lt;/h2&gt;

&lt;p&gt;Copilot happens to offer suggestions in a large set of programming languages, but also in human languages. By formatting a plain text file into what looks like a conversation, it managed to answer my questions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4q0id8rjll4gqa7b0hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4q0id8rjll4gqa7b0hn.png" alt="Conversation with Copilot" width="484" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Someone took this to the next level by making Copilot write a fake paper in LaTeX (&lt;a href="https://www.youtube.com/watch?v=V1-hRy8EgNE" rel="noopener noreferrer"&gt;watch here&lt;/a&gt;). While that is not its primary purpose, and the answers don't always make sense, I found this side effect rather intriguing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot looks valuable for Drupal development, as long as you are comfortable sharing parts of your private code with GitHub.&lt;/p&gt;

&lt;p&gt;Support for multi-line suggestions in PHP would definitely add more value, although the tool remains relevant even with single-line suggestions.&lt;/p&gt;

&lt;p&gt;While it does not seem to be fully aware of Drupal versions and deprecated code, it was able to generate code that for the most part followed coding standards, was secure, and mostly worked.&lt;/p&gt;

&lt;p&gt;While GitHub Copilot does not seem to be able to &lt;a href="https://www.economist.com/science-and-technology/2021/07/07/ai-is-transforming-the-coding-of-computer-programs" rel="noopener noreferrer"&gt;replace&lt;/a&gt; Drupal developers at this point, it certainly has the potential to make them more productive.&lt;/p&gt;

</description>
      <category>drupal</category>
      <category>ai</category>
      <category>vscode</category>
      <category>githubcopilot</category>
    </item>
  </channel>
</rss>
