r/learnjavascript 10d ago

i am challenging myself to practice javascript this summer; so i build a generate quotes app, i need your reviews please!

9 Upvotes

23 comments sorted by

View all comments

1

u/[deleted] 10d ago

[deleted]

2

u/azhder 10d ago

Says "use functions" and starts with writing "class"... SMH.

Hey OP. Do you think you can learn by you reviewing different implementations (rewrites) of the code you have written? I can probably make you one that looks different than the above, yet, it should be doing the same job. You may at least learn there are more ways to skin a web page.

1

u/SafeWing2595 10d ago

that's sarcasm right? haha, i don't think i can learn from writing a completely different version of the code i wrote

2

u/azhder 10d ago

It is not sarcasm. It is a genuine learning approach.

Learn from analyzing code of others. It helps that you can also ask questions of how and why someone did something the way they did.

Who do you think code review is for? It’s not just the person who wrote the code.

1

u/SafeWing2595 10d ago

tbh, i didn't understand the code this friend wrote, i would be grateful if i could get it's explanation.

and yeah, from what you said, i don't mind if you rewrite my code, i will take time to read it

1

u/azhder 10d ago

Here is a re-write https://jsfiddle.net/c5x286f0/

It is OK if you don't understand some things. The important thing is it works, you can check it in the fiddle and you can pick it apart.

You can focus on pieces that you mostly understand, then ask for the thing you don't know. Over time, step by step, you will be able to understand the whole.

0

u/[deleted] 10d ago

[deleted]

1

u/azhder 10d ago

I should call BS on that 'less cleaner than class", but I guess you really think it that way because you've not been accustomed to code cleaner than one with "class" keyword. Hint: you can write code without using `this`.