The complexity of Code Sharing in an enterprise organization

Photo by Scott Graham on Unsplash

“All dev teams should start sharing code!”

I’ve heard this phrase several times, and I always wonder “Why?”. It’s the same kind of narrative when we require developers to use a single pipeline tool: We’re just forcing a concept on people, not considering the individual journey of each team. Furthermore, the “Why” is often skipped and instead the focus is on the implementation.
For instance: “Every team must check-in to a monolithic repository. I’m not saying a mono-repo is a bad thing, but it feels like the hidden motive is control, which could potentially be driven by fear.

Code sharing is important and valuable because:

  • We don’t have to reinvent the wheel
  • We can learn from each other through knowledge sharing
  • We can improve shared code

I think code sharing is more of a behavioral thing which can be cultivated within a team. As the codebase and development skillset of a team matures, the need for code sharing will emerge organically.

I recognize a number of levels within this maturation process that are explained below.

Level 1: Opinionated code for team use only

Most of the time the code is opinionated and often not considered as a pattern and/or reusable building block.

Also, the code repository is not publicly accessible, and the rest of the organization does not know a particular service or product is available from this team.

Level 2: Opinionated code, publicly available

The codebase is opinionated. In the interest of sharing, the code repository is read-only for other teams. The team also promotes its code in conversations with other teams, which is a good thing.

The problem is that the code cannot easily be used in another context.
Also, apart from ad hoc communication with other teams, how can the wider organization become aware of this team’s codebase and the services it provides?

Level 3: Opinionated code, example code available

The codebase is opinionated. However, the team sees value in reusability and codesharing, and provides example code which is un-opinionated and can be reused by other teams, provided they are aware of this team’s codebase.

A side effect is that the example code has no ‘warranty’ whatsoever, and the example code becomes outdated and unusable. This is the moment the team could realize that it might be valuable to start maintaining a shared building block.

Level 4: Eat your own dog food

There is a lot of value in creating, maintaining, and reusing un-opinionated building blocks. Especially other teams can be assured of the quality because the providing team is practicing the “eat your own dog food” principle.

This takes effort and discipline but will pay off. Unfortunately, the wider organization still doesn’t know about this team’s reusable building blocks.

Level 5: Share reusable building blocks with the whole organization

In my opinion, the best way to achieve reusable building blocks (that other teams want to consume) is by sharing and promoting the code actively in the organization.

This can be achieved with:

  • Portfolio management. Implement portfolio management that is always up to date with the services, products, and building blocks of each team. An IT4IT tool like ServiceNow can be used for this.
  • A Community of Practice. Recognize innovators that want to share and learn, and begin a pragmatic Community of Practice where active communication is stimulated.
  • A Center of Excellence. Patterns might emerge from the work floor and within the Community of Practice. This should be recognized by a CoE that is able to adopt, vet, and promote these valuable patterns.

So how to get there?

The most important thing is that every team has its journey. Maturation and emergence of building blocks will happen, as long as we enable and stimulate instead of forcing people into a straight jacket.

Lastly, if ownership of code and cooperation between Architecture, Engineering, and Compliance is stimulated, we become more in control.




DevOps coach, AWS Cloud consultant. People > Processes > Technology.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Streaming analytics with Kafka and ksqlDB

The Future of IT Architecture Modeling

EMQ X Rule Engine Series — Writing Messages to TDEngine

NYC Planning Labs: Why Choose Ember.js?

How to Print Alphabet T in Python?

Agile World S1 E17 with Giles Lindsay as a guest talking about his huge event, The Agile…

Top 5 Books for learning Python

What’s AWS S3 Anyway?

Little man made of Amazon boxes

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Marck Oemar

Marck Oemar

DevOps coach, AWS Cloud consultant. People > Processes > Technology.

More from Medium

The Ready-to-Code Checklist

What is a Honeypot?

How to use GitVersion to get sensible versioning

Avoid headache from creating diagrams — use PlantUML