Questions tagged [code-reuse]

The use of existing software, or software knowledge, to build new software

875 questions
12
votes
16 answers

Have we given up on the idea of code reuse?

A couple of years ago the media was rife with all sorts of articles on how the idea of code reuse was a simple way to improve productivity and code quality. From the blogs and sites I check on a regular basis it seems as though the idea of "code…
Karl
  • 2,927
  • 8
  • 31
  • 39
12
votes
3 answers

DLL written in C vs the same written in C++

I was having a discussion with a colleague today. He claimed that writing a DLL in C would allow for any other application, written in whatever language, to use that DLL. BUT, if that DLL is written in C++, the number of applications that could use…
Anish Ramaswamy
  • 2,326
  • 3
  • 32
  • 63
11
votes
7 answers

Is there a website to look up common, already written functions?

I'm sitting here writing a function that I'm positive has been written before, somewhere on earth. It's just too common to have not been attempted, and I'm wondering why I can't just go to a website and search for a function that I can then copy…
Phil Salesses
  • 862
  • 1
  • 9
  • 31
11
votes
5 answers

SSIS and re-using C#

I'm a newbie to SSIS / C# (I'm generally a Java developer) so apologies if this is a really stupid question. Essentially the problem is this: I have two Data Flow tasks which load data up and export them to a legacy flat file format. The formatting…
user7094
11
votes
9 answers

How do I create and maintain a code reuse library?

I am trying to setup a repository of reusable code. I was thinking about having each reusable code module have a certain “Maturity Level” rating. The rating would be defined as the level at which a reusable code lies within a certain set of…
SwDevMan81
  • 48,814
  • 22
  • 151
  • 184
11
votes
2 answers

Best practice to use Sprites in a game using AndEngine GLES2

Currently I am having static reference to all my sprites and loading and initializing them in my OnCreateResource mthod of SimpleBaseGameActivity, But now I have to override onAreaTouched listener on spirtes and the way I can override it while…
Waqas
  • 4,411
  • 6
  • 27
  • 31
10
votes
4 answers

Where shall I put my utilities classes in a ASP.NET MVC3 application?

I am developing a web application in ASP.NET MVC3 with C# and Razor. I need to create an utility class where I put functions to convert string into dates(years, months, days, etc...). In ASP.NET Web Forms I used to place this kind of classes inside…
CiccioMiami
  • 8,028
  • 32
  • 90
  • 151
10
votes
4 answers

Make reference to C# code from multiple projects

I have a .cs file full of C# code I keep reusing in multiple projects. Right now I'm including it in these projects by copying and pasting the code into a new file in each project directory. This is the wrong way to do it. What's the right way to…
Joe
  • 3,804
  • 7
  • 35
  • 55
10
votes
6 answers

How/When to write reusable methods in OOP

I often find myself in a situation where i am repeating two,three lines of code in a method multiple times and then think whether i should put that in a separate method to avoid code duplication. But then when i move those lines out of the method i…
Abdul Waheed
  • 136
  • 1
  • 6
10
votes
20 answers

Good Idea / Bad Idea Should I Reimplement Most Of C++?

Recently, I've got a dangerous idea into my head after reading this blog post. That idea can be expressed like this: I don't need most of what the C++ standard library offers. So, why don't I implement a less general, but easier to use version? As…
fluffels
  • 4,051
  • 7
  • 35
  • 53
10
votes
1 answer

Reusing SQLAlchemy models across projects

I have some standard SQLAlchemy models that I reuse across projects. Something like this: from sqlalchemy import Column, Integer, String, Unicode from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class…
Kiran Jonnalagadda
  • 2,606
  • 1
  • 30
  • 29
10
votes
3 answers

How to reuse colors and styles in iOS/xcode?

Android, WPF and mostly every platform I've been working with, has way to reuse and "centralize" ui resources like colors and styles in a single file. in android it is posible to do like this: in colors.xml file:
daneejela
  • 13,081
  • 7
  • 38
  • 50
10
votes
1 answer

What is the best way to reuse classes from another Java project in Eclipse?

I have multiple Java projects in Eclipse. I would like to reuse some classes in my new project from my old project. What is the best way to do that in Eclipse? I.e. is it possible to add another "project folder" to the build-path for my new project?
Jonas
  • 121,568
  • 97
  • 310
  • 388
10
votes
5 answers

How to model mixins / multiple interfaces in Haskell?

I came across this question on modeling inheritance in Haskell and it reminded me that I have a little more complicated version of the same problem. I'll adopt the example from there because it's easier than thinking up my own. Suppose your program…
user445408
10
votes
8 answers

Very simple map implemention in C (for caching purpose)?

I have a program that read urls in a file and does a gethostbyname() on each URL host. This call is quite consuming. I want to cache them. Is there a very simple map-base code snippet in C out there that I could use to do the caching? (I just don't…
Steve Schnepp
  • 4,620
  • 5
  • 39
  • 54
1 2
3
58 59