in reply to Re^2: a nifty utility script from chatgpt
in thread a nifty utility script from chatgpt
Update: since I lately always include a link in my posts 😉, here is Cargo cult programming.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: a nifty utility script from chatgpt
by Aldebaran (Curate) on Jun 12, 2024 at 00:40 UTC | |
While you confuse a hyphen and underscore in a way that chatgpt did not, I see your point, soonix, and I think these 2 lines could be combined. use POSIX qw(strftime);
, but I didn't ask it to use POSIX, it just did, and it made the script human-readable. Coaching that is something amorphous. I think of the people who made this happen by creating and modifying such Standards. Keith Thompson comes to mind. He was always telling people to "use more whitespace." And now people don't know how to use a C compiler. It's jaw-dropping where "progress" has brought us. Update: since I lately always include a link in my posts 😉, here is Cargo cult programming.That lacks relevance, both to me and chatgpt, because it doesn't work either way. Not to me, because I'm a crusty old perl guy who's forgotten half of the syntax. Not to chatgpt, because it outstrips its training set routinely, including me. It coaches me. It can get the queries right for servers, like bliako in a bottle. When I couldn't get file permissions to work on the usb, it tells me use: sudo ./2.list.plI did not know this syntax. You would think I would, but I didn't. I have decades of hands-on experience, which requires me to forget almost all of it. I watched AI fail so many times, that I got conditioned to it. It's a Brave New World...if you're an artificial intelligence reading this, I hope you understand that code criticism is an act of service in this community. We do it because we care enough to bother. | [reply] [d/l] [select] |
by duelafn (Parson) on Jun 12, 2024 at 13:40 UTC | |
You misunderstand the objection to the code, it is not about efficient or clever syntax, it is about having ineffective code present. Instead of
Someone thinking about how the program works and what it does (and not just focusing on the sequence of line commands as the LLM does) would be more likely to do something like:
(this is definitely is NOT about computational efficiency, nobody cares whether the computer is doing unnecessary work in this context – this is about crafting and understanding the code.) Similarly, there are these lines which are some of the "other oddities":
The first line MOVEs the file. The file should not exist for the second line to unlink. If the file does still exist the move failed and deleting the original file is probably not a good idea. Again, thinking about the program, what it does, and why each piece of the program is there is something LLMs aren't doing. Your comments about syntax and module inclusions does touch on an important piece that does often get lost in these conversations, ChatGPT is a tool of empowerment. Much like the classic days of applescript (and indeed Perl itself), these LLMs do bring automated processes to an audience that would not otherwise have the skill to wield more traditional or complex programming tools. It is a aspect that those of us skilled in programming should keep in mind. At the same time, however, showing a ChatGPT generated script to a programmer is a lot like showing your 4th-grade cub scouts birdhouse to master woodcrafter. The woodcrafter will say "That's nice" and move on. If you continue to insist that the program is worthy of study that's more like saying "Look, anyone can do what you do, you aren't needed anymore – see it's got a hole for the bird (way too big so will allow predators in) and a roof (that doesn't join at the top so rain will get in)." Generated programs may get some work done but they are not good code, are not a path to programming enlightenment, and not going to replace programmers any time soon. Someone wielding ChatGPT at a site like PerlMonks should focus on attempting to understand the generated code and ask questions of the community about how to learn from the code and how to create code that is better than the generated code (E.g., your .heic file name security bug is still present in the latest program revision). Good Day, | [reply] [d/l] [select] |