2

Background:

I am working as a junior java developer. My long term carreer goal is becoming a software architect.

That said, I have a big demand on myself to deliver a high quality code.

So here is the story behind my question:

I am responsible for a big refactoring in a core part of our buildsystem. I gathered the known requirements, put them together with what was already coded, and made some code-design decisions. I made those without the help of our senior software architect, as he wanted me to be fully responsible for the job. Since I am working for some weeks on this by now, I can clearly say, that I would do it all the same again, which is a positive sign (, isn't it?)

After the refactoring however, they rushed in with a lot of new functionalities, thinking I would need some time to add these. After 3 days I finished my work and they were really surprised and couldn't even give me new work on the first hand.

I started to optimize the code in regards of maintainability, documented the Architecture, etc.

The Problem:

The senior architect reviewed my code and did not get the reason for the choice of architecture, thought it was documented and I could explain all the patterns I used, and why I used it. He told me, my code was 'too textbook fashioned' with all 'the design patterns'. He continued something like 'you dont need to split the functionalities into classes, I would rather want to see bigger classes with a lot of functionalities, so I dont need to search too many files'

Now the thing is, that he wrote the prior version of the tool I re-wrote. It was split up into 6 files, each having around 2000 lines of code with no documentation and comments at all. In the refactored version (before adding all the new functionalities, that your were not able to add to the old one), there were around 20 files having ~200-250 lines of code (including docs and comments).

While I am now able to add a new functionality within 3-8 hours (tested) and can within a short time determine where an error occurred (normally bugs are fixed within 1-4 hours), he tells me, that I am too concerned about the Architecture. Note here, that there are ~150 files in the meantime.

Looking at the code of the development manager, the senior and the junior architects, I am feeling somewhat offended. You cannot change any implementation without breaking the whole system (which is possible for my part).

The Question:

I feel very uncomfortable writing code that does not comply with my personal quality demands, but I am sure, that I will never be able to fulfill these demands, if I start writing code the 'way the others want me to', so I am 'quicker' (which is not true, otherwise there would have been no reason to refactor all the code).

I cannot find any design patterns within our whole codebasis, and our architects admit that they know nothing about them. Both facts make me cringe, as we lack the very basics, like Statepattern or Factories.

So how can I satisfy my own quality demands in this situation? How can I influence the way our seniors work? As I will need to work with and enhance the code the others wrote, how will I be able to make it high quality (in my way)?

EDIT:

Some of my not 'senior' coworkers already applied changes to the code I wrote and were surprised by the ease of doing so.

My focus was on giving a framework-like architecture, where enhancements can be applied easily by everyone :

To add another functionality, you only have to implement ONE SINGLE INTERFACE containing only a single function.

The big thing around does not need to be understood without documentation, as long as it works.

IMHO I think, that the easier such a tool is useable, the more complex the background usually is.

5

1 Answer 1

5

The best code is the code everybody understands easily.

As I will need to work with and enhance the code the others wrote, how will I be able to make it high quality (in my way)?

The "in my way" means a lot here. You're probably, or at least you claim to be, an excellent lone wolf. However, it seems you're not a team player. Your code needs to be easily reviewed and modified by another person, which is why your senior had trouble with your architecture.

If you want people to work exactly the way you want them to work, be the boss. Until you can become the boss, abide by the standards prefered by your team.

Try to see this from your Senior's point of view. He has to :

  • Read your code

  • Refer to the guidelines several times

  • Read the code again

  • Make his modifications in a way he's not used to

This is a lot of his senior time. You won't like it - but one of your objectives is also to save senior time, even if it costs more junior time.

Since I am working for some weeks on this by now, I can clearly say, that I would do it all the same again, which is a positive sign (, isn't it?)

You might be tunnel visionning though, maybe you're heading in a very wrong direction, but you're dead certain you're going the right way. Since you seem like a lone wolf, you might want to get someone's advice to be sure you're doing things as you should.

3
  • Thanks for your answer. I will keep this in mind, but have a look at my edit Commented Apr 6, 2017 at 9:11
  • 2
    While your advice is true for many situations (and it might even be here, we would have to see the specific code to know for sure), same heaviour of the senior the OP describes are a red flag to me. Insisting on having big files to search not "so many files" seems unreasonable by any standard. And let's not forget that seniors make mistakes as well or are unqualified. Just because it is "easier" for the senior to read one file, it still doesn't make it a reasonable requirement.
    – dirkk
    Commented Apr 6, 2017 at 10:12
  • 1
    I agree with @dirkk. to me it sounds like the architect may feel threatened by the OP. I don't think there is sufficient evidence to label the OP as not a team player.
    – user45590
    Commented Apr 6, 2017 at 10:18

Not the answer you're looking for? Browse other questions tagged .