Helder Esteves

Type and hit Enter to search

JavaScript
Uncategorized
Software Architecture
React
General
Management
Next.JS
TypeScript
JavaScript
Uncategorized
Software Architecture
React
General
Management
Next.JS
TypeScript
JavaScript

The Ultimate Sith Lord Developer Guide

Helder Esteves
Helder Esteves
April 28, 2023 5 Mins Read
64 Views
1 Comment

“Evil is a word used by the ignorant and the weak. The Dark Side is about survival. It’s about unleashing your inner power. It glorifies the strength of the individual.”

Drew Karpyshyn, Darth Bane: Rule of Two – Star Wars

The path to becoming a Sith Lord is a treacherous one. Many inadvertently fall into this path, but very few reach the summit.

As a true Sith Lord, employers respect you for being the only one who can maintain the project. Code reviewers thank you for the constant challenges. Project managers love you for your speed.

Sometimes junior developers do better on this path than many Sith Lords, but most ultimately fail down the line.

Are you ready to follow this path? Let’s get started.

Note: The examples here are what I have seen developers use in real projects, seriously.

Your new naming arsenal

Single-letter variables

A true Sith Lord developer displays their efficacy by keeping things short. Take this example:

function mul(a,b) {
  let p = 0;
  for(let i = 0; i < b; i++) {
    p += a;
  }
  return p;
}

Yes, this is a simple multiplying function, and you may even argue why there is a need for it. But this is exactly why you have much to learn.

A prodigy at this point will look at the code and quickly find that more enhancements can be made. For example, why use the conventional loop counter name i? We can test the code reviewer’s attention more effectively by using i and j as parameter names and a as the loop counter. If you have reached this conclusion, you’re on the right path.

Abstract names

Your arsenal is not limited to single-letter variables. Unpredictability and inconsistency are inherent traits of a Sith Lord’s code.

  • Use the most general word to describe what you’re dealing with. The best one for variables is val. For functions, func. Other good ones are data and item. Who knows what they mean? Well, it’s now the others’ job to know that.
  • But wait, what if you’re running out of these awesome names? Fear not, apprentice. Add another arbitrary symbol to the name. val2, _val or even __val__. Bonus points if you use them together like so:
const val2 = ...;
const _val = ...;
const __val = ...;

Subtle changes

Show off your extensive vocabulary by making subtle, but arbitrary changes throughout your code.

For example, handling a submission? Use onSubmit in some instances, then onSend in others. Mix and match with also handleSubmit and handleSend. Someone reading your code might be confused by these subtle changes, thinking that there is an ulterior motive, but little do they know you just want to show your vocabulary prowess.

Another example could be using the amazing abstract names outlined above. Use displayFunc for a certain function, and then displayFun for doing a prank.

Hardcoding

The next step in becoming a Sith Lord Developer is to master the art of hardcoding. This is especially effective if another peasant developer has already written a nice little config file with all the constants.

Here’s an example of how to use secrets as a Sith Lord Developer:

fetch(`https://api.example.com?apikey=1234567890`);

Were you expecting something like this? If so, I’m proud of you.

Here’s an example of when you have a config file in that project:

// Somewhere in the root of the directory, a file called config.js
const config = {
  apiKey: process.env.API_KEY,
  apiUrl: "https://api.example.com"
};

// ... inside of the source
fetch(`https://api.example.com?apikey=1234`);

Just a little show of power like this from a Sith Lord developer renders all the work from the other poor developer useless. And it’s all their fault. This is because the config file cannot be trusted as the single source of truth anymore.

Your updated function guide

Side effects

As a true colleague and Sith Lord Developer, you want to make sure your fellow teammates are paying attention.

One way to achieve this is to use functions with side effects. For example, let’s take a function logResult.

function logResult(a, b) {
  let result = a + b;
  console.log(result);
  // Don't forget to send an email to your boss
  email.send("result: " + result);
}

This is extra effective as your boss will be nagging your team (and with good reason) while you can laugh like a true Sith Lord in the background.

Return types

Who needs clear return types when you can return anything you want? This will ensure that your fellow developers never know what to expect and that they’re constantly surprised by the results. For example:

function multiply(a, b) {
  if (typeof a === "number" && typeof b === "number") {
    return a * b;
  } else {
    return "I'm feeling lucky";
  }
}

A developer who comes across your code knows they’re in for a rollercoaster ride. They know they are dealing with a Sith Lord’s code.

Unnecessary complexities

Function generators

You have all this coding knowledge, and here you are changing colors and fixing styling bugs for IE9. As a Sith Lord developer, this is a no-go. Show that you are superior to others, and with that, promotions will come… Maybe.

Function generators are a great way to achieve just that. They allow you to create functions that can be paused and resumed, which is rarely needed in most applications. But not in yours. For example:

function* generateId() {
  let number = 0;
  while (true) {
    yield number;
    number++;
  }
}

const numbers = generateId();

console.log(numbers.next().value); // 0
console.log(numbers.next().value); // 1
console.log(numbers.next().value); // 2

This code generates an infinite sequence of numbers every time you call it, which is sure to impress your peers.

Immediately Invoked Functions

Another way to express your aptitude is to use immediately invoked functions whenever you can. For example:

(() => {
  console.log("Hello, world!");
})();

(() => {
  console.log("Goodbye, nerds!");
})();

And if someone asks, here’s what you do:

Your fellow developers: “So… why are you wrapping this in an IIFE?”
You: 😂 (walks away)

Laughing is the only option here, as they clearly don’t get the big picture.

TypeScript

Finally, let’s talk about TypeScript. If you’ve been paying attention at all, you know that TypeScript is for people with no life, who instead of writing code, spend their time writing about their code. But fear not, you are here to show them how it’s done.

Using any Type

This is a given. Make sure you use the any type wherever you can. This will get you to where you thrive best: chaos.

function add(x: any, y: any): any {
  return x + y;
}

const result = add("2", 3);
console.log(result); // "23"

Perfect.

Bringing it up at the next meeting

Why use TypeScript at all? In the next meeting, suggest migrating from TypeScript to JavaScript. Sure, you might get fired, but just imagine your project without TypeScript. The possibilities are endless. In all honesty, I believe this is the best course of action.

Conclusion

In the end, you realize you stand at the peak of the dark side, and no one else will be able to read your code or maintain it. With this, you have become a certified Sith Lord Developer and you will be able to maintain your job for as long as you want in a project, as only you will know how to work on it.


By the way, this is the first post of this type that I’ve written, and I had a blast writing it. Let me know if you enjoy this type of content!

P.S.: This post was naturally a satirical article and should be read purely for entertainment purposes.

Tags:

BeginnerFunny

Share Article

Other Articles

person using black and red Acer laptop computer on table
Previous

8 Advanced Techniques for Effective Code Review

four handheld tools on board
Next

Tools to Speed Up React Component Creation

Next
four handheld tools on board
May 5, 2023

Tools to Speed Up React Component Creation

Previews
April 26, 2023

8 Advanced Techniques for Effective Code Review

person using black and red Acer laptop computer on table

One Comment

  1. पुष्कराज says:
    May 15, 2023 at 7:09 pm

    Awesome. And too many times seen in real world.. hell, it looks like my team member is a sith lord. Blinded by dedlines i have been. For recognise i could not..

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe
Stay Updated!
Get notified when awesome content is posted. Learn more everyday.
Most Read
Software Architecture
5 JS Design Patterns Every Developer Should Know
March 10, 2023
5 Min Read
yellow line on gray asphalt road
Next.JS
5 Next.JS Tips You Never Heard About
March 27, 2023
4 Min Read
blue UTP cord
Uncategorized
Setting up a TURN server with Node: Production-ready
May 19, 2023
5 Min Read
Most Engagement
JavaScript
Simple Backgrounds For Websites — Cheat Sheet

This cheat sheet will help you the next time you're choosing a background for your website....

February 21, 2023
3 Min Read
Most Recent
grayscale photo of person holding glass
JavaScript
Top 10 JavaScript Coding Challenges You Must Absolutely Know
May 17, 2023
9 Min Read
a person pointing at a rock with writing on it
JavaScript
7 Best Coding Challenge Websites for 2023: Improve Your Skills and Boost Your Career
May 20, 2023
5 Min Read
blue UTP cord
Uncategorized
Setting up a TURN server with Node: Production-ready
May 19, 2023
5 Min Read

Related Posts

JavaScript
Fetching in JavaScript: The Definitive Guide
February 15, 2023
5 Min Read
Read More
This is the sign you've been looking for neon signage
General
Mastering the Art of Software Development: Best Practices Cheat Sheet
May 11, 2023
4 Min Read
Read More
red Wrong Way signage on road
TypeScript
Top 7 TypeScript Mistakes You Need to Avoid
April 26, 2023
5 Min Read
Read More
person using black and red Acer laptop computer on table
Management
8 Advanced Techniques for Effective Code Review
April 26, 2023
4 Min Read
Read More

Helder Esteves

Read everything there is to know about the JavaScript development ecosystem, from programming to project management.

Recent

7 Best Coding Challenge Websites for 2023: Improve Your Skills and Boost Your Career
May 20, 2023
Setting up a TURN server with Node: Production-ready
May 19, 2023

Categories

JavaScript9
Uncategorized4
Software Architecture2
React2

Contact

Reach out to us through helder.writer@gmail.com

© 2022, All Rights Reserved.

Go to mobile version