legacy-code

syncing iostream with stdio

I am trying to add iostream to the legacy code and thus want to sync those two libraries. According to this article, I should use std::ios_base::sync_with_stdio. Now, I wonder how it is used in practice (examples please), side-effects I should be aware of. Thx ...

How can I mark Perl code as deprecated?

In my project I'm currently preparing a step-by-step move from legacy code to new, properly-designed and tested modules. Since not every fellow programmer follows closely what I do, I would like to emit warnings when old code is used. I would also strongly prefer being able to output recommendations on how to port old code. I've found t...

Separate threads for socket input and output

I got assigned to work on some performance and random crashing issues of a multi-threaded java server. Even though threads and thread-safety are not really new topics for me, I found out designing a new multi-threaded application is probably half as difficult as trying to tweak some legacy code. I skimmed through some well known books in...

Dead code detection in PHP

I have a project with very messy code - lots of duplication and dead code here and there. Some time ago there was zero code coverage by unit-tests but now we're trying to write all new code in T.D.D. manner and lowering technical debt by covering "old" code by unit-tests as well(test-last technique). Business logic's complexity is quit...

Separating rapid development from refactoring/optimization

I'm working in a team of 2 front-end developers on a web-based late-stage startup project. The site works quite well, but there's a lot of room for improvement code-wise, as the code is quite messy and disorganized. I would like to clean things up gradually by writing tests and carefully refactoring to avoid breaking anything. (Using p...

Web application to legacy code interop

I am trying to migrate a simple WinForms app to a ASP.Net web app. WinForms app is basically only a presentation layer for a complex plain C app, and interacts with legacy code through COM interop. I have modest experience in ASP.Net, javascript, jQuery, and lots of experience in WinForms and interop, so I know the basics, I just need to...

Is the StaticFactory<T> in codecampserver a well known pattern?

CodeCampServer source code contains a generic StaticFactory. I'm surmising that this is a key piece of the mechanism for how the framework plays well with Dependency Injection. Subclasses of which use it's DefaultUnconfiguredState to provide static access to, well, a Default Unconfigured State for themselves which the dependency resolu...

What effects does legacy code cause on a developer’s skills?

Edsger Dijkstra once said that "the use of COBOL cripples the mind...". How about working on legacy software? Do you, as a developer, get crippled by that? As an employed programmer, I have spent most of my time maintaining and fixing legacy systems. In my free time I constantly try to learn new techniques, languages or frameworks, but...

How to unit test a method with a `using` statement?

How can I write a unit test for a method that has a using statement? For example let assume that I have a method Foo. public bool Foo() { using (IMyDisposableClass client = new MyDisposableClass()) { return client.SomeOtherMethod(); } } How can I test something like the code above? Sometimes I choose not to use u...

Ruby on Rails: What to do with legacy code?

Hi, I've a portal project built in Rails 1.2.3. I've finished it at end of 2006. The project are using the following plug-ins: acts_as_attachment acts_as_ferret betternestedset simple_http_auth I know all plug-ins (or dependencies) was changed today, or doesn't exists anymore. The DHH says: Don't overestimate the power of versions. But...

Utility to Convert Legacy VB6 Function Calls to .NET

I am looking for a utility/tool to convert calls to legacy VB6 functions to the .NET equivalent. For example, it would convert this... FormatCurrency(Cart.TotalAmount) Len(Str) UCase(Str) UBound(PaymentsArray) To this... Cart.TotalAmount.ToString("c") Str.Length Str.ToUpper() PaymentsArray.Length - 1 Does anybody know of one, or a...

How to add a new feature to an existing component?

We have this legacy image viewer component in our project that's working fine but it's source is a real mess. I have to add a new feature to this component so that people can add annotation to images using a light pen which is not a complicated task per se but could be a nightmare dealing with our existing code. I'm really confused righ...

Possible consequences of increasing varchar length in MySql?

I'm using an old table, which has a varchar(40) field in it. I want it to be possible to insert more characters in that field, so I want to increase the length of it. Are there possible negative consequences I should think of before increasing the length? ...

What are the effects of using VS2005 to migrate from .NET 1.1

Hey guys, I'm working on some legacy code for a client, involving Microsoft Content Management System (MCMS). Currently, everything is local, the code, MCMS, SQLServer, and IIS (5.x). I copied the project folder, and then opened the new copied solution in VS2005, and let it do it's conversion thing. But now nothing works. I've nnotic...

How to make Server controls in .NET 1.1 render in compliance with Xhtml

Hey guys I'm "re-skinning" a legacy .NET 1.1 site (i know, don't ask). Anyway, originally it was all horrible html4.0 markup, and the new design is xhtml. How do I change the way server controls render in .NET 1.1 amd Visual Studio 2003? For example, the asp:ImageButton control is rendering without the self closing tag, how do I chan...

Career Question - Going from Java to Classic ASP / VB

Right now, I work on a small team at a large company doing Java / J2EE web applications. My original skillset wasn't in this area, but I'm starting to get the hang of things and get some more responsibilities on the team. However, our team is in a bit of limbo, and we're unsure of the future direction of our flagship application (we're J...

Is there any good reason to continue writing VBA + Access Forms applications?

I was recently asked to update an old Access Forms application. Coming from a .NET background, I found the change frightening, and became somewhat uncomfortable. I had assumed these were legacy technologies, fast becoming anachronisms... Am I wrong? If so, what are the reasons to continue using this technology (besides avoiding the cos...

Project Architecture For Enhancing Legacy project.

I am working on legacy project. Now the situation demands project to be divided into parts. What strategy I should follow to do this task. Description: The legacy project (A) is fully functional web application with almost well defined layers. But now i need to extend the project to a further enhancement. This project usage maven as...

Link seams in .NET

I just recently finished Michael Feathers' book Working Effectively with Legacy Code. It was a great book on how to effectively create test seams and exploit them to get existing code under test. One of the techniques he talk about was using "link seams". Basically the idea was that if you had code that depending on another library yo...

Method for finding memory leak in large Java heap dumps

I have to find a memory leak in a Java application. I have some experience with this but would like advice on a methodology/strategy for this. Any reference and advice is welcome. About our situation: Heap dumps are larger than 1 GB We have heap dumps from 5 occasions. We don't have any test case to provoke this. It only happens in t...