15 Terrible Advice for Web Developers
<p>Medium is full of useful articles and great advice to create robust and maintainable applications. But what If you don't like your colleagues and want to ruin their day? Then worry no more. I’m great at giving bad advice and came up with 15 tips to cause frustration and waste everyone's time.</p>
<h1>1. Abstraction Layers</h1>
<p>Use as many abstraction layers as possible until:</p>
<ul>
<li>The code is difficult to understand and debug.</li>
<li>It is difficult to make changes to the code.</li>
<li>The code is slow or inefficient.</li>
<li>The code is not reusable.</li>
</ul>
<h1>2. Always Request Changes on Pull Requests</h1>
<p>You should always block a pull request during the first review to assert dominance.</p>
<p>Some ideas for change requests are:</p>
<ul>
<li>Make a variable name longer</li>
<li>Make a variable name shorter</li>
<li>Rename a variable name</li>
<li>Make code more <em>DRY</em></li>
</ul>
<h1>3. No Commit Messages</h1>
<p><a href="https://cbea.ms/git-commit/" rel="noopener ugc nofollow" target="_blank">Good commit messages</a> take time to write. Instead of spending your valuable time writing something like</p>
<p><code>[JIRA-1234] build: replace vue-cli with vite</code></p>
<p>you can use the following command to push your code with an empty commit message</p>
<p><code>git commit --allow-empty-message -m "" && git push --force</code></p>
<h1>4. Use Magic Numbers</h1>
<p>Use magic numbers often to indicate that you know <strong><em>exactly</em></strong> what you are doing</p>
<pre>
window.scrollTo({
top: 89,
left: 12,
behavior: "smooth",
});</pre>
<h1>5. Mix Return Statements</h1>
<p>Never let them know your next move by mixing the return statements of a function</p>
<pre>
function shouldPayTax(income) {
if(income.amount < 20_000) {
return false
}
if(income.amount > 20_000 && income.country == 'USA') {
return true
}
if(income.country == 'Panama') {
return false
}
if(this.totalWorkingHoursPerWeek > 60) {
return true
}
if(income.amount > 20_000 && income.isCelebrity == true) {
return false
}
if(income.amount > 20_000) {
return true
}
}</pre>
<h1>6. Typescript</h1>
<p>If someone had the audacity to add <a href="https://medium.com/javarevisited/7-best-courses-to-learn-typescript-in-depth-58439e1ce729" rel="noopener">TypeScript</a> to the project, you can bypass type checking by using <code>any</code> everywhere.</p>
<p><a href="https://fadamakis.com/15-terrible-advice-for-web-developers-e821e95f5d18">Visit Now</a></p>