Treat each job as a college course you're also getting paid for. Keep asking yourself every week: am I still learning? Stay while the answer is usually yes. Start looking when it is no longer so.
Ask HN: Am I Falling into a Trap?
11–11 of 11 posts