Need to write some boring code? Ask your co-pilot for help!

Pierpaolo Pignelli - 2022-09-14

Meet Copilot: the AI that simplifies code writing, saving time and effort. Learn more!

In this article, the review of Copilot, an AI tool that can ease the burden of writing code, saving you time and mental effort. Happy reading!

If you are a or a developer, surely writing code, besides being your job, is also your passion. As far as I am concerned, at least, it is.

However, even with all the passion, you must have sometimes dreamed that you could have a "helper," willing to write some tedious piece of code in your place.

For example, the ones where there is no need for great "thinking," but that you have to do and they take up a lot of your time. Or those that you would never put in, but that your client wants at all costs.

Well, in this article I introduce Copilot, a tool that leverages artificial intelligence to relieve you of the (mental) strain of writing code in those "bad times."

And even in the "Yes" ones, actually.

I discovered it almost by accident last June, and after "messing around" with it a bit over the summer (yes, I take my pc even on vacation...), I became convinced that it could be an interesting solution for those of us who live coding.

Copilot, the AI that can write code the way you want it.

Index

Need to write some boring code? Ask your co-pilot for help!

  1. Copilot, the AI that can write code the way you want it to
    1. Just perfect no...but learn fast
  2. Work (saved) costs money!

Copilot, the AI that can write code the way you want it to

So, this tool, which could take a lot of the hassle out of doing our job, is available on Github since the end of last June.

It is, quoting the project page, a "AI pair programmer" that leverages artificial intelligence (OpenAI) makes it possible to generate code.

Supports Python, JavaScript, TypeScript, Ruby, Swift, Go, and many other languages.

Swift is also supported, but not directly on Xcode (the IDE of choice for creating bitten apple apps). This is easily circumvented by using Copilot on popular editors such as VS Code, Jetbrains and Neovim. 

A screenshot showing Copilot at work After installing the extension we can immediately see the magic. Just create a comment in which we explain what will follow (with a medium to high level of detail) and...PUFF!

Copilot will create before our eyes what it has hypothesized might suit us (classes or structures). When it is finished all we need to do is click the "Tab ->" key to accept it and write it down.

Copilot can also provide code generation in the case of other suggestions, such as docstrings, function names, or even simple file names. We can start with the declaration of the data structure, and Copilot will try to suggest the body of the structure itself.

There is also a function very useful, which allows, when possible, to choose among several code solutions, with a combination of keys.

Just perfect no...but learn fast

Of course, sometimes there will be a need to rework the code a little bit, to make it acceptable.

However, AI has the virtue of quickly understanding the developer's programming style and adapting with some precision.

 

To my surprise, I won't hide it from you, the tool also allows the creation of unit tests that seem really well written.

Writing tests, for most of us is almost worse than reading documentation (Oops! Whatever, it had to be said...) and this Copilot feature really made me fall in love with the tool. :)

Testing aside, a very useful use case could also be to use it with APIs with which you are not very familiar.

In conclusion, I must say that to save some time, this software is a great plus!

Of course, we cannot have the expectation that the program will do everything for us or replace the work of the developer.

And good thing too, I would say. Because even though "It is unlikely that we developers would be outperformed by some artificial intelligence, because they would not be able to understand customer demands" - to quote a phrase written on a forum, which has stuck in my mind - the idea that a tool could replace me completely would not appeal to me at all!

Joking aside, however, being able to rely on a reliable and multifaceted "code partner" is really interesting and useful (I bet from the fact that I enthusiastically told you about it for 30 lines, you kind of figured it out that I like it, didn't you?).

However, like all good and useful things, this tool comes at a price....

Work (saved) costs money!

You can use Copilot with full functionality, to write code completely free of charge, for a trial period of 60 days. Once this period expires, automatic monthly billing will begin, via Paypal. Of course you can still give cancellation before the trial period expires, or before one of the monthly renewals, as with any other online service.

All clear? well, then I guess all that's left for me to do is to say goodbye and see you in the next article!

If you are an or a fellow iOS dev, always remember that when in doubt: 

translatesAutoresizingMaskIntoConstraints = false. 

Hello!

Pierpaolo Pignelli

The author of this article, has been working at Ulixe as an iOS developer since 2022. A graduate in Computer and Automation Engineering, he has been interested in IT since his teens and was weaned to the videludic world with a Game Boy Color, yellow. He is a lover of basketball and wellness and is an enthusiastic aspiring environmentalist.

Back to our blog to read Pierpaolo's upcoming articles!


See More Posts

background

Be My Eyes: The AI breakthrough for accessibility

Samuel Capano

background

WWDC 2024: New Libraries for iOS Developers

Pierpaolo Pignelli

background

From Ciphers to Computers: Enigma and the Cryptography Revolution.

Alessandra Bertini

Show more

Ulixe Group S.r.l. Copyright © Ulixe Group S.r.l. | Lungo Dora Pietro Colletta, 67, 10153, Turin, Italy | VAT IT03305250122 | Rea Number TO1173020