Questions tagged [code-reuse]

The use of existing code for creating new software.

Questions with this tag should be about best practices and strategies for creating code that can used by different pieces of software, as well as using already existing code.

182 questions
45
votes
10 answers

Why shouldn't classes be designed to be "open"?

When reading various Stack Overflow questions and others' code the general consensus of how to design classes is closed. This means that by default in Java and C# everything is private, fields are final, some methods are final, and sometimes classes…
TheLQ
  • 13,580
17
votes
9 answers

How to promote code reuse and documentation?

As a team lead of about 10+ developers, I would want to promote code reuse. We have written a lot of code-- a lot of them are repetitive over the past few years. The problem now is that a lot of these code are just duplicate of some other code or a…
Graviton
  • 4,005
7
votes
5 answers

Logistics of code reuse (OOP)

One of the driving points behind OOP is code reuse. I am curious about the actual logistics of this and how others both in team or solo handle it. For example lets say you have 5 projects you have worked on and between them you have a ton of classes…
Ominus
  • 1,889
  • 1
  • 15
  • 26
7
votes
5 answers

Successful Common Code Libraries

Are there any processes, guidelines or best practices that can be followed for the successful implementation of a common code libraries. Currently we are discussing the implementation of common code libraries within our dev team. In our instance,…
Adam Jenkin
  • 179
  • 3
5
votes
4 answers

Not Invented Here - what does it take to not succumb to it?

I will start with one, which however did not work the way I wanted. Vendor Evaluation: In the beginning of the project, we spent some time to do a survey of existing open-source libraries that can be used as building blocks for a larger library.…
rwong
  • 16,878
5
votes
7 answers

How can I promote software reuse in a large company?

Take a large company, formed through many iterations of mergers and reorganizations. This company produces lots of different products that are all targeted to a specific industry. Most products share similar characteristics, such as communication…
Erik
  • 999
4
votes
3 answers

When not to reuse software?

I'm working on an application that had basic requirements for authentication in the first version (i.e. think single administrator login), and now I have a requirement to extend this to allow for different users, roles, and permissions. It has been…
Shawn D.
  • 1,361
  • 1
  • 12
  • 14
3
votes
2 answers

Sharing functionality between platforms and languages

I'm in a situation where I already have a working, high-performance C++ program with GTK and OpenGL that renders data as a real-time graph. The data is saved as a report in a database which can be looked up at a later date from a browser. I now need…
isanae
  • 135
2
votes
1 answer

External code - copy or use path?

I have a lot of code that is needed for several projects - units, include files, resources and more. These files are writen by myself, downloaded or cloned with git and have their own place in the directory structure. These (source)files have to be…
Kitana
  • 169
1
vote
0 answers

How to interpret the set of simpler algorithms of ObservableHq as an reusable library?

The main source of D3js solutions is observableHq.com, but seems impossible (?) to reuse algorithms by copy/paste... Is it? Even checking tutorials like this, there are no simple way (with less plugins or programmer's time-consumtion!) to check and…
1
vote
0 answers

How to save useful code snippets?

I do a lot of web development and there are many code snippets that come up again and again so I dive back into the most recent project where I used it which isn't that efficient. How do you store all your useful and oft used code pieces? Are there…
clifgray
  • 111
0
votes
1 answer

How to manage versioning in interdependent libraries?

I have a number of libraries that I have developed for various projects, e.g. a web server, some computation tools, some logging tools, etc. These reside in different parts of my drive. When I have a project that uses a few of these, I…