Skip to content

Instantly share code, notes, and snippets.

@threepointone
Last active July 31, 2022 17:46
Show Gist options
  • Save threepointone/75eadefb56c448c9df4cb41b75fd42c2 to your computer and use it in GitHub Desktop.
Save threepointone/75eadefb56c448c9df4cb41b75fd42c2 to your computer and use it in GitHub Desktop.
list of things that don't do what they say they do

(also know as lies and/or alternative facts)

js

  • setImmediate - doesn't set anything immediately, waits for a tick before executing
  • setTimeout(fn, n) - never sets the timeout to exactly n
  • Math.random() - computers cannot generate random numbers
  • Promise - is a lie when rejected
  • Array.reduce - accumulates, does not reduce (via @sbmadhav)
  • const - isn't constant, can be mutated (via adamwknox)
  • typeof NaN === 'number' 🙄 (via @delapouite)
  • continue - stops execution of current block (via @vdanchenkov)

react

  • setState - doesn't set, but enqueues a state change
  • createElement - creates a description of the actual element
  • instance::render() - doesn't actually render
  • componentWillMount - component might not mount
  • react (!) - doesn't react immediately, schedules changes instead

misc

  • babel - speaks only one language (though understands many)
  • rxjs - rx implies prescription, not subscription
  • javascript - isn't a scripting language for java, or related to java in any way.
  • isomorphic - is a word used to compare two different, but similar structures; not to say that one structure works in multiple places (via @gaearon)
@jorgebucaran
Copy link

this should be made a wiki somewhere so people can add stuff from other languages

Great idea.

@jaredly
Copy link

jaredly commented May 25, 2017

lol lots of people want to fight in these comments. this is a fun list of things that can be pretty suprising

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment