I work as an iOS developer in a small outsourcing company in a team of 4 people. We work on a project that started a couple of years before I and two other developers joined the company. Before that the project was mostly being done by one person.When I started working on the project it was a complete mess. There was a lot of code repetition. I saw the same 500 of code  coped to 20 different files with minor variations. Additionally, it wasn't exactly well organized: all UI creation code was mixed in the view controllers together with the logic.I tried my best to refactor things here and there, eliminate redundant pieces of code, improve project's file structure and so on. It felt like the previous developer didn't really care about all these things or didn't have the experience. There was a time when I worked alone on a pretty big feature for a couple of months. Due to the nature of this feature I had to touch a lot of code across the whole app, so I did attempt to make some improvements.When other developers joined the project, I noticed that they use a different coding style (sometimes a completely different style) and often don't use modern language features like property accessors (this is relatively new in Objective-C). Sometimes they would invent their own bicycles instead of using similar features of the framework, or transfer concepts from other programming languages or patters they learned into our code base. Oftentimes they can't name methods or variables properly because of bad English (Objective-C is a language where you make long names).Sometimes I think if it wasn't for the IDE I think they would write all code with no indentation or formatting at all.Basically, I hate the code they write. It's badly formatted/organized, and sometimes is radically different from the rest of the project. I feel very upset when they add their spaghetti to my piece of art and it affects my mood at work and my productivity.It feels more and more like they can't be bothered to learn or don't care: they just do what's required from them and go home. I tried to give them a few tips when I had an opportunity (e.g. commented their PR or commits on GitHub). I once asked nicely to follow the coding style and formatting of the majority of existing code (sadly we don't have a formal coding style document). But it didn't work...How can I address this situation without just focusing on 'bad company culture', 'inexperienced graduates', etc. and actually start to improve the situation.
How can I promote and encourage high quality code?
coding style;teamwork