7 ms·
I had a related episode at work when my coworker asked me why his seemingly trivial 10 line piece of code was misbehaving inexplicably. It turned out he had tw
by alexeiz 2y ago
I had a related episode at work when my coworker asked me why his seemingly trivial 10 line piece of code was misbehaving inexplicably. It turned out he had two variables `file_name` and `filename` and used one in place of another. I asked him how he ended up with such code, he said he used copilot to create it. Using code from a generative AI without understanding what it does is never a good idea.
- frumper 2y agoI knew a guy that made a good living as a freelance web developer decades ago. He would pretty much just copy and paste code from tutorials or stack overflow and had no real idea how anything worked. Using code without understanding it is never a good idea, it doesn’t need to be from AI for that to be true.
- Laakeri 2y agoBut he made a good living out of it, so in the end it was a good idea?
- emseetech 2y agoIt certainly puts a ceiling on a career. And I'd argue it probably gave him a pretty rough shelf life. At some point he has to understand what he's doing. Unless he's so good at selling his services he can consistently find new clients. And if that's the case, he'd probably kill it in sales.
- fragmede 2y agosales engineer is quite a lucrative career. don't have to be really good at it, just enough to be useful.
- snoxy 2y agoSales engineers have to be good enough to bluff their way through the layers of hyperbole/minor exaggeration/utter bullshit (delete as applicable) the sales team have spun. Whether their conscience gets involved before the deal closes, different question.
- gizmo686 2y agoNot at my work. Around here sales engineers just say "this is a proof of concept, X will be different in the final version". Then, after they close the deal, they give us their half implemented feature they developed that none of us heard about before, and tell ys that we need to finish it and include it in the next release.
- efilife 2y agoCope. People often make money on things they know nothing about
- dazzawazza 2y agoI'll bet the ceiling is CTO.
- HeyLaughingBoy 2y agoMost people never reach the theoretical ceiling of their careers, so he probably did quite well.
- thephyber 2y agoHe may have made a good living, but his customer / employer bought low quality code with lots of tech debt. That business model only works until customers are sophisticated enough to understand tech debt. In the future, more customers will be less willing to pay the same good wages for low quality code.
- throwaway2037 2y ago> but his customer / employer bought low quality code with lots of tech debt. Sarcastic reply: Isn't that most tech? Even good (above average) developer produce lots of tech debt and sometimes low quality code.
- datavirtue 2y agoYeah, and the business people could not care less. I am on a team taking in millions of dollars from a Delphi Windows app from 1997. Zero tests, horribly mangled business logic embedded in UI handlers. Maintaining that app is not feasible. I'm rebuilding a modern version of it only because it is embarrassing to demo and is such a UX nightmare that our distributor made us commit to a new app.
- b112 2y ago"Webdev" makes me think of wordpress, which is like planting 20 onions in your backyard, and comparing yourself to a farmer with acres of crops. I can completely believe someone had no idea what they were doing when copy/pasting, and working on wordpress.
- f6v 2y agoOr maybe you’re just exaggerating. I’ve done my fair share of copy pasting and it never worked to just do it without understanding what’s going on. I think the problem with “AI” code is that many people have almost a religions belief. There’re weirdos on internet who say that AGI is couple years away. And by extension current AI models are seen as something incapable of making a mistake when writing code.
- n4r9 2y agoThe other downside to AI code vs stackoverflow is that a stackoverflow post can be updated, or a helpful reply might point out the error. With the advent of LLMs we may be losing this communal element of learning and knowledge-sharing.
- Piskvorrr 2y agoWe aren't. LLMs may have been useful for a moment in time, before the trick "it's now MY OWN creation, no IP strings attached - when it comes through the plagiarism machine" became apparent, and before the models started eating their own tail. Now they're just spiralling down, and it will IMNSHO take something else than an iterative "a future version will surely fix this, One Day, have faith."
- n4r9 2y agoThere are signs of a decline in people asking and answering questions on sites like stack exchange: https://meta.stackexchange.com/questions/387278/has-stack-exchanges-traffic-decreased-since-chatgpt https://meta.stackexchange.com/questions/387278/has-stack-ex... So I hope you're right, but the evidence is currently that you're wrong. Let's see how it plays out, I suppose.
- Piskvorrr 2y ago- Which might be a different matter: of specifically SE declining. (A very different, and long-running, tragedy, but one that began long before the current AI boom and prompted by very different, non-technical issues.) - That said, surely traffic will decline for Q&A sites. "How do I connect tab A into slot B" is something that people are likely to query LLMs for; the response will surely sound authoritative, and could be even correct. That's definitely a task where LLMs could help: common questions that have been asked many times (and as such, are likely to be well-answered in the human-made training data). A 20001st question of "how do I right-align a paragraph in HTML" has not been posted? Good. Rote tasks are well-suited to automation. (Which, again, brings us back to the issue "how to distinguish the response quality?")
- Cthulhu_ 2y agoThis is a known issue from like the 2000s where there were so many bad PHP tutorials, a lot of SQL injection and XSS etc came from those.
- jazz9k 2y agoI knew someone similar. They would just get free templates and sell them as a website to customers, with almost no changes, aside from logos and text. Most had no Javascript or css and looked terrible, even by 2005 standards. His clients were usually older small business owners that just wanted a web presence. His rate was $5000/site. Within a few years, business dried up and he had to do something completely different. He also hosted his own smtp server for clients.It was an old server on his cable modem in a dusty garage. I helped him prevent spoofing/relaying a few times, but he kept tinkering with the settings and it would happen all over again.
- falcor84 2y ago>a guy that made a good living ... never a good idea Arguably the term for a bad idea that works is "good idea"
- frumper 2y agoThat's fair. From a personal perspective it was a good idea. He regularly had sites get compromised though, so for his customers it wasn't always a good product. He generally kept his customers happy though.
- digging 2y agoOr maybe "good" and "bad" aren't useful descriptors in this context.
- macksd 2y agoThere are plumbers who make a living but whose work results in leaks in people's homes. They're making a living, but I don't consider the way they work "a good idea".
- JKCalhoun 2y agoAt least AI comments their code.
- mooreds 2y ago> Using code from a generative AI without understanding what it does is never a good idea. Hear hear! I feel like genAI is turning devs from authors to editors. Anyone who thinks the latter is lesser than the former has not performed both functions. Editing properly, to elevate the meaning of the author, is a worthy and difficult endeavor.
- FanaHOVA 2y agoCopilot wouldn't make a typo. He just made that up and / or broke the code himself.
- creesch 2y agoLOL, are you kidding me? LLMs including the gpt family copilot uses are very good at sneaking in these sorts of thing.
- FanaHOVA 2y agoShow me 1 example.
- creesch 2y agoShow me that copilot never makes a mistake or introduces variables that never have been initialized...
- brigadier132 2y agoThis is a strawman, he never said it didn't make mistakes.
- creesch 2y agoOh for crying out loud, I obviously mean these specific mistakes. If you have worked in any capacity with LLMs like this you would have seen them variables or suddenly switch up the convention of how they're written. Certainly if you are in a conversation mode after a few back and forths this happens from time to time. I am just not going to spend my time digging to previous prompts of code I might not want to share just to satisfy a random internet person .
- brigadier132 2y agoThe models I've used don't make typos on variable names that already exist in the context. Typos are not the failure mode, this is literally the easiest text prediction task they can do.
- Glyptodon 2y agoAt least for me stupid bugs like this turn out to be some of the most time wasting to debug, no AI involved. Like accidentally have something quoted somewhere, or add an 's' to a variable by accident and I may not even correctly process what the error message is reporting at first. Always feel a bit silly after.
- Noumenon72 2y agoThese kinds of problems are often avoidable by linters or asking ChatGPT what is wrong, though I was just tearing my hair wondering why TSC_COMPILE_ERROR wasn't skipping TypeScript because I spelled it TSX_COMPILE_ERROR in my environment variable.
- viraptor 2y agoNot only asking ChatGPT what is wrong, but also using an agent which does self-reflection by default. I'm sad every time I see people using the bare chat interface to generate code. We've got API tools which are so much better at it today. Use Aider at the very least.
- floydnoel 2y agodoes aider have an executable installer yet? i tried installing it but the python experience is terrible. last time i messed with python installs on my mac everything worked like shit until o reinstalled the OS.
- viraptor 2y agopython -mvenv aider aider/bin/pip install aider-chat aider/bin/aider And you're done. There's also a docker version https://aider.chat/docs/install/docker.html https://aider.chat/docs/install/docker.html Just don't mess with the system-wide installed version of python and it will be fine. This isn't a python specific issue though.
- 2y ago
- EVa5I7bHFq9mnYK 2y agoSounds like javascript "code". A normal language with proper type system would not allow that.
- CalRobert 2y agoI don’t see how typing relates to this.
- mkl 2y agoProbably one of the variables is undefined, and static typing could catch that.
- timeon 2y agoAlso warning for unused variable.
- normie3000 2y agoIs it the compiler that would catch it?
- mkl 2y agoYes. This would be caught by the compiler in C, C++, Java, Rust, Haskell, etc.: https://stackoverflow.com/questions/1517582/what-is-the-difference-between-statically-typed-and-dynamically-typed-languages#1517670 https://stackoverflow.com/questions/1517582/what-is-the-diff... Many statically typed languages do have escape hatches to do some dynamic typing at runtime, but this is not the default (hence the classification), and it requires some additional effort to use.
- zo1 2y agoIt's not the language, it's the IDE and laziness. They're doing this in notepad or maybe VSCode and don't have anything configured for highlighting or checking. Heck they probably don't even know how to interpret the error message saying "file_name is not declared". I'm the first to bash JS, but this is not a JS issue. It's 100% a "bad and lazy" human actor that is throwing spaghetti on the wall to see what sticks. In this case, they have a minigun cannon called ChatGPT/CoPilot that is letting them do more of it than what they used to.
- delusional 2y agoWe hired a new guy at work. In one of his first tasks he had chosen to write some bash, and it was pure nonsense. I mean it contained things like: if [ -z "${Var}+x" ] Where I can see what the author was trying to do, but the code is just wrong. I dont mind people not knowing stuff, especially when it's essentially Bash trivia. But what broke my heart was when I pointed out the problem, linked to the documentation, but recieved the response "I dont know what it means, I just used copilot" followed by him just removing the code. What a waste of a learning opportunity.
- woctordho 2y agoEveryone working with shell scripts should know shellcheck
- swah 2y agoAnd Python...
- rwmj 2y agoAnd you didn't sack him?
- delusional 2y agoI don't have hiring privileges. Either way. I like the guy, and I'd rather work to build him up. That doesn't mean it's not frustrating, but I have a process that seems to build a pretty good culture.
- OJFord 2y agoAnd of a salary...
- steelframe 2y agoWait until a manager who's evaluating a technical decision you're making copies and pastes ChatGPT's "analysis" of your proposal and asks you to respond to it.
- 2y ago
- Tainnor 2y agoAnd any decent IDE will highlight a variable that is declared but unused. We already have "artificial intelligence" in the form of IDEs, linters, compilers, etc. but some people apparently think we should just throw it all away now that we have LLMs.
- tomrod 2y agoNo need for quotes, the best AI integrations are the ones you see as just part of the tech stack like spell check and linters.
- wiseowise 2y agoBut that’s WoOoOrK. These stupid sobs want magic that does everything automatically.
- tomrod 2y agoYes, labor costs aren't magically replaced by trained AI models, MBA protestations aside
- cqqxo4zV46cp 2y agoI trust that you’re all done patting each other on the back now, yes?
- tomrod 2y agoTherefore, what?
- hayley-patton 2y agoRight, your static analysis tools will likely use Abstract Interpretation.
- sa-code 2y agoUnless you're using Python and said variable was meant to be reassigned, but you used a different name instead. E.g. file_name = 1 filename = 2
- ben_w 2y ago> Using code from a generative AI without understanding what it does is never a good idea. True, but the anecdote doesn't prove the point. It's easy to miss that kind of difference even if you wrote the code yourself.
- latexr 2y ago> It's easy to miss that kind of difference even if you wrote the code yourself. The developer in the story had no idea what the code did, hence they would not have written it themselves, making it impossible for them to “miss” anything.
- planb 2y agoIn my experience this is exactly the kind of mistake an AI would not make.
- yawnxyz 2y agoClaude gave me something similar, except these were both used, and somehow global variables, and it got confused about when to use which one. Asking it to refactor / fix it made it worse bc it'd get confused, and merge them into a single variable — the problem was they had slightly different uses, which broke everything I had to step through the code line by line to fix it. Using Claude's still faster for me, as it'd probably take a week for me to write the code in the first place. BUT there's a lot of traps like this hidden everywhere probably, and those will rear their ugly heads at some point. Wish there was a good test generation tool to go with the code generation tool...
- danenania 2y agoOne thing I've found in doing a lot of coding with LLMs is that you're often better off updating the initial prompt and starting fresh rather than asking for fixes. Having mistakes in context seems to 'contaminate' the results and you keep getting more problems even when you're specifically asking for a fix. It does make some sense as LLMs are generally known to respond much better to positive examples than negative examples. If an LLM sees the wrong way, it can't help being influenced by it, even if your prompt says very sternly not to do it that way. So you're usually better off re-framing what you want in positive terms. I actually built an AI coding tool to help enable the workflow of backing up and re-prompting: https://github.com/plandex-ai/plandex https://github.com/plandex-ai/plandex
- withinboredom 2y agoAs someone who uses LLMs on my hobby projects to write code, I’ve found the opposite. I usually fix the code, then send it in saying it is a refactor to clarify things. It seems to work well enough. If it is rather complex, I will paste the broken code into another conversation and ask it to refactor/explain what is going on.
- danenania 2y agoFixing the mistake yourself and then sending the code back is a positive example, since you're demonstrating the correct way rather than asking for a fix. But in my experience, if you continue iterating from that point, there's still a risk that parts of the original broken code can leak back into the output again later on since the broken code is still in context. Ymmv of course and it definitely depends a lot on the complexity of what you're doing.
- berniedurfee 2y agoI burned a couple hours debugging some generated code only to finally realize copilot was referencing a variable as ‘variableO1’. Artificial Incompetence indeed!
- bckr 2y ago> Using code from a generative AI without understanding what it does is never a good idea. Yes. AI as a faster way to type: Great! AI as a way to discover capabilities: OK. Faster way to think and solve problems: Actively harmful.
- morgango 2y agoInterestingly, a great application for GenAI is to copy and paste code and ask it, "Why is this not working?". It works even better if you give it the specific error you are getting (and it is a well understood system).