Please remove it if unallowed

I see alot of people in here who get mad at AI generated code and I am wondering why. I wrote a couple of bash scripts with the help of chatGPT and if anything, I think its great.

Now, I obviously didnt tell it to write the entire code by itself. That would be a horrible idea, instead, I would ask it questions along the way and test its output before putting it in my scripts.

I am fairly competent in writing programs. I know how and when to use arrays, loops, functions, conditionals, etc. I just dont know anything about bash’s syntax. Now, I could have used any other languages I knew but chose bash because it made the most sense, that bash is shipped with most linux distros out of the box and one does not have to install another interpreter/compiler for another language. I dont like Bash because of its, dare I say weird syntax but it made the most sense for my purpose so I chose it. Also I have not written anything of this complexity before in Bash, just a bunch of commands in multiple seperate lines so that I dont have to type those one after another. But this one required many rather advanced features. I was not motivated to learn Bash, I just wanted to put my idea into action.

I did start with internet search. But guides I found were lacking. I could not find how to pass values into the function and return from a function easily, or removing trailing slash from directory path or how to loop over array or how to catch errors that occured in previous command or how to seperate letter and number from a string, etc.

That is where chatGPT helped greatly. I would ask chatGPT to write these pieces of code whenever I encountered them, then test its code with various input to see if it works as expected. If not, I would ask it again with what case failed and it would revise the code before I put it in my scripts.

Thanks to chatGPT, someone who has 0 knowledge about bash can write bash easily and quickly that is fairly advanced. I dont think it would take this quick to write what I wrote if I had to do it the old fashioned way, I would eventually write it but it would take far too long. Thanks to chatGPT I can just write all this quickly and forget about it. If I want to learn Bash and am motivated, I would certainly take time to learn it in a nice way.

What do you think? What negative experience do you have with AI chatbots that made you hate them?

-4 points
*

Its not just AI code but AI stuff in general.

It boils down to lemmy having a disproportionate amount of leftist liberal arts college student types. Thats just the reality of this platform.

Those types tend to see AI as a threat to their creative independent business. As well as feeling slighted that their data may have been used to train a model.

Its understandable why lots of people denounce AI out of fear, spite, or ignorance. Its hard to remain fair and open to new technology when its threatening your livelihood and its early foundations may have scraped your data non-consentually for training.

So you’ll see AI hate circle jerk post every couple days from angry people who want to poison models and cheer for the idea that its just trendy nonesense. Dont debate them. Dont argue. Just let them vent and move on with your day.

permalink
report
reply
5 points

Lmao what weird projection is this. As a leftist liberal quality manager, I can tell you’re full of shit

permalink
report
parent
reply
2 points

Not really.

permalink
report
parent
reply
-1 points

I see you like when something threatens your livelihood.

permalink
report
parent
reply
-4 points

Lemmy is an outlier where anything “AI” immediately triggers the luddites to scream and rant (and occasionally send threats over PMs…) that it is bad because it is “AI” and so forth. So… massive grain of salt.

Speaking as (for simplicity’s sake) a software engineer who wears both a coder and a manager hat?

“AI” is incredibly useful for charlie work. Back in the day you would hire an intern or entry level staff to write your unit tests and documentation and utility functions. But, for well over a decade now, documentation and even many unit tests can be auto-generated by scripts for vim or plugins for an IDE. They aren’t necessarily great but… the stuff that Fred in Accounting’s son wrote was pretty dogshit too.

What LLMs+RAG do is step that up a few notches. You still aren’t going to have them write the critical path code. But you can farm off a LOT more charlie work to the point where you just need to do the equivalent of review an MR that came from a plugin rather than a kid who thinks we don’t know he reeks of weed.

And… that is good and bad. Good in that it means smaller companies/teams are capable of much bigger projects. And bad because it means a lot fewer entry level jobs to teach people how to code.

So that is the manager/mentor perspective. Let’s dig a bit deeper on your example:

I dont like Bash because of its, dare I say weird syntax but it made the most sense for my purpose so I chose it. Also I have not written anything of this complexity before in Bash, just a bunch of commands in multiple seperate lines so that I dont have to type those one after another. But this one required many rather advanced features. I was not motivated to learn Bash, I just wanted to put my idea into action.

I did start with internet search. But guides I found were lacking. I could not find how to pass values into the function and return from a function easily, or removing trailing slash from directory path or how to loop over array or how to catch errors that occured in previous command or how to seperate letter and number from a string, etc.

Honestly? That sounds to me like foundational issues. You already articulated what you need but you wanted to find an all in one guide rather than googing “bash function input example” or “bash function return example” or “strip trailing strash from directory path linux” and so forth. Also, I am pretty sure I very regularly find a guide that covers every one of those questions except for string processing every time I forget the syntax to a for loop in bash and need to google it.

And THAT is the problem with relying on these tools. I know plenty of people who fundamentally can’t write documentation because their IDE has always generated (completely worthless) doxygen for them. And it sounds like you don’t know how to self-educate on how to solve a problem.

Which is why, generally speaking:

I still prefer to offload the charlie work to newbies because it helps them learn (and it lets me justify their paycheck). And usually what I do is tell them I want to “walk you through our SDLC. it is kind of annoying” to watch over their shoulder and make sure they CAN do this by hand. Then… whatever. I don’t care if they pass everything through whatever our IT/Cybersecurity departments deem legit.

Which… personally? I generally still prefer “dumb” scripts to generate the boilerplate for myself. And when I do ask chatgpt or a “local” setup: I ask general questions. I don’t paste our codebase in. I say “Hey chatgpt, give me an example of setting the number of replicas of a pod based upon specific metrics collected with prometheus”. And I adapt that. Partially to make sure I understand what we are adding to our codebase and mostly because I still don’t trust those companies with my codebase and prompts. Which… is probably going to mean moving away from VSCode within the next year (yay Copilot) but… yeah.

permalink
report
reply
1 point
*

What the hell is Microsoft doing to VS Code? Are they going to REQUIRE copilot or something? If I have to give it up I’ll be sad.

permalink
report
parent
reply
2 points

Vscodium is your solution then

permalink
report
parent
reply
1 point

Well that’s cool as shit, I didn’t even know that existed. I’ll be switching. Thanks!

permalink
report
parent
reply
-10 points

A lot of people spent many many nights wasting away at learning some niche arcane knowledge and now are freaking out that a kid out of college can do what they can with a cool new machine. Maybe not fully what they do but 70% there and that makes them so hateful. They’ll pull out all these articles and studies but they’re just afraid to face the reality that their time and life was wasted and how unfair life can be

permalink
report
reply
3 points

Who hurt you?

permalink
report
parent
reply
0 points

I have been there, wasted learning stupid things I will never need to know.

permalink
report
parent
reply
2 points

Coders are gonna get especially screwed by AI, compared to other industries that were disrupted by leaps in technology.

Look at auto assembly. Look at how many humans used to be involved in that process. Now a lot of the assembly is performed by robotics.

The real sad part is that there’s tons of investment (in terms of time and in terms of money) to become a skilled programmer. Any idiot can read a guide on Python and throw together some functional scripts, but programming isn’t just writing lines of code. That code comes from tons of experience, experiments, and trial and error.

At least auto workers had unions though. Coders don’t have that luxury. As a profession it really had its big boom at a time when people had long since been trained to be skeptical of them.

permalink
report
parent
reply
-13 points

People are in denial. AI is going to take programmer’s jobs away, and programmers perceive AI as a natural enemy and a threat. That is why they want to discredit it in any way possible.

Honestly, I’ve used chatGPT for a hundred tasks, and it has always resulted in acceptable, good-quality work. I’ve never (!) encountered chatGPT making a grave or major error in any of the questions that I asked it (physics and material sciences).

permalink
report
reply
17 points

I’ve found it to be extremely helpful in coding. Instead of trying to read huge documentation pages, I can just have a chatbot read it and tell me the answer. My coworker has been wanting to learn Powershell. Using a chatbot, his understanding of the language has greatly improved. A chatbot can not only give you the answer, but it can break down how it reached that conclusion. It can be a very useful learning tool.

permalink
report
reply
6 points

It’s great for regurgitating pre written text. For generating new or usable code it’s largely useless. It doesn’t have an actual understanding of what it says. It can recombine information and elements its seen before. But not generate anything truly unique.

permalink
report
parent
reply
0 points

That isn’t what the comment you replied to was talking about so that’s why you’re getting downvoted even though some of what you said is right.

permalink
report
parent
reply
5 points

The first sentence addressed what they talked about. It’s great as an assistant to cut through documentation to get at what you need. In fact, here’s a recent video from Perry Fractic doing just that with microtext for the C64.

Anything else like having it generate the code itself, it’s more of a liability than an asset. Since it doesn’t really understand what its doing.

Perhaps I should have separated the two thoughts initially? Either way I’ve said my piece.

permalink
report
parent
reply
1 point

I’ve been using it for CLI syntax and code for a while now. It’s not always right but it definitely helps in getting you almost all the way there when it doesn’t. I will continue to use it 😁

permalink
report
parent
reply
-1 points

When was it wrong? I am curious like how much wrong it was and what AI assistent you asked.

permalink
report
parent
reply
1 point

Chatgpt all versions. I don’t know. I use it a lot and I just know it’s been wrong. Powershell comes to mind. And juniper srx syntax. And Alcatel.

permalink
report
parent
reply
2 points

It’s really useful to quickly find the parameters to convert something in a specific way using ffmpeg.

permalink
report
parent
reply
1 point

Hell yeah it is. So much faster than reading the man pages and stuff

permalink
report
parent
reply
3 points

Yes, me too, you can often ask it to explain it to a layman and it provides pretty easy to follow explanation

permalink
report
parent
reply
5 points

Is the explanation accurate?

permalink
report
parent
reply

Technology

!technology@lemmy.world

Create post

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


Community stats

  • 18K

    Monthly active users

  • 5.1K

    Posts

  • 92K

    Comments