theforumhelpers / theforumhelpers.github.io

The site for the Scratch group "The Forum Helpers"
https://theforumhelpers.github.io/
MIT License
26 stars 16 forks source link

Simplify FHP.js and use code supporting modern browsers #350

Open Weredime opened 2 years ago

Weredime commented 2 years ago

We currently implement the fetch standard, which is present starting Chromium 42 and Firefox 39. In FHP.js, we can really simplify it a LOT, and use better code practices supported in these versions, such as:

I hope you take this into consideration, as this would introduce new JavaScript programmers to better solutions for code, instead of old ones.

gosoccerboy5 commented 2 years ago

document.createElement in FHP.js would make it a lot more verbose, and I don't think XSS is as much of a risk for such a simple, relatively low-traffic site like this

penguinmoose commented 2 years ago

Yeah, I’ve heard that let is sometimes better than var

penguinmoose commented 2 years ago

And I always use const for things that don’t change - it’s just better (it doesn’t let you change it I think) in my opinion.

gosoccerboy5 commented 2 years ago

does it really matter in the case of this repo tho?

penguinmoose commented 2 years ago

@gosoccerboy5 It probably won't impact the actual site. I guess it's just a code improvement.