DEV Community

Cover image for Use Copilot to Write and Translate a Binary Search Algorithm

Use Copilot to Write and Translate a Binary Search Algorithm

Rizèl Scarlett on April 13, 2022

I learn best from reading, watching, and doing, which means I need various resources to create a robust mental model. When I've studied for intervi...
Collapse
 
adamity profile image
Adamity

Just sharing, I have this rule whenever learn new framework/language I will not use GitHub Copilot, I will do first, try and error hoping the thing I learn stick inside my head, if I can't do it by myself, then I use GitHub Copilot

But if I do my fulltime job, I'll fully utilized GitHub Copilot.

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett

That’s a really good method!

Collapse
 
blankscreenexe profile image
Muhammad Hammad Hassan

Yeah, I also let my mistakes burn in my head before I could use any auto complete feature.

With that said, co pilot is too close to being a code buddy so I like that.

Collapse
 
rishabh570 profile image
Rishabh Rawat

I really liked the part where you can generate the explaination for the code.

I would not fully rely on Copilot when I'm learning something brand new, but the explaination aspect is really interesting. Nice article!

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett

I agree! I don’t mean to solely rely on it, but just having it for additional context

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett

Thank you btw!

Collapse
 
dhravya profile image
Dhravya

Damnnn github copilot is soo cool!

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett

yes, it is!!!

Collapse
 
juliannicholls profile image
Julian Nicholls

Overall, I like CoPilot, and it has created some incredible code for me.

However, you need to (a) look for code you didn't realise that it had created when you took your eye off the ball for a moment, and (b) look at every line it has created because sometimes its intuition is either a little off or way off.

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett

It’s still in beta mode! Definitely give feedback to help us improve. Also I wrote about use cases in this article, and I acknowledge that it’s not all the way there yet: dev.to/github/why-use-github-copil...

Collapse
 
juliannicholls profile image
Julian Nicholls

This wasn't meant as criticism, far from it.

It was merely a warning to always look at the created code, particularly when you didn't realise that it had created some :-)

Thread Thread
 
blackgirlbytes profile image
Rizèl Scarlett • Edited

Oh, I didn't take it as such. I was just saying when mistakes do happen or copilot does something expected..there's a feedback area in copilot where you can provide feedback and help the feature improve, so we could reduce chances of that happening.

Collapse
 
evgeniigerasin profile image
Evgenii Gerasin

Juniors will not be needed soon? I thinks - yes

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett • Edited

I think juniors will still be needed, but it will help juniors to code more efficiently. I wrote another blog post about possible use cases for Copilot. You can check it out here: dev.to/github/why-use-github-copil...

Collapse
 
evgeniigerasin profile image
Evgenii Gerasin

I think junior may will be stay junior forever by this tools. Because, its tools stopping our thinks about code

Thread Thread
 
blackgirlbytes profile image
Rizèl Scarlett

I get what you're saying.

However..
Copilot can't write code without knowledge behind it. Copilot is more like stack overflow than someone who is thinking for us. You still have to think about code and understand what you're writing and why to use Copilot. Copilot just provides added context and suggestions. Also, Copilot is not ALWAYS accurate.

Thread Thread
 
evgeniigerasin profile image
Evgenii Gerasin

and junior cant understand correct code or not

Collapse
 
zanothis profile image
zanothis

Copilot Labs looks like it still has some work to do. If I didn't understand how that algorithm worked, that explanation would be almost useless. It seems to only explain the syntax without addressing the semantic meaning of the code.

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett • Edited

It’s still in beta mode, so yes true! We are open to feedback to improve

Collapse
 
zirkelc profile image
Chris Cook • Edited

I've been using Copilot for a few weeks now and I'm amazed how good it is. Sometimes, even the words and comments generated by Copilot are better than mine.

Collapse
 
evgeniigerasin profile image
Evgenii Gerasin

its true

Collapse
 
alexeagleson profile image
Alex Eagleson

That's a really cool use case. Thanks for the tip.

Collapse
 
naruaika profile image
Naufan Rusyda Faikar

Ha-ha. I've tried it myself, that's sick! Maybe one day we'll no longer need to share knowledge with people who used to be involved in writing code, where the code wasn't commented clearly enough.

Collapse
 
evgeniigerasin profile image
Evgenii Gerasin

What to do with legacy code, if we need change it?