5 ms·
Beyond actually coding stuff, the day job, the primary focus of senior developers should be to educate and guide junior developers. As a general rule the thing
by onion2k 9y ago
Beyond actually coding stuff, the day job, the primary focus of senior developers should be to educate and guide junior developers.
As a general rule the thing that gets a developer to start writing better code is when they eventually come around to the idea that writing tests and documentation is actually worthwhile. Then they start write code that they can write tests and documentation for, and then, as if by magic, their code improves.
As a senior the only thing you need to do is show them your tests and documentation, demonstrate why it makes life easier, and make sure they have time to do the 'additional' work of writing tests and documentation (juniors think it adds time rather than saving time; they think in the short term).
If you're feeling a little mean then you can decline their pull requests because the code doesn't have good enough test coverage. :)
- taeric 9y agoThere is a lot hidden in the "idea that writing tests and documentation is actually worthwhile." Few (any?) will argue against that. The problem is there are actually three skills embedded there. I am coming to view it in three parts: Testing code typically benefits most from being able to think about how the code is not supposed to act. Writing code is typically describing what you want. Documenting code is talking about how all of the code is supposed to work together. I think most examples online that try and get folks better at any one of these, pick an example that is worthless for the other two skills. In particular, writing solid tests for a function or unit does little to help document how it will work with all of the other parts. Writing good documentation for a unit is trivial, so not often applicable to a person's day job. And then seeing the documentation for a full piece is often too much to include the code and tests. (I'm talking specifically about "blog" level articles.)
- sandGorgon 9y ago+1 on this. First day for interns and junior devs is to write testcases and setup a proper debugger. Fresh graduates do not come with an understanding of testcases - usually they have heard about "The Social Network", Steve Jobs or Linux Torvalds. Everyone wants to rewrite the codebase . Its when you lock them in a room with testcases and a debugger that understanding dawns.