how well you know a prog lang
X
how concise or powerful that prog lang
X
how well you know the editor/toolchain
X
how powerful your machine
X
how much/little interrupted
X
how much/little distracted
X
how many relevant "variables" & constraint factors are fresh in your brain's registers/caches
X
applying lots of little "best practices" in your workflow
X
stimulant abuse (CAFFEINE, PEOPLE! CAFFEINE! sheesh)
anybody else? thoughts? better / more refined versions of this equation/mousetrap?
productive programmer → happy programmer
happy programmer → productive programmer
It's a feedback loop though "happy" and "productive" are all complex equations in their own right. Also there's a soft cap on productivity and happiness.
[1] https://en.wikipedia.org/wiki/Cobb%E2%80%93Douglas_productio...
[2] https://jigjids.files.wordpress.com/2011/02/cobb-dauglas-tan...
To me, it's about FUN.
Without fun, your productivity is of course low.