DEV Community

Discussion on: Building a Simple URL Shortener With Just HTML and Javascript

Collapse
 
jhotterbeekx profile image
John Hotterbeekx

Thanks for sharing! I've never heard of jsonstore.io, seems like a great product to use for quick prototyping.

If I could give you some pointers on your code, try and be consistent in the naming conventions you are using on methods and variables. Right now it seems like you sometimes use snake casing, like protocol_ok and send_request, while most of the time you don't case at all, like genhash or getrandom. Imagine them all being like

let protocolOk;
sendRequest()
genHash();
getRandom();

or if you prefer snake casing:

let protocol_ok;
send_request()
gen_hash();
get_random();

This reads a lot easier right. Try and remember writing the code so it's easy to read for others, and you'll see your code becoming cleaner and cleaner.

Collapse
 
bauripalash profile image
Palash Bauri πŸ‘»

Thank You, I'll keep these in mind