Did I ruin it for myself?
Posted by SUPERWARRIOR345@reddit | learnprogramming | View on Reddit | 10 comments
I’m fairly new to programming. I’ve been learning quite a bit for the past bit. Learncpp.com is an amazing website along with thecherno YT channel. Anyways, I wanted to fuel my passion with putting a bit of my skills to the test. I wanted to make a simple calculator. In the end I did a simple one where you could do the addition, subtraction, multiplication or division of equations containing two or more numbers. Now, what I had built could only handle one operation at a time. I.e. if you had to add five numbers then it’ll add them all up but if you need to multiply and add then it can’t. I wanted to attempt to do that (it is beyond my expertise) but as all programmers do I hit some snags and walls. I have a stupid habit of “looking up the answer” in a way to put it. I’ve been working on it for the past couple hours and just looked up “C++ calculator make”. Something like that in google. There I saw the google AI’s code and I looked at it and understood some of it. I felt stupid for doing so and it kinda made me feel like shit. I don’t like what I did and that I understood some of what the AI did. There were concepts there I looked up and were things I haven’t touched on yet but it all seemed like it was the perfect thing for what I had wanted to do.
My question is: Did I ruin it for myself? Should I continue making it or continue on with the lessons and find another small thing to do? I just hated how I caved in like a fool. I know asking for help is good but this was beyond. I love coding and programming but idk why I did that. If y’all have any advice for not being an idiot like that then that’ll be appreciated too. Sorry for the format I’m on mobile.
armahillo@reddit
Good for understanding some of it! Sounds like you've learned some things so far.
The LLM showed you the possibilities of a different way to solve a problem. Sounds like you have some new keywords / concepts to go learn about.
I would say that if you copied the LLM generated code into your project and didn't change it, then you are missing out on the opportunity to learn about that. If you instead used the generated output as a list of things to go learn more about (maybe they use an array of pointers or a template function or something that you haven't learned yet) and then take what you learn and write it yourself (without looking at the generated code), then it sounds like you learned some new stuff!
Think of LLMs like using a cheatcode in a single player videogame. It will expose you to new stuff that you haven't yet earned your way into, yet, but it may also help you see the game in a different way, or focus on learning specific skills without having to attend to other struggles.
For example -- In minecraft, you can always open up the console and set your gamemode to "creative". This gives you ever single block you ever need, limitlessly. Cool! This can be really helpful when you're trying to figure out how to design a cool redstone contraption, because now you don't have to worry about interrupting your process to go find more redstone, or about creepers blowing up your progress, etc. You can just create.
Another way to think about it -- you're literally learning a language, a way to speak to your computer. If you were trying to learn a spoken language, using an LLM is like having a translator (either human, or using an app). You aren't really learning anything, and you're entirely dependent on the quality of the translator, and trusting that it is saying what you want it to say. If you were a photographer on assignment in another country and just needed to know how to get to the photoshoot, this makes total sense; no need to learn the language here. If you're trying to actually learn the language, that means you are trying to become the translator.
You might feel like an impostor for using an LLM but the whole basis of being an impostor means you are pretending to be something you aren't to an audience. Are you the only audience? Then just be honest with yourself about what you're actually doing. If you use LLM generated code and are passing it off as your own to other people -- ok, that's acting like an impostor.
I've been coding since childhood and have worked with many different languages, including C++. Learning anything is an uphill. Some things are steeper uphills than others, but it's always going to challenge you because you are literally building new neural connections in your brain, and that takes effort.
If you want to ride the LLM cablecar up a part of the mountain, that's your prerogative, but you are missing out on learning opportunities to become stronger. I guarantee that the hill only gets steeper the further up you get, and you are going to want a strong body and good endurance when you get there. You can always go back down the mountain and practice those parts again to get stronger, even if you've previously taken the cablecar.
SUPERWARRIOR345@reddit (OP)
I appreaciate your response. I will continue to learn and understand concepts that I'm not fully knowledeable on. I will continue this project and whenever I get stumped I should understand my process of what I'm trying to achieve and seek help from others in the same community as me. As long as I learn from what I don't understand and not just copy/paste the code into my own projects without an inkling of what it does then I should be fine. Something I should know and learn. Thank you so much!
Bee892@reddit
Nobody would trust software ever again if they knew how often programmers looked up how to do things. That's what programming is. You code yourself into a spot where you don't know how to accomplish what you want to. Time to bust out Google. Sometimes you bust out an AI and ask how it would do it. This is an important part of learning. Not everybody can know how to program everything in all languages, so we rely on the internet to hold the information for us until we need it again. Keep going! You didn't ruin anything. This is how programming is. When learning, you always want to try to come up with the answer yourself, but at some point, you need help.
Maelstrom_2099@reddit
You just need to learn more about data structures for this particular problem. Creating a calculator- as you learned - is much harder than people think. Is it an infix or postfix calculator? Are you going to implement order of operations.
There are reasons courses are designed in a specific order focusing on specific things. Find a complete course, not random videos and Google searches.
BTW having been a cs teacher and now working at a security sw company, don't blindly copy code off the web because you think it works. You'll end up having to explain to Product Security where the code came from in significant portions are copy pasta or contain vulnerabilities you never knew about.
Senditduud@reddit
TLDR Yes and no. But mostly no.
The yes. You’re learning so using AI kind of defeats that purpose. You learn by doing. Currently you are training your “problem solving muscle” and using AI does that dis justice but…. another major skill in programming is to be able to seek information you don’t know. In the past it was documentation, tutorials, and good ole stackoverflow. Now AI has kind of condensed that process into one step and you have to cross your fingers and hope it’s right. Google-foo is a skill in itself, albeit less and less these days, but sometimes you get in so deep that not even AI can figure it out.
The no. In real life the top priority is producing code that works, no matter the source. Copy and paste from AI, stackoverflow, your brain, if it works it works. Though you should understand it, using the first 2 makes that more difficult.
Should you continue your project? Abso-fucking-lutly. Look you’re learning, you’re not going to be able to pull every library and algorithm out of your ass. You need help, and like I said before finding out info is a skill in itself. Implement your feature and then think of new one. Can you undo operations? Deal with exponents? What happens when you divide by 0 or reach max int? There’s plenty to do, don’t let this discourage you.
A little advice for the future, when you really really really want to solve something yourself but you need help and when you google for a nudge you accidentally get the whole answer (will be very common now that AI is the first result), when you have your “aha how could I have been so dumb moment”, close the browser immediately and implement it all by hand without reference if you can. The over arching concept will be understood but you’ll still have to work to implement it.
SUPERWARRIOR345@reddit (OP)
I won’t let it discourage me and I’ll continue my project. Thank you so much.
No_Indication_1238@reddit
No. Stopping right now will be the biggest mistake. Read what the AI suggested. Understand it. Write the logic on a piece of paper. Then implement it yourself without any help. That is how you learn. You don't have to reinvent the wheel, sooner or later (much sooner than one might expect) you will hit a problem that was solved by a dude/gal that had a PhD, worked for months and then had the algorithm be named after them. Coming up with those solutions isn't realistic. No need to reinvent the wheel.
SUPERWARRIOR345@reddit (OP)
Thank you very much for your response. I will not stop now and I will continue the project I have set for myself.
BleachedPink@reddit
Personally, if you self-studying, looking up an answer isn't bad, but try to look for tactics and strategies first, before looking at completely solved code.
I recall I used polish notation to make my calculator work with multiple operations. I bet, someone on the internet would mention that as well and explain, or you could check wiki for further explanation.
Usually, I look at the solution if I can't find a strategy or it doesn't help me. But take time to really understand it, write it your way, check the logic line by line etc.
Imo, you shouldn't be afraid to look at solutions, but be honest, and try to struggle and solve it on your own first
saltedbenis@reddit
If you copy and paste code from an AI with no desire to really understand it, then you're basically cheating yourself at that point. But if you're looking for examples of a solution to a problem and aim to understand exactly how that works, then not at all.
You're not at all stupid for using AI, but do it wisely!