The use of existing software, or software knowledge, to build new software
Questions tagged [code-reuse]
875 questions
18
votes
1 answer
ImportError: No Module Named
I am trying to learn programming through Python, so I apologize in advance if this is an absurdly simple question.
I am attempting to simplify my convoluted directory structure and utilize some of Python's code-reuse features, I have encountered…

Bee Smears
- 803
- 3
- 12
- 22
18
votes
2 answers
How do you actually use a reusable django app in a project?
This question has been troubling me for some days now and I've tried asking in many places for advice, but it seems that nobody can answer it clearly or even provide a reference to an answer.
I've also tried searching for tutorials, but I just…

Joe
- 3,120
- 3
- 25
- 30
18
votes
5 answers
Does a library to prevent duplicate form submissions exist for django?
I am trying to find a way to prevent users from double-submitting my forms. I have javascript that disables the submit button, but there is still an occasional user who finds a way to double-submit.
I have a vision of a re-usable library that I…

Gattster
- 4,613
- 5
- 27
- 39
17
votes
1 answer
How to organize Redux state for reusable components?
TL;DR: In case of a reusable component which has some complicated logic for managing its own state (think: a facebook comment textarea with autocompleter, emoji etc) how does one use store, actions and reducers to manage the state of multiple…

qbolec
- 5,374
- 2
- 35
- 44
17
votes
18 answers
Code Reusability: Is it worth it?
We all write reusable classes and code.
We factor in configurability to allow us to reuse this fantastic new class again and again.
We tell our bosses that spending this extra time now will save us time and money later.
But in reality, for…

Xetius
- 44,755
- 24
- 88
- 123
16
votes
2 answers
Can I share code between different parts of Chrome Extension?
Let's say, I have a function:
var rand = function(n) {
return Math.floor(Math.random() * n);
}
Can I use this function in both Content Script and Background Script without copypaste?
Thank you.

Oleg
- 22,300
- 9
- 68
- 84
15
votes
4 answers
Specflow and reusing steps from another feature
I am trying to learn specflow and right now.
Currently I have 2 feature files.
In the second feature file, I am reusing a step from the first feature file.
Specflow automatically recognizes the step from the first feature file and when specflow…

user2846391
- 153
- 1
- 1
- 5
15
votes
7 answers
What techniques do you use to maximise code reuse?
Some years ago I was told about a study into code reuse. Apparently it was found that, on average, programmers have a 7 minute window when searching for code to reuse. If they don't find code that suits their needs within that window they'll write…

Andrew Edgecombe
- 39,594
- 3
- 35
- 61
14
votes
1 answer
React Functional Component Inheritance
i created a React functional component that is a wrapper around the react-data-grid component. now i need a second component that is exactly the same except for one function (the rowGetter if you are familiar with react-data-grid.)
i work on an…

user2052618
- 556
- 2
- 7
- 20
13
votes
2 answers
SaaS app with angularjs and nodejs, how do i organize different clients?
I’m trying to decide what to do I this scenario:
I want to create a product that I want to sell in a SaaS business model, I already have the backend more or less thought out and some code in place in nodejs. It handles oAuth, sessions, and controls…

Toddy
- 333
- 1
- 15
13
votes
4 answers
Decouple a JPA entities jar from persistence.xml in SE environment
Is there a way to reuse a jar with JPA annotated entities in more than one SE applications (as a dependency)? in persistence.xml is not supported in SE environments so is there another way?

yannisf
- 6,016
- 9
- 39
- 61
13
votes
14 answers
How do programmers practice code reuse
I've been a bad programmer because I am doing a copy and paste. An example is that everytime i connect to a database and retrieve a recordset, I will copy the previous code and edit, copy the code that sets the datagridview and edit. I am aware of…

user26087
- 809
- 2
- 13
- 21
13
votes
2 answers
Reusing test implementations in JUnit 4?
I have an interface, e.g.:
public interface Thing {
FrobResult frob(FrobInput);
}
And several implementations of that interface (e.g. NormalThing, ImmutableThing, AsyncThing) that I am trying to test.
Many of my test methods are really about…

Daniel Pryden
- 59,486
- 16
- 97
- 135
12
votes
2 answers
Black Duck / Ohloh similar tool
I am doing a source that can manage FOSS one of them is by Black Duck Software which is also known for ohloh.net.
I am wondering if anyone knows quite similar tools ?

tog
- 887
- 1
- 12
- 22
12
votes
11 answers
How do classes help you manage large applications?
This came up in a conversation I was having online, and it occured to me that I have no idea how this is supposed to work: Quite a lot of programmers seem to just take as a given- indeed, obvious that classes are a necessary language feature for…

Breton
- 15,401
- 3
- 59
- 76