Skip to content

Sugar is expensive #20

@davidmarkclements

Description

@davidmarkclements

you seem to be trying to "fix" the language, at the cost of unnecessary overhead in both compute time and your time.

function fact (input) {
  switch (input) {
    case 0: return 1
    default: return (n) => n * fact(n-1)
  }
}
function protocols ({useGit, useSSH, useHTTP, useHTTPS}) {
  switch (true) {
    case useGit && useSSH: return 'git+ssh'
    case useGit && useHTTP: return 'git+http'
    case useGit && useHTTPS: return 'git+https'
    default: return 'unsupported'
  }
}
['hey.com', 'fg@plop.com', 'fg+plop@plop.com', 'wat'].filter((email) => !/\S+@\S+\.\S+/.test(email))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions