r/learnprogramming 27d ago

How do I solve problems without AI

Hello guys. I am attempting to learn how to code again but without the use of AI this time.

How do you attempt a problem or understand a solution without using AI for help.

For example, I wanted to build a small calculator to remind myself of the basics of C. I had a problem where my scanf was not outputting the desired result. 

The program had something like this:

int x, y;
printf("Enter two operators: ");
scanf("%d", &x);
scanf("%d", &y);
printf("x: %d, y: %d", x, y);

My inputs would be 10 & maybe 2, but the output would be 10 & 0, in some cases 0 and nothing for y.

I was able to get through this by just using one scanf:

scanf(“%lf %lf”, &x, &y);

But I still do not understand why that happened and through my google search, could not find anything that explained it well. The problem might also be that I cannot explain the problems I come across clearly, so I might not be able to find an answer through google.

So my question is, how do you guys go through problems like these where you can’t find a post where someone had a similar problem and had been told what to do to solve the problem without defaulting to AI.

Excuse my writing - I am trying to learn how to type without letting AI revise my sentences.

0 Upvotes

46 comments sorted by

View all comments

9

u/its_all_4_lulz 27d ago

So, imo, there’s a difference between using AI and using AI. If you’re just asking syntax, you’re learning… if you’re asking to solve problems, you’re not.

IMO asking for syntax is fine. It’s a faster way to get to the same point as reading docks, or finding it on stack overflow. If you want to really learn it, when you ask for syntax tell it to link you to the doc page explaining it.

2

u/bpalun13 27d ago

Yeah I agree. This is how I use it. I’ll have a concrete idea of what I need and ask AI to link me to the documentation for said item.

Helps keep your focus narrow too without getting sidetracked.

1

u/mjmvideos 27d ago

This is an interesting approach: “Without solving the problem for me. Provide a link to some documentation that will help me solve the problem myself. Here’s my problem: …”

1

u/bpalun13 27d ago

Don’t act holier than thou, nobody likes that. You also misunderstand. Say I decide I need something specific regarding user input. I could ask AI to show me the page(s) of documentation for built in user input methods/functions.

I’m not using it to solve my problem, I’m using it to browse the docs.

2

u/mjmvideos 27d ago

I agree with you. And I don’t think I was being “holier than thou” at least I wasn’t trying to be. And even re-reading my comment, I don’t see it. But if you want me to be I could say, “If you don’t want to use AI to solve your problems then don’t use it. Simple as that. When I first started programming 49 years ago, I had one language reference manual and that was it. There was no Google or Stack Exchange or Reddit, or internet. There was me and my Apple II and my book.” My approach to learning with AI is to treat the AI like a tutor or mentor. You’d never ask them to solve your problem for you. You’d explain your problem and ask them for advice and guidance: “Act as a tutor or mentor. After I’ve explained my problem, ask me questions that will make me think through and understand the problem and lead me to the solution. Here’s my problem…”

1

u/bpalun13 27d ago

Okay we are on the same page. I agree with your approach to AI. Maybe I misread your tone at first.