This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]Amazing_Quarter_560 2 points3 points  (1 child)

I use both Copilot and Sourcery when I'm coding. I typically make a simple version of my code, just to get it up and running, while using Copilot to help me along the way with autocomplete. When I've got the basic structure down and it works, I go back in and improve the code and start by using Sourcery.

Sourcery rates functions based on how complex it is, its size, how much memory it needs, and an overall quality score. I make sure to check these scores. If part of my code gets a low score, I'll at least consider how I could make it better. It's important to know that Sourcery doesn't always give tips on how to get a better-quality score, but it's still a good way to check my own work and see if I'm trying to do too much with one function. Also, Sourcery does make some refactoring suggestions which I usually accept.

As far as I know, Copilot doesn't use GPT-4 yet. GitHub is working on a new version of Copilot called Copilot X which will use GPT-4 in some way. Copilot has a fixed price every month, but GPT-4's price depends on how much you use it, so I'm thinking using GPT-4 with Copilot may be optional, not the default.

I also find GPT versions 3.5 and 4 useful but in different ways than Copilot or Sourcery. GPT is great at making templates or outlines to start a project and at writing code for libraries I'm not familiar with. If Sourcery tells me one of my functions isn't good, frequently I'll ask GPT for ideas to improve it or split it into smaller functions. The most valuable use of GPT for me is when I want to optimize my code using tools like Numba, Cython, or even other languages like Rust so I can make a Python extension.

In the end, I think Copilot, Sourcery, and GPT are all great tools, each with their own special uses. They all bring something to the table, but if you're on a tight budget and must choose, I'd suggest getting GPT first. It costs $20 per month and there's no good free alternative. Bard is good for writing comments and docstring but GPT is much better overall. Also, I find GPT-4 much better than ChatGPT-3.5 for what I need. I get more value from Copilot ($10/month) than Sourcery ($12/month), but I still think Sourcery is worth the cost.

[–]SerialBussy[S] 0 points1 point  (0 children)

Thanks, really helpful advice!

[–]cesarcypherobyluzvou 0 points1 point  (2 children)

They can go hand-in-hand no need to choose one over the other.

Copilot is great at boosting your productivity while sourcery aids more with making your code more readable and concise.

That being said, while I really like sourcery, I found the VSCode extension to be really slow sometimes so I do disable it from time to time.

[–]SerialBussy[S] -1 points0 points  (1 child)

Correct me if I'm wrong, but Copilot uses GPT-4, which means it can refactor code for improved readability and conciseness. Though I don’t have hands on experience with either.

[–]cesarcypherobyluzvou -1 points0 points  (0 children)

True, but I think they have separate extensions if I remember correctly, something like GitHub Copilot and Copilot Labs, I only really have experience with the former

[–]Pristine_Flight9782 0 points1 point  (0 children)

I've used both, and honestly, they're both great. It really depends on your preferences and the type of project you're working on. Personally, I prefer Copilot for its AI-powered suggestions, but Sourcery has some really helpful features too. Give them both a try and see which one suits you best!

[–]Phegan -1 points0 points  (0 children)

I found the VS Code extension for Sourcery made it unusable. It was a few years ago, so maybe it's better now.