DEV Community

DataMoshing
DataMoshing

Posted on • Updated on

TOP foundations completed

The Odin Project foundations are completed! It's been a long 7 months since my first commit starting TOP, I am not necessarily the fastest learner and do fall into programming rabbit holes quite often along with having to reread material multiple times but eventually with persistence and grit little by little we made it! Now onto the final project in the foundations, it was very difficult for me. The first steps were manageable, creating functions for basic math functions such as add, subtract, multiply, etc. Create a barebones calculator with some CSS and buttons for the numbers along with an operate function that calls from the function you created add(), subtract(), and so on. The next step is doing a bit of DOM manipulation and EventListeners display numbers/operators on the calculator and then to the most difficult part of the project storing the values along with calling the operate function to well... Make the calculator work as intended! This is where I had the most trouble as my problem-solving skills are not the best which is crucial to becoming a great programmer. Luckily the TOP community was there to guide me through this uphill battle specifically one member who helped break down the problem into smaller problems.

  • Have a current number that is being inputted.

  • Save that current number into a variable (currentNumber = firstNumber)

  • Get the operator that was inputted and save that to a variable as well (savedOperator = operator.value)

  • Now that we have the operator and first number saved now check if there is an operand plus an operator now move onto the second number.

  • Since we now have a first operand + operator + second number update the display with result!

Pretty simple right ? 🙈

Improvements that could be made

  1. Make the calculator be able to operate decimal point numbers

  2. Display overflows when number exceeds a certain point.

  3. Delete button is finicky, can delete number only after it is replaced with another number. Cannot delete number and operate right after, returns old number.

Ruby on Rails here I come! (Edited decided to go with the Nodejs path, although the Ruby path is amazing and more "fleshed out" personally I needed my CSS and designing.)

Image description

Top comments (2)

Collapse
 
dizenver profile image
Denver Martinez

I am in a similar spot, as I just finished up the foundations section last weekend. With TOP being very much reading based (so far at least), I definitely found myself re-reading sections a lot. I personally don't read much at all for leisure, so that was one of the biggest struggles for me. I found it easier to read the assigned items from each section when I was working on it and then just bookmark all the supplemental reading to read on my phone, or at work during down time the following day. I found that it helped me continue to the next section without getting demotivated hitting a wall of just reading optional supplemental learning type stuff at the end of every section.

Good job on completing the foundations though! Keep it up!

Collapse
 
datamoshing profile image
DataMoshing • Edited

Hey Denver, definitely couldn't agree with you more, there is A LOT of reading. We are in the same boat on not reading for leisure. I have also found myself re-reading over most sections twice if not more making sure to fully grasp the material. Congratulations on also finishing TOP foundations! This is only the beginning, best of luck on your journey.