It is the practice of reusing existing code to avoid redundancy in code.

learn more… | top users | synonyms

5
votes
1answer
191 views

UIView subclass – done right?

Generally, UI code is painful and full of kludges. (At least, mine was like that.) Recently I have decided to put an end to it and try to learn how to write good and reusable UI code. So here is the ...
12
votes
3answers
690 views

C Makefile boilerplate

This is the current Makefile that I use with my C projects. Here is what I would like to be reviewed: Reusability - is this Makefile easy to use for multiple separate projects with minimal ...
5
votes
1answer
110 views

Increasing readability of maximum path sum algorithm

I had written a solution for Project Euler problem 18 in Python 3. It is good in its efficiency but the problem is the readability and I think reuse. The algorithm used is that at every iteration ...
2
votes
2answers
174 views

Performance help with C++ algorithm

This is an algorithm I'm trying to optimize. I was trying to use openMP without any success. I know the code is long but most of it is params init Please try to explain why I need to change any ...
7
votes
1answer
159 views

Home-grown web service

I needed to build a one-way web service for a mobile app I developed. Its only goal is to receive incoming JSON data and insert it into the correct tables. It works, but it looks very "kludgy" and ...
4
votes
1answer
126 views

PHP magic function for accessors and mutators

I have implemented the following PHP magic method behavior to save my time of creating accessor and mutators for properties of any class that extends this base class. I am looking for suggesiongs on ...
11
votes
3answers
2k views

4×4 Tic-Tac-Toe in C

While trying to teach myself C, I decided to take a stab at writing this Tic-Tac-Toe program on a 4x4 board. It will be great if somebody could review it and let me know of some ways of refining this. ...
2
votes
1answer
84 views

Code reuse while keeping meaning clear and avoiding unforseen consequences

I like to reuse code as much as possible and keeps things DRY. But I'm afraid that sometimes it creates too many layers of indirection. It then becomes a chore to find where code exists that is ...
3
votes
2answers
117 views

Array manipulation exercise

While trying to learn more about arrays in C, I tried to write some code that did the following: Read a stream of numbers from the stdin and store them in an ...
1
vote
1answer
48 views

FixedSizePriorityQueue - Review Request

I implemented the FixedSizePriorityQueue class. The intended purpose is that, you can add as many elements as you want, but it will store only the greatest ...
1
vote
2answers
134 views

Improving this implementation of delegates

I borrowed the code from this question. I'm trying to implement the delegate in that code. Below is my outcome so far. What else can be done to improve this code? Any suggestions? I would appreciate ...
2
votes
1answer
111 views

Simple I/O class - Review Request

I wrote a FastReader utility class that is supposed to read input fast. Mostly aimed at parsing input files in competitive programming. How could I made this ...
1
vote
2answers
228 views

Is there a more efficient way for code reuse in Python - Largest prime factor?

I was doing timing with variations of function largest_prime_factor. I was able to write a better one largest_prime_factor2. ...