2022 Developer Survey is open! Take survey.

Questions tagged [code-reuse]

The use of existing code for creating new software.

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Add API for smartphone APP requests (Ionic6) to Flask APP working with browser requests

We have a working multi page python flask web MVC application using bootstrap. We are looking to create app for smartphones and we decided ionic would be the better framework (along angular) since we ...
user avatar
  • 101
1 vote
1 answer
221 views

How to maintain well structured code and latency optimized code together?

I'm working on a c++ data analysis project. My workflow goes like this Analyze the data and build models Optimize the code for latency, to deploy for production goto 1 Step 1 has lots of machine ...
user avatar
2 votes
1 answer
356 views

How to setup our codebase for efficient code sharing and development?

Our situation At first, our company had 1 product. Custom hardware with firmware we wrote ourselves. Now more projects are starting to be added. Many can reuse most of the components of our first ...
user avatar
  • 95
0 votes
1 answer
60 views

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 ...
user avatar
-2 votes
3 answers
200 views

What Design Patterns for encouraging component reuse?

One of the major issues that I am facing as a Website and App developer, is that certain components / features have to be redeveloped over and over again with a new project. For instance login, signup,...
user avatar
1 vote
2 answers
312 views

How to reuse production code - for writing supporting tools?

A little history - skip to the TL;DR if you so wish to. So I have an UWP application written in C++ that utilizes V8 and have synthetic module which allows calling native methods from the embedded JS ...
user avatar
  • 147
2 votes
0 answers
113 views

Minimizing infrastructure code surface for NodeJS microservices and libraries

My company has about 200 repos for microservices and libraries that we share. It's largely been great, but it's hard to keep DRY at the organizational level. We'll often have a large amount of package....
user avatar
1 vote
3 answers
149 views

What does Combinatoric Interface mean?

I am watching this talk by Sean Parent. He notes that: Choosing the same syntax for the same semantics enables code reuse and avoids combinatoric interfaces What does "combinatoric interface" mean?...
user avatar
  • 187
1 vote
0 answers
25 views

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 ...
user avatar
2 votes
1 answer
478 views

Are symbolic links a good way to 'import' a project into another?

I've been thinking on how to import a project B into a project A, which both are GitHub repositories. Project B is a library I reuse over many projects, I do add stuff in it, directly from project X, ...
user avatar
  • 727
2 votes
2 answers
127 views

How could I reuse common JS modules between several projects?

At my company, we are developing pretty simple React Native and sometimes mobile-only React apps. Most of them have some similar logic, such as 'sign-in by phone' flow, some payments stuff, etc., and ...
user avatar
1 vote
3 answers
307 views

Dependency Inversion Principle and Lower-Level Code Reuse

I am wondering about how to make lower-level code reusable when the Dependency Inversion Principle (DIP) is used. In the book Clean Architecture by Robert C. Martin, the DIP is described such that ...
user avatar
2 votes
1 answer
163 views

Should we put small, potentially often-used pieces of code into tool methods in a shared library? [duplicate]

I recently switched jobs to a new company which develops a .NET framework based product which has been on the market for like 15 years already. Some of the engineers are in this project almost from ...
user avatar
  • 129
7 votes
5 answers
477 views

How to keep developers informed about a code library in large organizations?

Although our products often have the same requirements, the solutions are always developed anew. From different people, with different good results and different quality. A code library especially for ...
user avatar
  • 475
11 votes
5 answers
2k views

Too much abstraction making code hard to extend

I'm facing problems with what I feel is too much abstraction in the code base (or at least dealing with it). Most methods in the code base have been abstracted to take in the highest parent A in the ...
user avatar
  • 127
1 vote
3 answers
725 views

Application architecture using CQS and DDD Aggregates

I am working on a microservice architecture using CQS and with domain objects built using DDD aggregates. I am just beginning to learn about CQS, CQRS, Domain Driven Design, so excuse me if what I ...
user avatar
  • 121
0 votes
3 answers
510 views

Code Design: Repeatedly doing the same Boolean check with Stream Writer

I have several areas in a program where I am doing the following check on the same two booleans, but each spot has different text being written to a file via Stream Writer based on the value of the ...
user avatar
  • 11
1 vote
3 answers
842 views

Code design: introduce new method vs add optional parameter to existing method

In JavaScript (ES6), I can have optional function parameter with default value. So to add a new behavior to the existing code base, I could either introduce new method(s) or extend the existing method ...
user avatar
  • 55
0 votes
2 answers
116 views

Tool or strategy to remember code structure and where I left [duplicate]

I am working on multiple projects as a developer and second line support, It happens that I fix a bug on one project, test and deploy the change then leave the project for months and return back for ...
user avatar
0 votes
1 answer
138 views

Re-usability in C++ using Interfaces and External Configuration

I am practicing professional C++ by building a differential drive robot that applies a Go-To-Goal Behavior. What is I have written so far is an Agent that consumes the following interfaces: ...
user avatar
0 votes
2 answers
232 views

Reuse domain entity logic

Usually the domain logic should be contained in the domain entity, rather than being put in specialised external classes called from the entity. This is good to prevent that somebody comes later, ...
user avatar
2 votes
2 answers
436 views

How to avoid code duplication in two similar projects?

We have a website with a lot of functionality, and we now start another one, which should have a lot of common code with the first one. What would be the best approach to avoid code duplication? ...
user avatar
  • 123
0 votes
1 answer
1k views

How to remove code duplication in Web API versioning

I'm working with ASP.NET core web API project, where I have 8 controllers, multiple DTOs being used for request and response and mappers to map models(also used in the web app) with DTOs. Recently, ...
user avatar
  • 157
-2 votes
2 answers
251 views

How can a company know that I re-used some techniques? [closed]

I'm a software engineer in a company. However, I'm planning to start a self project very soon. I wonder if I am allowed to re-use the code I have written in my company product in my project. It is ...
user avatar
  • 123
0 votes
3 answers
394 views

Does providing multiple APIs reduce code re-use

Within an organization, suppose you have an internal tool used by different teams and for different use cases. This package offers APIs in different languages. One could say that having multiple APIs ...
user avatar
  • 289
0 votes
1 answer
26 views

Share some small bits of functionalities across packages

Suppose that: you invent a new coordinates system and you create a class to represent it you have two products which need to deal with this coordinates system but which, apart from that, are ...
user avatar
  • 289
7 votes
2 answers
439 views

Implementing new project to communicate with old ones. The correct way

I'm not sure if this is the right place to post this (I'm fairly new, but Stackoverflow and Superuser suggested this site for my question), but here goes. I currently have the following: A frontend -...
user avatar
0 votes
1 answer
125 views

Using the objects retrieved at the time of request validation

I hope the question title already answers the subject here. Lets say I have a number of ids that needs to be validated in a request. Example: request uri: [POST] /album/{album_id}/song Request ...
user avatar
-1 votes
1 answer
116 views

Removing a framework support from a big project

I need to remove a framework(vertx, to be specific) from a project(lib) which is the base for other projects as well. What would be the best approach to remove all dependencies on the framework from ...
user avatar
81 votes
9 answers
18k views

How do huge open source libraries get maintained while having code far from "clean code" practices?

I'm still inexperienced to write high quality code, so I read books addressing the issue such as Clean Code by Robert C. Martin, and keep checking code of well-known libraries to improve my skills. ...
user avatar
2 votes
1 answer
456 views

Is 'Keep it looks similar to sample code' a valid reason to prefer WET over DRY principle?

For example, for oauth, I may need to copy and paste oauth and oauth callback code like it (assume Client is the framework I use, I don't use real framework like google because I want to simplify the ...
user avatar
  • 5,572
1 vote
2 answers
282 views

Reusable component with web service

I am trying to create a reusable component / Cocoa Touch Framework in Swift that would display the current weather based on the user’s location. Right now I cannot decide which approach should I take....
user avatar
  • 121
5 votes
3 answers
416 views

Best practices on sharing code between open source libraries

I have an Android library used by a decent amount of people, let's call it library A. I am building a second library, library B. The two libraries are conceptually related, they solve different ...
user avatar
1 vote
0 answers
48 views

Manage several procedures

I have a software project which grows rapidly in an unexpected way, many customers request similar tasks but with slightly different needs and parameters. I start to dislike my current code structure ...
user avatar
  • 153
3 votes
2 answers
586 views

In which programming paradigm can't code reuse be (easily) achieved?

In a video about software architecture that I'm watching, it's stated that the main program/subroutine architectural style promotes modularity and function reuse Code reuse is one of the main ...
user avatar
  • 249
1 vote
1 answer
46 views

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 ...
user avatar
  • 159
0 votes
3 answers
138 views

Separated implementations or one with all functionalities

I am currently creating Excel import modules for some complex data. I didn't plan it well and I have met code reuse issues. I have made first modules and I realized that next modules will need some ...
user avatar
  • 29
12 votes
2 answers
744 views

How to avoid duplication of data structures when parts of an app are written in different languages?

As an example, say you are writing an app in Java. Your app communicates with an API server written in Python. The Python server communicates with an SQL database. You also have a website for your ...
user avatar
2 votes
1 answer
370 views

How can the reusability of Python code be measured and quantified?

For example, let's assume we have a class that is imported three times from other classes. This would lead to a reusability of three. However, as there might be functions that are called only once, it ...
user avatar
  • 170
-1 votes
1 answer
144 views

How to keep reusable plugin up-to-date while programming from inside a project with git

I've asked this question myself for a thousand times now but I can't seem to find the correct answer. I'd like to separate a part of reusable code from the actual project however both the project and ...
user avatar
0 votes
1 answer
88 views

Moving interfaces but not concrete classes

Recently I started working on creating a client library. One problem which I am facing now is that I have to move the below interface Attributes to client library but the concrete classes (business ...
user avatar
  • 111
-3 votes
2 answers
130 views

Implementing functional/reusable code [closed]

Writing code, in my opinion, usually involves 2 kinds of code: logical and functional code. While the logical part of the code always differs between every app and its goals, often the functional ...
user avatar
1 vote
2 answers
470 views

How useful is line-by-line code re-use?

In my workplace, the client is obsessed with line-by-line code reuse. And they use a tool that uses LoC as measure of code re-usability. Often for two modules, if the logic is same as of now, those ...
user avatar
0 votes
1 answer
279 views

How to provide Java libraries internally?

In my small team we write applications that run as a Jenkins job and using the SOAP API of our Bug Tracker, our ALM software. They are accessed with Java however I think developers using other ...
user avatar
2 votes
1 answer
135 views

Organizing code to minimize repetition and external references

I am struggling with how to organize external references in a C# program in order to minimize code repetition. I have application "A1" for which I want to use Microsoft's Unity IoC/Dependency ...
user avatar
  • 1,967
2 votes
3 answers
438 views

Refactoring Atrocious Java Code [duplicate]

So I recently started a new job for a small software company. They've got some old technology which I was aware of during the interview process. However, I've been digging into their code-base, and I'...
user avatar
  • 409
12 votes
8 answers
804 views

Proper design for a class with one method that can vary between customers

I have a class used to process customer payments. All but one of the methods of this class are the same for every customer, except for one that calculates (for example) how much the customer's user ...
user avatar
  • 251
0 votes
2 answers
227 views

What architecture/guidelines should be considered to write reusable module of project?

Introduction I am working on MyProject which is windows (desktop) application being developed in C#.NET and DotNet Framework 4 in WPF. Project is layered as DataAccessLayer (DAL) --> ...
user avatar
9 votes
1 answer
2k views

Reusing a top-level DTO as a child in another DTO

What is the recommendation regarding re-using DTO's as a child in another DTO? I'm using ASP.NET Web API (C#) and consuming the results with Angular 1.x (not sure if that really matters). I have the ...
user avatar
3 votes
3 answers
389 views

Good approaches for sharing reusable components between teammates

Question: Talking about software development, how to provide good approaches to achieve a repository of reusable components inside a project? Context: Working on a team of 10 coworkers may be very ...
user avatar