Skip to content

Instantly share code, notes, and snippets.

@aminmarashi
Last active January 15, 2023 11:06
Show Gist options
  • Save aminmarashi/a274ee7649a7457f3c31427e3b50ca35 to your computer and use it in GitHub Desktop.
Save aminmarashi/a274ee7649a7457f3c31427e3b50ca35 to your computer and use it in GitHub Desktop.
Calculate how much money are you spending annually on semicolons
/**
* what's the average typing speed characters per minute? 200
* Assuming the average code length is about 80 characters
* That means developers will type `;` three times in a minute
* Let's calculate the time spent on typing semicolons per minute
*/
const timeSpentSemiPerMin = 3 / 200
/**
* Software developers get paid on average USD 120K in the US
* Assuming companies almost pay twice that amount in the lifetime of their developers
* For office and other costs, a developer costs around USD 240K for a company per year
* Let's now calculate the cost of developers for the company per minute (or 12 months of 160 hour work)
*/
const costOfDeveloperPerMinute = ((240_000 / 12) / 160) / 60
showCost(`Cost of developer per minute (in USD)`, costOfDeveloperPerMinute)
/**
* Now we calculate the cost of typing semicolons per minute
*/
const costOfSemiPerMin = timeSpentSemiPerMin * costOfDeveloperPerMinute
showCost(`Cost typing semicolons per minute (in USD)`, costOfSemiPerMin)
/**
* Assuming that average developers spend 2 hours per day coding 🐈
* Let's see how much that is in a day
*/
const costOfSemiPerDay = costOfSemiPerMin * 60 * 2
showCost(`Cost typing semicolons per day (in USD)`, costOfSemiPerDay)
/**
* How much is that in a year, assuming 20 days work-month, 12 months of work
*/
const costOfSemiPerYear = costOfSemiPerDay * 20 * 12
showCost(`Cost of typing semicolons per year (in USD)`, costOfSemiPerYear)
/**
* Microsoft has over 100000 developers according to its own blog
* How much money does it save Microsoft to ban Semicolons?
*/
const costOfSemiForMicrosoftPerYear = costOfSemiPerYear * 100_000
showCost(`How much money does Microsoft spend on typing semicolons annually (in USD)`, costOfSemiForMicrosoftPerYear)
/**
* Adobe is much smaller than Microsoft, with 25K employees in total
* Let's assume half of those employees are software engineers
* How much money does it save Adobe to ban Semicolons?
*/
const costOfSemiForAdobePerYear = costOfSemiPerYear * 12_500
showCost(`How much money does Adobe spend on typing semicolons annually (in USD)`, costOfSemiForAdobePerYear)
/**
* Now let's assume that you're working for a company that has 1111 software engineers
* Bring this number to your CEO to save him USD 1M per year (and get some 💰)
*/
const costOfSemiForYouPerYear = costOfSemiPerYear * 1111
showCost(`How much money does your company with 1111 employees spend on typing semicolons annually (in USD)`, costOfSemiForYouPerYear)
/**
* Homework: calculate how much does it cost for Amazon engineers to type semicolons per year
*/
/**
* References:
* https://companiesmarketcap.com/tech/largest-tech-companies-by-number-of-employees/
* https://www.typingpal.com/en/blog/good-typing-speed
* https://www.software.com/reports/code-time-report#:~:text=Our%20data%20reveals%20that%20only,two%20hours%20per%20day%20coding.
*/
function showCost(text: string, cost: number) {
console.log(text + ': ' + new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(cost))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment