this post was submitted on 02 Sep 2024
65 points (98.5% liked)

Experienced Devs

3961 readers
1 users here now

A community for discussion amongst professional software developers.

Posts should be relevant to those well into their careers.

For those looking to break into the industry, are hustling for their first job, or have just started their career and are looking for advice, check out:

founded 1 year ago
MODERATORS
 

As a senior developer, I don't find copilot particularly useful. Maybe it would have been more useful earlier in my career, but at this point writing a prompt to get copilot to regurgitate useful code and massaging the resulting output almost always takes as much or more time as it would for me just to write whatever it is I need to write. If I am able to give copilot a sufficiently specific prompt that it can 'solve' my problem for me, I already know how to solve the problem and how to write the code. So all I'm doing is using copilot as a ghost writer instead of writing it myself. And it doesn't seem to be any faster. The autocomplete features are net helpful because they're actually what I want often enough to offset the cost of reading the suggestion and deciding if it's useful. But it's not a huge difference (vs writing it myself) so that by itself is not sufficiently useful to justify paying the cost myself nor sufficient motivation to go to the effort of convincing my employer to pay for it.

you are viewing a single comment's thread
view the rest of the comments
[–] i_stole_ur_taco@lemmy.ca 36 points 2 months ago (1 children)

The autocomplete is fucking fantastic for writing unit tests, especially when there’s a bunch of tedious boilerplate that you frequently need SOME OF. I’m also really impressed by its ability to generate real code from comments or pseudocode.

Generally, though, I find it pretty awful for writing non-test code. It too often hallucinates an amazing API and I kick myself for not knowing it existed. Then I realize it’s because the API doesn’t actually exist, and the dumb fucker is clearly borrowing from a library from a completely different stack.

[–] JimmyMcGill@lemmy.world 4 points 2 months ago (1 children)

The autocomplete is amazing

It just takes the mental strain out of syntax and I can focus more on the logic and structure of the code

Like you said much better for writing unit tests, but also for log messages and comments

Even the chat is sometimes useful but not as much. I treat it as much junior engineer assistant/rubber duck. I.e. I never completely accept what it outputs and usually review everything but quite often it gives me a different idea/approach even if it doesn’t write it 100% correct the first time. Because I always review it, having it autocomplete the next line is my preferred approach so I verify each line as they come.

Once you start to past 10/20+ lines in a row you will have a bad time.

[–] howrar@lemmy.ca 2 points 2 months ago (1 children)

Not just the mental strain of syntax, but also variable naming, which I find to be a much bigger hurdle. Copilot will nearly always give you a "good enough" name so you can just move on to solve the actual problem. You can always come back to rename it if necessary.

[–] mcherm@lemmy.world 1 points 2 months ago (1 children)

Interesting. The way I work, variable naming is one of the key areas that I would never want to outsource to an AI -- careful choice of variable names is a key part of code quality for me: unimportant things should have neutral, non-distracting names while mportant things often cause me to break out a thesaurus for just the right word.

[–] howrar@lemmy.ca 2 points 2 months ago

It's important for sure. It just so happens to also be one of those things that are very easy to verify but hard to do, which is what makes it perfect for automation.

The other nice thing about letting AI do naming is that these are names that are very statistically likely given the context. That means it's more likely to be understood by others. If I come up with something myself, it might make sense to me, but it might not to someone else reading the code. I think this is especially important when you're working in your own little bubble and don't get many eyes on your code.