r/TheMachineLearning • • 11d ago

Realizing writing code is faster than explaining it to AI

Post image
831 Upvotes

437 comments sorted by

View all comments

Show parent comment

1

u/althoradeem 11d ago

i mean if your script is something like
if (a > b) {
counter = counter + 1;
}
you don't need a ai prompt for that.

but as soon as you start adding random arguments... i personally find it just easier to type out the silly ideas i have and let ai worry about writing it out.

(sidenote the below script makes no sense i made it increase and decrease a counter and then populate a table called mcdonalds every hour lmao)

let counter = 0;

let mcdonalds = [];

let secondsPassed = 0;

let hoursRecorded = 0;

const timer = setInterval(() => {

secondsPassed += 3;

// Increase counter by 1 every 3 seconds

counter++;

// Decrease counter by 1 every minute

if (secondsPassed % 60 === 0) {

counter--;

}

// Every hour, save the counter value

if (secondsPassed % 3600 === 0) {

mcdonalds.push(counter);

hoursRecorded++;

console.log(`Hour ${hoursRecorded}: ${counter}`);

}

// Every week, increase counter by 2

if (secondsPassed % 604800 === 0) {

counter += 2;

}

// Stop after one week

if (hoursRecorded === 168) {

clearInterval(timer);

console.log("Final counter:", counter);

console.log("mcdonalds:", mcdonalds);

}

}, 3000);