legacy-code

Open book PHP test

Hi, I have a open-book test this week and I've been notified that the test will be an exercise whereby a chunk of legacy code is provided and a requirement to 'port' the code. I understand what a open-book test is and the requirement of it (to test your thought process etc) but (it's a long shot) what could 'porting' involve? I have a ...

Is there a way to translate C code to Ruby?

I'm sitting with massive amounts of legacy C code that needs to be converted to Ruby for a project. I've seen Ruby to C translators online, but not the other way around. Would there be a simple way to approach this particular problem? ...

Unit testing a 'legacy' WPF Application

The product I have been working on has been in development for the past six years. It started as a generic data entry portal into an insanely complex part WPF/part legacy application. The system has been developed for all these years without a single Unit test in its fold. Now, the point has been raised for a comprehensive unit testing f...

Commented Out Functionality? To Remove or Not To Remove?

As I work on a code base there always comes a time when an old rule or some bit of functionality needs to be removed. I often simply comment out the code that needs to be removed. However I wonder whether I should simply delete the lines of code that need to be removed or leave them in? Any recommendations? Thanks! ...

How to avoid Eclipse warnings when using legacy code without generics?

I'm using JSON.simple to generate JSON output from Java. But every time I call jsonobj.put("this", "that"), I see a warning in Eclipse: Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap should be parameterized The clean fix would be if JSONObject were genericized, but s...

What's the best way to upgrade from jquery 1.3 to 1.4?

I'm trying to decide if upgrading is viable given all the libraries we are using. The problem is some of these plugins arent being developed anymore so I'm not sure which of them is compatible with 1.4 Any thoughts on how to best approach this given legacy dependencies on older plugins? ...

Converting table based layout into a div/css based one.

I'm supposed to rewrite the UI for a rather large web application. The thing is that the layout is completely based on tables and if I could somehow, semi automatically, convert the tables into divs it would save me a huge amount of time. What are the best practices when doing something like this? Is this a good idea at all? The appli...

How to motivate team to work on legacy products

We are a team working on legacy code which is pretty old and written in languages of initial programming days. As the team members are trained in latest technology and are now put to work on legacy code, they are not happy. How to motivate them to work in legacy code also? ...

Seeking suggestions on redesigning the interface

As a part of maintaining large piece of legacy code, we need to change part of the design mainly to make it more testable (unit testing). One of the issues we need to resolve is the existing interface between components. The interface between two components is a class that contains static methods only. Simplified example: class ABInte...

Are there solutions for streamlining the update of legacy code in multiple places?

I'm working in some old code which was originally designed for handling two different kinds of files. I was recently tasked with adding a new kind of file to this code. Most of my problems were solved by filling out an extensive XML file with a new entry that handled everything from what lists were named to how the file is written in plu...

Extend legacy site with another server-side programming platform best practice

Company I work for have a site developed 6-8 years ago by a team that was enthusiastic enough to use their own private PHP-based CMS. I have to put dynamic data from one intranet company database on this site in one week: 2-3 pages. I contacted company site administrator and she showed me administrative part - CMS allows only to insert h...

Calculating annual percentage rate (need some help with inherited code)

I'm making an application that gives clients and approximate loan offer (they are later calculated by other back-office systems). I have received some code from the financial firm that we are making the calculator for. My problem is that I do not understand the part of the code that calculates the annual percentage rate (including start...

C# fine-grained permissions: multiple internal systems, intranet scenario

Hello all, I have the following scenario: Multiple users (< 100) User accounts in AD (under different groups) Every group in AD corresponds to a internal department; each department have at least one supervisor (One may say) We have cross-supervisioning (there are supervisor roles appliable to group of groups, i.e., there may be one s...

Unit test for Lucene indices

I'm working on legacy code that builds an index of popular terms in another index. There are no unit tests in place, and the indexing process is a pain to wait for because the first index takes so long to build. I want to structure the second (popular term) index differently. Is there a best practice for testing to see if a Lucene inde...

How can you implement test driven development with legacy code?

The situation: millions of lines of code, more than one hundred developers and frequent defects. We want to avoid repeating defects and we want to improve code design (who doesn't?). Test Driven Development (first unit test, then code) sounds ideal: write a test case for each function. But, with so much code written, how can TDD be imp...

Adding features to code bases which are in dire need of refactoring

I am developing on a system that is a bit difficult to work with. It is 99% undocumented, does not follow best practices and is fairly difficult to understand (globals galore, methods spanning 50 lines, eval abuse, etc.). Unfortunately, I am fairly new to the code base and I need to add functionality. I am sure there is code in there th...

WCF: wrapping legacy API question

I have to wrap legacy .net assembly API (set of classes and interfaces) with WCF service. Service is visioned as proxy that delegates calls to existing classes with virtually no additional work. So I addded [ServiceContract] interface that exposes methods that deals with existing structures and classes. But wcf-proxy-generator (svcutil...

Term for legacy bug replication?

Out of idle curiosity, does anybody know of a term for replicating bugs in a new implementation of an old system so as to maintain backwards compatibility with old clients that rely on the buggy functionality? I'd be particularly interested if it included a connotation of having to reverse engineer the incorrect behavior so as to proper...

how to survive maintaining a monster you created

You've worked somewhere for 3 years. At the beginning of the second year you were involved in what you thought would be a small project. You foolishly decided to take some risks with the choice of tools, you got slightly out of your depth, you ended up writing some nasty hacky code in the end as delays kicked in. The client loved it, y...

need some simple help understanding a bit of pre-PHP5 code

I was turned on to nstrees from another question, and have been working through the script. It was last updated in 2005 and relied on some stuff that has since apparently been deprecated like HTTP_POST_VARS which I wasn't immediately familiar with since I've been doing PHP for only a little less than a year. Anyways, the coding style se...