Feeling like a failure, looking for few advice
Posted by Stock_Valuable7915@reddit | learnprogramming | View on Reddit | 4 comments
Hello guys!
I’ve tried to make a Calculator with The Odin Project, but after many attempts it was a failure. A huge one.
I’m sure for many of you and beginners included this project is not “easy“ but can be accomplished without a lot of difficulty, but to me, it was a 9/10 on scale of difficulty…
I know how to get the user inputs when he press the button and save it on an array but after that my brain is blank. Many of you used objects instead of arrays, but as always I don’t know how I can do it with objects too.
Anyways, I think I lack of discipline and logic. I know the syntax, loops, array, objects etc… but when I need to make a projects using them more in depth it’s a guaranteed failure.
I know I should practice a lot and have a better mindset when I’m encountering difficulties instead of ”giving up” but my brain become instantly blank and there’s no solution or idea to the problem I’m facing.
Should I try some exercises on Exercism / Codewars before retrying to do the Calculator ? Or should I give it another try because I’m not doing it right (not the right approach/technique)?
Maybe I’m not learning correctly and I don’t understand what I’m coding.. Should I add JavaScript infos when I’m learning something new in The Odin Project like objects?
- Is there something you do when you’re facing difficulty to not be upset and keeping to try to resolve the problem ?
I would love to have tips from people who’ve struggled too.. how I can learn effectively etc..thanks, have a great day.
_4bysswalker@reddit
Programming is about breaking a big problem into small pieces. Don't try to build a full professional scientific calculator, start by making a simple calculator that can add, subtract, divide, or multiply two numbers. I'd say try to build this without arrays. When you have done this, then look for ways to improve it and change things from there.
HashDefTrueFalse@reddit
When you're struggling with a programming problem you can:
- Look at other solutions to the problem to see how they did it
- Change the problem. Start with something even simpler than a calculator, then come back to it.
- Simplify the problem. Do you need a UI right away? Can you write a program that takes three hardcoded inputs (operator, operand1, operand2) and uses branching (if, switch) to match the operator, perform the operation on the operands and print the result? If you do that, you can then try to add a UI using a dropdown to select the operation and two number inputs. Then you could move to a keypad (I'll leave you to figure out how adding a keypad would change things).
E.g. simple calculator I cooked up just now:
Note: Code illustrative only.
Rain-And-Coffee@reddit
Hey OP,
It's common to get stuck, ex:
- I spent 1 month for a simple calculator and I'm frustrated
- Odin Project Calculator
Do you have a repo?
You should push your code even if it's broken, that way others can give you feedback.
g13n4@reddit
I know people will recommend a lot of things but in my personal journey codewars helped me a lot. Why? Because I was able to solve simple problems, gain confidence from it AND see how much kore experienced people solve such problems. And when I didn't know what they are doing I tried to split code into piece and google/inspect it to understand what's going on. Just read about things and what they are doing and sooner rather than later you will be able to overcome 99% of your coding problems