it's bad code if you're writing it again. Everything you mentioned is something already handled for the developer through the browser/API's. It's like writing your own multithreading instead of using something provided by the OS. 99% of the time it's stupid