legacy-code

What are the main syntax changes in Ruby 1.9?

Also, I'm wondering what effect upgrading to Ruby 1.9 would have on legacy code from version 1.86. Is the new version backwards compatible? ...

Practical refactoring using unit tests

Having just read the first four chapters of Refactoring: Improving the Design of Existing Code, I embarked on my first refactoring and almost immediately came to a roadblock. It stems from the requirement that before you begin refactoring, you should put unit tests around the legacy code. That allows you to be sure your refactoring di...

How to estimate a change on a maintenance project?

I was put in charge of maintaining, alone, a project that I never worked on before, altough I just received this task, and just started to look around the code, management asked me how long it would take to implement some new features and bugfixes. How should I evaluate this, what´s the better approach? Should I evaluate the time to "jus...

Inserting into Oracle the wrong way - how to deal with it?

I've just found the following code: select max(id) from TABLE_NAME ... ... do some stuff ... insert into TABLE_NAME (id, ... ) VALUES (max(id) + 1, ...) I can create a sequence for the PK, but there's a bunch of existing code (classic asp, existing asp.net apps that aren't part of this project) that's not going to use it. Should I ...

Is the 'synchronized' keyword in a classic enterprise application suspicious?

I am talking about classic enterprise applications. Typically hosted in some kind of application-server or container. Nothing fancy, just entities, services, Presentation/UI and relational storage. Whenever I see the synchronized keyword (either on methods or for blocks) in such an application I get very suspicious. In my opinion this i...

Multi-language build tools

I have a build process for a large enterprise system comprising several dozen separate EXEs and DLLs. These use multiple languages, C, C++, Fortran, Python, Awk and a couple more. The build scripts are 4DOS batch processes which evolved over 4 decades. They are large and unwieldy and need constant care and feeding. I must keep the Visua...

How to add ORM to a PHP legacy project?

Hello, guys. Need your advice very much. We'are working on the PHP project, which was in development for 2+ years, and now the team is ready and feel willingness to switch the development on ORM rails. Because it realy fasts the development and allow you to operate by Objects and not think in terms of SQL code and database tables in mos...

C#. Add polymorphism for legacy code

Hello, Assume we have legacy classes, that can't be modified: class Foo { public void Calculate(int a) { } } class Bar { public void Compute(int a) {} } I want to write a helper with such signature: void Calc(object obj, int a); Notice, that the first argument is of type 'object'. The test code should be some like this: ...

Legacy Code Nightmare

I've inherited a project where the class diagrams closely resemble a spider web on a plate of spaghetti. I've written about 300 unit tests in the past two months to give myself a safety net covering the main executable. I have my library of agile development books within reach at any given moment: Working Effectively with Legacy Code ...

How do you start with FxCop on legacy code?

Does anyone have any experience of introducing FxCop to legacy code? We would like to have our build fail if anyone introduces code that violates rules. But for the time being, this is impossible, as the legacy code has over 9000 violations. The only way to suppress errors I know of is through the SuppressMessage attribute, but that onl...

Is it theoretically possible to access any library from C# (aka what does PInvoke do under the hood)?

Like a lot of places my workplace has legacy code floating around along with more modern applications. For example we have a server application that still uses the Microsoft Fortran77 compiler. The less old parts of the application are written for the Visual Studio 6 C compiler and lately there have been runours of writing some new libra...

VB6 application on Vista running slow w/ lots of "FAST IO DISALLOWED"

I have a client that is running a custom VB 6 application they wrote on Vista. The application installs and runs fine on Vista. However, on one Vista PC the applcation loads and runs very slow. I had IT run a process moniter trace and I'm seeing a ton of "FAST IO DISALLOWED" results as well as other problems. What can cause "FAST IO DISA...

How do I refactor a WinForms application?

I'm going to bugfix a WinForms application (.NET 2.0) in the near future. Looking through the source code I find large code files (more than 2000 lines) most of them are generated dialogs with lots of code-behind. Has anyone tips for me to share? Any war stories or best-practices for bug fixing or refactoring WinForms applications? ...

help on version-control for legacy code.

I'm looking for some kind of backup/version-control method for a legacy system: Systems are developed in a version of BASIC. It's an interpreted version. Programs are saved in some pseudo-code; not pure text. All production programs are stored in the same folder tree, divided into folders depending on the category. No subversion stra...

documenting existing code

I just joined a Heroic shop. The code appears to be clean and quality, but there is no documentation to speak of. (the code was written and maintained by a small group). Thus, new engineers need to reengineer from source to determine design. As the project is transitioning from a small (3) team to a larger team, I would like to docum...

Modula-2 Developer ?

Guess no new project is implemented in languages like Modula, Ada , Oberon .. anymore (right?). But still there are legacy systems floating around, popping out here and there looking for their creators. They cant find them because they might be retired sitting at a beach somewhere enjoying themselves. Serious: 1) I am wondering if ther...

Methodology for designing a new application that will eventualy be merged into an old applications.

Currently I am on a team developing a new stand alone application in C#. The eventual goal is to roll this stand alone app into a previously developed larger application that pertains to the same processes. My question is this: I am looking for information on methodologies or processes that help with A) Design of said newer code, esspec...

Retrieve row order from DataGrid 1.0

I am working a legacy app which is .net 1.1 and I need to retrieve the rows in a datagrid post sort (by clicking on column header). This sounded like an easy task however, the answer seems to elude me. I can retrieve the rows from the dataset just fine but, they are not sorted again when the header is clicked. I appreciate any input. ...

What is the proper etiquette for handling potentially reusable legacy code in large projects?

I have been wondering what is the best way to tackle this situation. Is the best way to leave the old code in a comment block in case someone decides to add that functionality into the project again, or should this code be deleted for the purposes of keeping the source code clean and readable? ...

What is the best way to use a Custom .net control from a legacy C++ app?

I maintain a legacy application (unmanaged C++) and I need a new control (Basic Form). I would like to build this control in C# for simplicity but use it from my legacy app. Any suggestions? ...