I have experience working with peers and working alone.
Normally I write better code when I am alone, or when my peers are exceptionally talented.
People believe they can change the environment, they can't. If you start working with people that are not motivated, you become unmotivated.
If you start working with messy programmers that create imperfect code with lots of bugs you will become the slave that spends 95% of their time fixing other people's bugs instead of creating new code, or you will just choose over time to program equally messy code.
Steve Jobs had this rule, based on experience making software: "everything new you create, you do with an extremely small team of star programmers". E.g the initial iOS team was over 20 people.