The use of existing code for creating new software.

learn more… | top users | synonyms

1
vote
1answer
76 views

What is the correct reusable architecture using Entity Framework for common database tables and services?

Context I have a line of business application "MyApp" in C# using EF. Layers are separated as MyResusableLib.DataAccess // Class Lib: EF based utils, extension methods, MyApp.DataAccess // Class ...
2
votes
1answer
45 views

What are best practices when it comes to extensions in Swift with reusability in mind?

I like the Swift way of trying to eliminate unintended consequences wherever possible. Whenever there is a change to the language that deprecates something I have been doing for years, it forces me to ...
2
votes
4answers
233 views

Reusing the logic in another repository in ASP.NET MVC repository pattern

I have an ASP.NET MVC4 web application, with EntityFramework for data access. In the application I have two repositories as follow (this is only an example not my real code): public class ...
1
vote
1answer
53 views

Package Interfaces - Coupling & Re-Usability

Intent Packages should be designed to perform a single function well. Ideally this means that they should be highly modular and different packages should be able to be 'plugged-in' simply by ...
0
votes
2answers
113 views

Writing extensible versus deletable code [closed]

I know this might just be semantics, but reading the article titled Write code that is easy to delete, not easy to extend made me think that perhaps it is more or less along the same lines of creating ...
2
votes
1answer
91 views

Best approach to avoid duplication of code meant to run on windows/iOS/Android devices?

I am working on a new version of the following system: A 'main control' service that runs on Windows Server (C#). Clients on the following systems, that communicate with the above service via Web ...
1
vote
1answer
436 views

How to define dependent function in node js?

I have a nodejs project in which a sample.js include two function function A depends on function B's callback . // smaple.js Both function are included in the same file function B ( ...
2
votes
2answers
132 views

Should a parent CSS class be added to the markup or @extended?

Reading SASS basic features on their website, I stumbled upon the @extend feature. The example they give is the following: .message { border: 1px solid #ccc; padding: 10px; color: #333; ...
2
votes
2answers
223 views

Merging two applications into one

Background: My bosses want to merge two application that have two separate purposes. One being for monitoring of equipment and bandwidth for our internal network operations. The other is an ...
4
votes
2answers
104 views

How to help programmers use existing shared classes, instead of reinventing them? [duplicate]

My company has a fairly large software project (a couple million lines of code spread across many assemblies.) One sticking point we've consistently run into during code reviews has been with the use ...
2
votes
3answers
148 views

Single responsibility policy problem

I'm a bit stuck using the single responsibility policy. I have a class named Parser, which can be configured to parse input a certain way. For the sake of convenience I will limit the configuration ...
1
vote
1answer
45 views

Developing an application where a chunk of the code is used by both the app the tests

I'm developing a web app in PHP where part of the code I'm developing for it will also be used in the tests. I'm not sure how to handle this. That code in question is an abstraction to communicate ...
1
vote
2answers
572 views

How can we avoid having to build yet another CRM system from scratch [closed]

We are building an accounting web application. In our database, we store basic data about our customers, like phone number, their login informations, because these things are tied into our web ...
0
votes
2answers
105 views

Built-in the separate thread execution inside of the method or wrap the method by the thread

Let assume, I have some resource and time-consuming code, which I want to arrange as a separate method. In order to optimize the performance, this code should be executed in the separate thread. Now ...
34
votes
16answers
4k views

Are there concrete reasons not to use libraries and code snippets heavily? [closed]

Overall I'm in programming for about 8 years now and it seems to me that I'm relying more and more on open source libraries and snippets (damn you GitHub!) to "get the job done". I know that in time I ...
3
votes
2answers
2k views

What are the disadvantages of self-encapsulation?

Background Tony Hoare's billion dollar mistake was the invention of null. Subsequently, a lot of code has become riddled with null pointer exceptions (segfaults) when software developers try to use ...
0
votes
2answers
165 views

How to change the same code stored in several places after I improve one of them?

I have some code written in Matlab. I use the code in different folders which contains different data. Because I want to change some parameters for each different data, I keep the code in the folder ...
2
votes
2answers
96 views

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 ...
6
votes
6answers
769 views

What are the most used pattern to manage a lot of interconnected parameters?

I recently start to work on an application that drive different measurement device. Before the user start a measure, she sets the parameters of it. Actually, considering all measurements type there ...
4
votes
3answers
148 views

Unit of Design Versus Unit of Re-use. What is the difference?

Contemporary object-oriented programming languages employ the class as the unit of reuse. At the same time, the class is also the unit of design. This implies that to reuse a class, the design ...
24
votes
7answers
1k views

Does software reuse preclude process repeatability

Code Reuse as a Problem I was thinking about this question on software delivery, and I kept coming back to the issue of repeatability and / or reproducibility. They matter, because if you don’t ...
6
votes
6answers
719 views

performance versus reusability

How can I write functions that are reusable without sacrificing performance? I am repeatedly coming up against the situation where I want to write a function in a way that makes it reusable (e.g. it ...
1
vote
1answer
174 views

Should I modify an algorithm I coded for my employer if I remember the code perfectly and want to reuse?

My employer asked me to code a simple algorithm from a general description published by someone on the Internet (no code/pseudocode, just plain words and pictures). So to clarify, it's not my ...
1
vote
4answers
198 views

Making an automotive system more 'modular' in terms of software?

I am working on an automotive project that we are supposed to make more modular. I am a software guy and I have very little knowledge of automotive hardware.I dont have any requirements or details ...
4
votes
1answer
326 views

Derive from a base class but not include a condition in the base class's method

The current code looks like this: public class Details { Public void Populate() { WriteChapterDetails(); } public void WriteChapterDetails() { if ( ...
3
votes
3answers
2k views

Why is it a good practice to keep Javascript code in separate files?

In web development we are commonly used to keep Javascript code in separate files, but sometimes we need this Javascript code to manipulate server side data locally. For example, making an Ajax Call ...
1
vote
0answers
86 views

Maximizing reuse out of a function primitive in CUDA

I'm working on the implementation of a few related algorithms in CUDA, all of which require a primitive that we'll call f(). The related algorithms can't simply call f though, as they require f to ...
2
votes
1answer
138 views

Do you maintain your own utilitiy library [duplicate]

So, i've started working as a freelancer and therefore find myself copy/pasting util methods from one class to another. Not good to say the least. I do this on my mobile frontend dev and backend ...
2
votes
1answer
1k views

Should you reuse an Entity Framework EDMX between multiple solutions?

We currently have 1 giant EDMX for our corporate database. It, along with all of the generated POCOs, are in a separate project (we'll call it the EDMX project) which we pull in to any solution that ...
2
votes
3answers
842 views

Sharing business logic between server-side and client-side of web application?

Quick question concerning shared code/logic in back and front ends of a web application. I have a web application (Rails + heavy JS) that parses metadata from HTML pages fetched via a user supplied ...
1
vote
1answer
119 views

How to keep class parameters visible while using generic argument passing

After writing some classes where class initialization requires multiple options, instead of writing several parameters into constructors or setters, I started passing an associative array of ...
20
votes
9answers
3k views

Adding complexity to remove duplicate code

I have several classes that all inherit from a generic base class. The base class contains a collection of several objects of type T. Each child class needs to be able to calculate interpolated ...
1
vote
2answers
200 views

How to know whether to create a general system or to hack a solution

I'm new to coding , learning it since last year actually. One of my worst habits is the following: Often I'm trying to create a solution that is too big , too complex and doesn't achieve what needs ...
3
votes
1answer
372 views

Augmenting functionality of subclasses without code duplication in C++

I have to add common functionality to some classes that share the same superclass, preferably without bloating the superclass. The simplified inheritance chain looks like this: Element -> ...
1
vote
1answer
105 views

How do you wrestle the DRY principle with configs?

For instance, lets say we have an nginx config pointing at foo1, foo2, and foo3, as well as a haproxy config pointing at foo1, foo2, and foo3, and finally, a deployment tool pointing at the same ...
1
vote
0answers
44 views

Are Components ideal for packaging and reusing find() requests?

I find myself loading several models over and over again throughout my application. Instead of typing the code to load the model, run a find, would it be reasonable to put that code in a method and ...
0
votes
2answers
65 views

Automatically propagating changes

When working on multiple similar projects there are often changes that can't be extracted into a library, but should be applied to most of the projects. I mean changes like a modified directory ...
2
votes
1answer
103 views

What is a good strategy to develop apps that run in console and as API?

I develop quite often scripts that are primary used as a console application but later they are used in other scripts, webservices and other things where it is very convenient, to just import the ...
15
votes
9answers
1k views

How to promote code reuse and documentation? [closed]

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 ...
89
votes
12answers
8k views

Best practices for sharing tiny snippets of code across projects

I always try to follow the DRY principle strictly at work; every time I've repeated code out of laziness it bites back later when I need to maintain that code in two places. But often I write small ...
0
votes
2answers
866 views

How can I re-use object from another project?

I have a first project has a feature to viewing, inserting and updating an employee record, with this possibly I will create a java class for the UI and another for the database connection with ...
1
vote
0answers
79 views

How do I manage a JavaScript library with TFS?

I know that I can share files between Visual Studio projects using linked files and assemblies using project references. Is there a good approach for JavaScripts? I'd rather not use linked files since ...
2
votes
0answers
362 views

Reusable and customizable charting library on top of d3js

I have started building a charting library on top of d3js using javascript's inheritance. My goal is to develop reusable and fully customizable chart components. I read the article: Towards Reusable ...
4
votes
3answers
514 views

How to avoid programmers duplicating code [duplicate]

While I know in a perfect world where a greenfield application was scoped out from day one with great BRD's and a competent development lead constantly reviewed code by their underlings to avoid this, ...
1
vote
2answers
554 views

What's a DRY alternative to c++ header files? [duplicate]

In c++, is there any other way, besides header files, to use a function defined in file A.cpp, inside file B.cpp that would be considered good programming practice?
0
votes
1answer
720 views

How to reuse c++ code? [closed]

How do I call functions defined outside a source file given you shouldn't use header files? -- EDIT: generic(?) question below So, first, a problem should be broken down into simpler subproblems. ...
-1
votes
1answer
269 views

How to reuse spaghetti code

We're working on a new firmware for our new V2 device. The company has an older V1 firmware (and hardware). Hardwares are similar to each other (but there are some differences) so basically we could ...
0
votes
0answers
172 views

DRY on API specifcations?

When developing a new RESTful application, I generally: Define tests Define routes [ e.g.: RESTful CRUD; namespaced on /api/users ] Define models [ e.g.: "Users" ] Define forms [ e.g.: in ...
0
votes
2answers
179 views

Is it better to use already build plugins/extensions or code your own in programming projects [duplicate]

I am building a web app in PHP and Symfony. Basically if we search there are plugins / extensions / bundles for almost 60% of stuff. The advantage of using them is that you can easily get your ...
1
vote
1answer
169 views

Further decoupling using static libraries

I've been thinking for a while about reasons that prevent a lot of programmers — myself first of all — from writing clean, modular and expressive code while developing, for example, CocoaTouch apps. ...