This content originally appeared on DEV Community and was authored by CodeCara
Things I've worked on/completed since my last post…
I have been working on the calculator project this week.
Things that went well..
I was slightly more methodical in my approach to this project and paid more attention to grouping code in a logical way; at least at the beginning.
In previous projects, I was just grateful to get the project working as required and did not make much effort to refactor the code. I have tried to pay attention to this in this project, even though I haven't finished it yet and may try to refactor the code again once I have everything working.
I used more comments as reminders to myself (and others) as to what each part of the code was doing. I will probably try to edit these down when I finish the project.
I think this is the first project in which I called functions from within other functions and I found it easier to identify where I could do this in comparison to prior projects.
I figured out how to concatenate strings generated by click events and I used the forEach method to attach a click event to a group of buttons.
I got some good experience of *using booleans to trigger desired results *(e.g. if (resultAlreadyCalculated = true) {do x}.
I did have a few issues (see section below), but I went slowly though the code, step-by-step and eventually figured out how to fix the problem. I found this very satisfying.
Things didn't go quite so well..
I had a lot of trouble with resizing my window size on Xubuntu at the start of this week. This impeded me from working, but I figured it out in the end.
Even though I implemented more functions where I saw that they could be used, I am sure that I could implement more the make the code 'read cleaner'.
I got stuck for a few days on trying to figure out how to reset the firstNumber of a subsequent calculation, to the result of a current calculation. I thought this would be an easy task (say by putting firstNumber = result somewhere), but it was not that easy.
I eventually worked this out by going through the code slowly. However, one thing that I noticed was that once I got it working, I was struggling to remember how I fixed it(!). Perhaps this was to do with the desire to finish it quickly, but what I have learnt from this specifically is to talk myself through how I solved it and to try to retain this in future. From speaking to other people learning web dev, it seems that this is not uncommon.
Things I've learnt/things I need to improve on…
I need to be more mindful of how I solve things as when I am trying multiple things and I am eager to fix something, sometimes I forget how I actually solved the problem.
Plan for the forthcoming week…
I am determined to finish the calculator this week as I managed to get most of the functionality in place today.
This content originally appeared on DEV Community and was authored by CodeCara
CodeCara | Sciencx (2024-07-28T20:54:32+00:00) Some of it is adding up…. Retrieved from https://www.scien.cx/2024/07/28/some-of-it-is-adding-up/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.