![]() ![]() I'm curious as to how good this AI is at helping me write tests for the code it's just helped me write. I am happier with Copilot's second approach, though the code will need a couple of minor manual tweaks. It with some other useful transformations to do the job. Copilot does indeed start with strip_tags but has combined I am given a suggested function declaration with name and parameters, which I adjust slightly. I write my docstring, being careful to specify as precisely as I can what I want my function to do. I wonder if Copilot will suggest the built-in strip_tags function, because I know that is, at least by itself, a poor and rudimentary solution for sanitizing HTML and one which typically doesn't fly in most real-world use cases for such a task. How about something to purify an HTML string and strip out all tags, except those we explicitly pass in as allowable? I take a few moments to mull over the possibilities. I want to try a string transformation which may be at least a little trickier. For my first function, Copilot writes an acceptable solution for the function body for me.īut this is a very simple task for a code generator (provided it is capable of the not-so-simple task of natural language interpretation). I don't need to write a single lexical token of code. ![]() The next thing I note is Copilot's AI has read my class-level comment about exposing static methods and is eager to oblige. I accept the offer with a stroke of the Tab key. I have barely begun typing my first idea for a function when Copilot helpfully offers to complete my comment block for me. I wanted to keep things simple for my initial tests, so I created a new, empty project in PHPStorm and created a class called Utilities (yeah I know) to define a few static helper methods for some contrived common tasks I might want to perform on strings and arrays. Alt- key combos allow you to flip through a number of suggestions if you don't like the first pass. Suggestions appear as grayed-out code which I can accept and integrate immediately in to my code with a simple press of the Tab key. I login to GitHub, authorise it to connect to my device and that's it - once activated, the plugin sets to work immediately, analysing whatever I type in real time and suggesting where I might want to go next with my code. ![]() It comes in the form of a surprisingly small plugin which adds a GitHub Copilot entry to my Naturally I use PHPStorm as I my IDE and this is one of the products for which Copilot integration is supported. Can it increase my productivity? Hell, will it make me as a human programmer redundant in a few years? Somehow I was one of the lucky ones and have spent the last few days playing around with this marvel. The product is in a technical preview phase and there's a possibly lengthy waiting list if you'd like a shot at receiving a coveted invitation to see it in action.Ģ5 June 2022 update: GitHub Copilot has now launched and is available to everyone! Prices at the time of writing are $10 per month or $100 per year. The bad news? Copilot isn't available to everyone yet. We're not just talking a smarter analytical version of your IDEs existing auto-complete capability, either - Copilot promises intelligent and context-aware completion of anything from individual lines to entire functions, whether that's based on code you'veĪlready written or just a plain English comment block describing what you want. Trained from the billions of lines in a dozen-plus languages of open source projects on GitHub. Taking machine learning to the next level, Copilot integrates with your favourite IDEs (well, if your favourite is among Jetbrains, VS Code and Neovim) and delivers a system of AI-driven code GitHub Copilot describes itself as "your AI pair programmer". I Tried GitHub Copilot and it's the Best Thing Ever AI-driven code
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |