Newbie Devs, Please Stop Doing This
For the past few months, I have been teaching quite a few of my friends how to program and develop the web. Here are some mistakes they have made that REALLY annoy me.
1. Skipping Through Courses
So once, I sent my friend a link to a free course tha...
blog.orangemn6.xyz4 min read
Great suggestions. Very important things for beginners to do :).
The only thing I disagree with are the comments in code.
Comments have the problem that they're easy to become outdated, because programmers may not update comments when they update code. They are also redundant if you use good names.
For example:
// Here is a function, with bad names, that needs comments /* this function sends data a: url slug b: data to send c: optional configuration object */ function foo(a, b, c = {}) { const d = `example.com${a}`; // create absolute URL const e = Object.assign(c, {data}); // create new configuration object with data fetch(d, e); // send data } // Here is a good function. It doesn't need comments because the names are very descriptive function sendData(urlSlug, data, requestConfiguration = {}) { const absoluteURL = `example.com${urlSlug}`; const configurationObject = Object.assign(requestConfiguration, {body: data}); fetch(absoluteURL, configurationObject); }What's your opinion on this? Keep up the good work! :)