by ravenstine · 3y ago · 0 comments
Maybe I'm one of the hangers on who refuses to use it, not out of IP concerns but because I'd hate for it to cause my skills to rot or for me to become too dependent on it. I do sometimes have GPT-4 write code for me, but somehow I feel like it's different reading and reviewing its code than to punch a few characters into my IDE and have code magically appear.
For example, I gave Copilot something like this:
const textFile = longfile
const numLines =
I expected it to give me a regular expression that would count the number of new line characters, but instead it split the string on \n and asked for the length of that array. These are decent sized files (300ish lines) and this code is running in a hot loop over thousands of them, but I decided to give it a chance and benchmarked both choices.It turns out that even with all of the extra allocations, the regular expression solution was 4-5x slower than splitting and getting the length. Not something I would have guessed, but now I know.
I'm patching in a loop now (though I feel like a regular for loop is more readable than a loop with indexOf).
I'm coming from Kotlin where I expect there to be a standard library function for simple tasks like this, but I clearly need to get back in the habit of writing loops by hand.
I found it to just be… not how I wanted to work. I’m not sure it ever made me faster? Like it typed things for me, so there’s some savings there, but because I wasn’t precisely sure what all of this magic code does before I read thru it and renamed everything, it just felt like I was the copilot, reviewing the others work.
It sure is cool but not how I want to work.
I need to write a cron expression like once in couple years. So, I don't have working memory of it. So, to write it, I need to
1. Google "cron run something periodically".
2. Filter spam such as geeksforgeeks and irrelevant stackoverflows
3. Find either good enough approximation
4. If didn't work, go to cron man and start reading it. Example that I look for is 3rd from below in examples table https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cro...
OR
I can go to chatgpt/copilot and directly ask what I need
"Tell me a cron expression to run command on each third Monday of a month and explain it"
and it will give me good enough approximation right from the start. I won't need to fight popups that will shame me for using adblockers, I won't need to go through tons of spam. I will get much better headstart, that will save my time and energy.
ChatGPT responds:
> 0 0 0 ? * MON#3 *
Regarding MON#3, it explains: "Day of the week (MON#3): This is the crucial part of the expression. We use MON to specify that we want the command to run on a Monday. Then we append #3 to indicate that we want the third occurrence of Monday. This ensures that the command will run on the third Monday of the month."
It does not mention though, even with the smallest hint, that standard cron does not support this syntax. Or a 7-field syntax.
(By "standard cron" I mean Vixie cron derivatives like the one that ships with Debian)
The correct answer in this case would have been: "This is not possible with standard cron syntax alone. You can either use a different cron implementation that supports MON#3, or schedule for every Monday, but then in your script check if it's the third Monday."
I'd rather use something like https://crontab.guru/ to verify my syntax, thus I have it bookmarked for the 1-2 times a year it comes up.
An LLM is probably the only thing which could tell you this.
The key thing to me is it's nice for certain kinds of work. Loosely/offhand, those categories:
- Writing stuff from scratch: Sometimes useful. Particularly if it's a "write it, get it working, forget it" script.
- "Polishing" code with close attention to detail/docs/implementation: This is an area where I'm more likely to immerse myself in understanding the code, and wouldn't be likely to use Copilot, as it would break the immersion.
- Writing accessory scripts: E.g. a sqlite alembic migration script; I really am not a DB guy, so outlined some steps in a comment, read what Copilot wrote, tested it out, called it a day.
- Adding stuff in an existing codebase: In cases where there's hundreds of functions across dozens of files, the idea of copilot knowing the functions and suggesting them for me, without my needing to look them up, sounds great. I'd definitely like to attempt this with work's codebase someday. I think a lot of precursor tools could do much of this; but I just never got in the habit of needing them.
I spend more time with ChatGPT currently, but I'm pretty sure I'm nowhere near being a heavy user there, either. I think 75% of my peers are basically doing nothing with AI tools currently. (It helps that I do side projects a lot more than they do, too...)
I think the big difference is what type of programming people do. LLMs are great at handing you code that is routine, but I find them problematic when I try to do anything even a bit uncommon. I spend more time debugging than it would take to write it myself. I think a lot of this confusion is coming down to treating coding as coding and not looking at tasks. The same way writing a fantasy novel doesn't make you good at writing poetry, or a legal document, or a technical report.
I recently started learning Go and I felt like I hated it, I couldn't make any mistakes or think about the syntax because co-pilot was constantly trying to impress me.
One thing I really hate is it will always try to auto-complete my comments. Sorry robot, I am a divine being and these comment ramblings are mine alone.
You think it's bad now, imagine 5 years from now. This version of Copilot is just the beginning. Will you care about skill rot when everyone else around you knows the skills to effectively use the new generative AI models and is producing 5x?
I'd hate for it to cause my skills to rot
Well, good news: it's nowhere near good or useful enough for that. Currently it's mostly helpful with boilerplate stuff and coding quiz style challenges.It doesn't know anything about which algorithm might be appropriate for a novel challenge, it doesn't know anything about your database or codebase, etc.
My personal opinion so far is that this is going to be a very useful tool. A big leap will occur if/when it can work in tandem with knowledge of your local code+data. However I don't see it ever replacing higher level reasoning or rotting one's skills. Unless the "skill" in question is memorizing boilerplate stuff.
GPT writes larger blocks with more context, on demand. It's quite slow and ignores certain commands though which is irritating.
There are cases though where it came in clutch and implemented a solution much better than I could by leveraging some very hidden numpy function call that I couldn't find even if my life depended on it.
Nope. For what it's worth, I use Clojure(Script) these days, and working with the REPL is my preferred way to interactively "chat" with my program.
I asked family member how they use AI for programming. He said its mostly ChatGPT for soft skills like emails or JIRA tickets, or rubber ducking a design problem. He doesn't use any AI tooling for development. It seems both authors recognize this as well.
I feel you missed something here.
ChatGPT: reading and reviewing its code
Copilot: punch a few characters into my IDE and have code magically appear... and you read and review the magically appeared code, just like you do with ChatGPT?
I think combining or crafting your offboard brain/prompts at this point is par for the course, or maybe even a no brainer. Take your knowledge, and things you don't like or don't pique your interest, give it to the robots. That's what I've been doing so I can focus more on the critical path. I don't trust any of these robots, but not everything they produce is bad, some of it is actually pretty good.
I see this mentality a lot, and I don't understand it, but people seem to take satisfaction from doing things the hardest way. While I can appreciate the feeling of accomplishment, and being able to overcome an obstacle while learning, if there is a solution that takes less time to build and create while providing the same outcome, that tool is going to have a home in my tool chest.
If Copilot/GPT produces stuff with subtle problems, and it always will, then it will not be better code than someone with skills.
More testing? Generated by the same LLM? Sure, but it might be testing the wrong thing.
I think that those with skills should lean on them. Let code monkeys use LLM's; experts should be human, not a fleshy bot feeding another bot and uncritically using the spew.
Sure, but humans could be testing the wrong thing too.
They should, but let's not pretend that experts or any human for that matter are infallible.
I wouldn't refer to people as code monkeys, it's rude. I can see on the site listed in your profile you're having issues aligning your navigation <div> (left or center?). Like you I too make mistakes. In this case ChatGPT recommend using a <container>, while I'm not sure if it's the right path forward, it seems to fix the issue on your page keeping the <nav> left aligned.
My navigation is where I want it to be. It's not a mistake. Nice try.
Humans may be infallible, but if they wrote the code, they'll have an easier time figuring out where their assumptions were wrong because at least there were assumptions. An LLM just regurgitates statistically-massaged word lists.
I'd like to think that we should all want to formulate our questions well.
Having someone(something) complete our questions is like having someone interrupt you half-way through a thought and finish your sentence for you.
For the one completing the thought, they think they're being helpful. For the one being interrupted, there's a decent chance it's a <wtf?> moment.
Being able to form a complete thought by yourself is something that's important. Don't throw this away....
I'm sometimes asked to explain a piece of my code.
If I told my boss, "I dunno. ChatGPT wrote that part, and to me it looks like it works OK" I'd probably be fired.
At some level somebody with engineering knowledge is going to have to understand the problem domain, the code, the data, the use cases, ancillary data stores, etc.
So it is more like it is predicting what I already wanted to type, instead of being something like pair programming and giving snippets.
Outside of Leetcode-style stuff it's never going to produce reams of correct code in non-trivial projects with so little supervision that this is a major problem.
A similar thing happened with me using Adobe products at a student discount, only to realize its hefty $60 per month price tag was not something I was willing to spend.
And if the gained productivity is only marginal at best, it’s better to not grow dependent on these technologies.
This puts you closer to institutionalized domestic violence. Give up your existing career and become dependent on [service provider]; you won't ever need to be able to provide for yourself because my behavior will never change for the worse, right? No provider has ever decided to become withholding, vindictive or capricious, right?
Your lighter won't do this to you.
^ I'd say that's a pretty good litmus test of whether you should let the skill rot.
Somewhere along my family tree we didn't pass this skill forward and it was lost.
Personally I see it as a rite of passage for a senior developer to take note of and embrace their own limits.