FCC - JS/React Calculator forking codepens depression

Ciao campers,

I have had I guess what you can call a profound revelation so to speak. I have finished up the Front End Libraries cert except for the calculator and the timer. Then I am done.

While I was working through this curr. I was also doing the Python4Everybody course in it’s entirety.

Now… when I do code camp courses, and even the ones the don’t have a cert I will literally rewrite all code examples just for posterity I guess (or maybe some would call it stupidity), but I think it just helps me reinforce things and helps me learn to debug.

So, for many of these certs, I would look at other codepen submissions and find one that I (in hindsight “thought”) I understood real well, and I concurred with how it was approached etc. etc.

I finally thought to myself that “hey this is not YOU!” doing it from scratch! Ground zero! WTF! It’s bothering me alot. Many times, I would many be just doing some very cosmetic refactoring and only at the css/ui level.

So when I started to see how other people did the calculator project, I was very obsessed with how many lines of code it took a person to meet user story reqs. Especially on the JS/React side of things.

One thing I noticed though is that some of the projects met the tests 16/16, but did not meet my exact functionality thoughts.

Specifically, kind of like the drum machine. I should be able to use the literal keyboard key and not just the mouse to execute the calculator operations.

So, I looked (and looked and looked and looked over) this one persons pen for this project and I thought, this is it. How I would do it, with almost no refactoring and 90% of how they did it I understand.

So what’s the problem I feel like it’s just cheating period. Now, I don’t ever fork outright/or select all cut-n-paste. I literally will rewrite it with more comments at least so I understand better.

But now I feel so depressed, because I never have really written any code (Whatsoever I feel) from point zero.

What I would like to do is use this persons code, and perhaps refactor it to make it more concise and less js/react code but still pass all 16/16 tests. But I honestly wonder if it can be distilled down any further. This person seems to have written it pretty good.

Here is the pen. I really don’t want to write code from scratch though, just to rewrite it based on arrogance or pride, if the code I am forking is pretty damn good to begin with.

I just wanna write correct and concise code, that is also sane, stable and secure.

But… (OMG)… I just have this feeling of imposterism/cheating. I don’t know.

I don’t even know if this made sense.

Here is the code pen I want to base any sort of improving or refactoring on to pass the javascript calculator project.

Also, if anyone has the extra energy to mentor me that would be cool as well.

I hope this made some kind of sense.

From the swamps of New Jersey.

Very Respectfully.

Important: I will not use eval() or math.js.

Yeah, there is no such thing as a coder that doesn’t check out another coder’s code, even if it’s just stack overflow. Don’t be so hard on yourself. Just keep working and learning. Even great painting masters start out by copying other painters. Maybe if you want, go back and see if you can do those from scratch. Even if some of the code is something you remember someone else doing - if you remember and understand it, it is not part of your coding vocabulary. Just keep building that up. It’s a long and humbling process, for all of us.

1 Like

KevinSmith,

Thanks for your kind words of encouragement man. I won’t falter, and I won’t give up.

Waiting on here from some other folks and giving it a 72 hour break on the ol’ noggin. I’m an head 56yo, w/background in infosec, comsec, and almost every singular aspect of computers. Also, have a strong background in hacking, appsec. But if I can’t build web apps, as well then I’m done.

Again, Much respect man.

Thank you for your that.
I will push forward, carry the weight.

Jim

In many fields is common to start learning from the “old masters”, thinks of sculptor and painters, for example :slight_smile:
So no shame at all in learning by reading and imitating others that you look up to.

There’s also an argument to be made about not reinventing the wheel every time you work on something, but build on top of the shoulders of the giants.

However, I feel like “manually” re-write code is not a very efficient way of learning, mainly because it fails in giving you a very important skill:
confidence.

For example, a good exercise on this would be, why not just allowing “one peek” each session, and then try to rewrite by yourself?
You’ll still follow a guided example, but leading your own way.

Good luck and happy coding.

Marmiz,

I like your idea on just making a “peek”, and to be quite honest, I am slowing but surely moving directly into that mode of learning.

I guess my main question is also, that I would really like to go along with the pen I showed/linked to, but I am trying to understand how I could reduce the original js/react code but not to lose the press the key/as well as using a mouse functionality.

I am not sure if I can actually do this, because it seems like this persons code is so spot on. From my limited knowledge anyway.

As just like Kevin’s response, I appreciate your feedback. Not toxic, or tough-love, but most def. not coddling. Also, gave me concrete ideas on how to move forward as far as approaches to learning.

So… good-looking-out.
Hope you have a great day.

Perhaps in the future I can reach out to you from time to time.

Respectfully.
Jim somewhere in NJ.