this post was submitted on 11 May 2024
770 points (99.1% liked)

Programmer Humor

20703 readers
632 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
(page 2) 18 comments
sorted by: hot top controversial new old
[–] [email protected] 39 points 9 months ago (5 children)

I was surprised when I made attackPower and it suggested defensePower next. It was then that it sunk in that the autocomplete was AI.

load more comments (5 replies)
[–] [email protected] 73 points 9 months ago* (last edited 9 months ago) (8 children)

don't get the negativity towards copilot in other comments.
it's a really smart autocomplete, and this is exactly what i wanted for the past 5 years.
(yeah it's not going to replace programmers or whatever people's exaggerated opinions of it are)

wanna quickly create a wgpu bind group?
let texture_bind_group = <tab> <tab> and it's smart enough to understand the context and pull in texture and texture sampler that are already defined as local variables.

too lazy to type this obvious thing in?
(like of course the next opcode islet op = self.fetch();) just press tab and move on with your life.

wanna quickly refactor something?
select, ask CP Chat to "replace all if statements with match", check if it's correct and click confirm (it will even show git-style diffs, so it's hard for something unexpected to slip in)

it's not perfect, and it's suggestions do not match your intention like 50% of the time but when they do match or your intention is REALLY obvious (like you already wrote a clear and concise variable name and need to complete the value), you're a single keypress away from completing those 2 lines of code

It's not a total deal breaker but it's definitely very useful. (especially for me, because of my very short attention span. unless i can quickly complete a thing I'm currently working on in less than a minute i will forget about the next 10 things I was thinking of doing)

also i don't believe the price is justified, but it's free for students so of course I'm gonna use it.

(you just need to verify your student email and upload a photo of your student id on education.github.com, and you get a free gh copilot subscription, gh pro account, priority support and promos on loads of services like heroku etc while you're a student)

[–] [email protected] 17 points 9 months ago* (last edited 9 months ago) (1 children)

too lazy to type this obvious thing in?

This has been the thing for me. I get really bored and lose focus when doing all the obvious repetitive stuff. And the obvious stuff is the stuff I find copilot does best. For anything that requires thought I'm engaged. Those are the fun parts of the job. It lets me do more of the fun part.

The one major downside that I've found is that sometimes I just want to tab complete a long variable/function name, and because of copilot i dont have "old style" tab completion anymore. (I could definitely still handle this myself, but i haven't)

edit: this all to say that I don't use copilot to write code that I don't know how to write, I use copilot to write code that I've written 1000 times before and don't want to write again. Copilot does a good job of looking through all the open files for context to help make sure the suggestions actually fit into the codebase's pre-existing style.

load more comments (1 replies)
load more comments (7 replies)
[–] [email protected] 98 points 9 months ago (3 children)

You got it admit, it is a good suggestion. It just wasn't the right one. But it is trained well enough to correlate left and right together. Since those are very commonly associated together it is certainly a logical choice.

[–] [email protected] 2 points 9 months ago (1 children)

it’s good but it’s wrong

That’s impossible.

load more comments (1 replies)
[–] [email protected] 65 points 9 months ago (11 children)

. But it is trained well enough to correlate left and right together

eliza could do that 60 years ago

load more comments (11 replies)
load more comments (1 replies)
[–] [email protected] 10 points 9 months ago

wibbly wobbly timey wimey

[–] [email protected] 17 points 9 months ago (3 children)

Glorified autocomplete. That, and Clippy.

[–] [email protected] -1 points 9 months ago (4 children)

Clippy was occasionally useful as it could offer shortcuts you didn't necessarily know about.

This is just bad autocomplete

load more comments (4 replies)
load more comments (2 replies)
load more comments
view more: ‹ prev next ›