Questions tagged [legacy-code]

Originally legacy code meant code 'inherited' from authors or from a previous program/system version. Since Michael Feathers published his "Working Effectively with Legacy Code" book, new definition came to be, where code without tests is legacy code.

480 questions
-1
votes
1 answer

Syncing with stdio is making program i/o non - interactive?

#include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout << "Print two numbers: "; int x, y; cin >> x >> y; cout << x << y; return 0; } Input : 23 24 Output : Print two…
tusharRawat
  • 719
  • 10
  • 24
-1
votes
1 answer

Compatibility of Generics with legacy code - why does the foreach blow at runtime while iterator works fine

I have the following test code. I'm trying to understand the interoperability between Generics and legacy. List myList = new ArrayList(); myList.add("abc"); myList.add(1); myList.add(new Object()); System.out.println("Printing the unchecked…
g13n
  • 3,218
  • 2
  • 24
  • 19
-1
votes
1 answer

link against a legacy library: -lgfortranbegin from a premade makefile

I got some trouble trying to compile a programm developed by some researcher supposed to compute in a very precise way fourier transform and some other useful operation scientific paper here, whereas all the files needed and the makefile are…
MaDryn
  • 31
  • 7
-1
votes
1 answer

Trouble Converting code due to dual parentheses

I am trying to convert some old legacy from VB to C# but I am running into an issue with a particular area regarding dual parentheses Dim _atts As List(Of String()) = List(Of String()) Dim tmp() As String = Me._atts.Item(AttNo)(ValNo).Split(_SVM) I…
-1
votes
2 answers

Why change UB that will always work as intended?

In the legacy code base I'm working on, I discovered the line n = ++n % size; that is just a bad phrasing of the intended n = (n+1) % size; as deduced from the surrounding code and runtime-proved. (The latter now replaces the former.) But since…
Wolf
  • 9,679
  • 7
  • 62
  • 108
-1
votes
2 answers

PayPal Payflow Pro (Legacy) Implementation

Is there anyone that has successfully implement Payflow Pro in PHP? A client has forced me to use the Payflow Pro (Legacy) on the website, and it seems PayPal has removed the documentations for it. Link here I only need the documentation of how this…
AlbertSamuel
  • 584
  • 10
  • 33
-1
votes
2 answers

Plain HTTP along with WCF - how?

The brand-new WCF-based code needs (in the meanwhile) to provide a service to a legacy code that works in plain HTTP. So that, along with new SOAPed requests, I need to tailor some oldskul-style communication (on a different port): to be able to…
BreakPhreak
  • 10,940
  • 26
  • 72
  • 108
-1
votes
1 answer

$$ in perl subroutine definition

This could be a duplicate question. I know perl doesn't restrict users on no of arguments and their types. But what does $,$$ and ; stands for in below code. sub run($$;$) { my ( $x, $y, $z ) = @_; .... }
Bharat Pahalwani
  • 1,404
  • 3
  • 25
  • 40
-1
votes
2 answers

Method for ensuring GUI app runs regardless of user login post-XP

I had a really hard time thinking of an appropriate title for this question, if you can think of something better after reading feel free to change it. I have some legacy code that was built to run on XP, and I only recently realized while reading…
eddie_cat
  • 2,527
  • 4
  • 25
  • 43
-1
votes
1 answer

My script works with current jquery 1.11.1 , but not with 1.7.1. Why?

// selectbox $(function() { function selectbox(widgetSelector, optionsContainerSelector, optionsSelector, selectedOptionSelector, selectedOptionClassName, selectorClassName) { var target = widgetSelector; function…
-2
votes
1 answer

How does the memory layout look like when a double pointer is assigned to a single pointer?

I am currently working on a legacy code (still proprietary, so we'll have to make do with an MRE instead; and by legacy I mean code written in 1991). This is what I've come across: #include void foo(void*& ptr2) { // whatever …
justanotherguy
  • 399
  • 5
  • 16
-2
votes
1 answer

Load Legacy PrestaShop classes from deploy.php file

From deploy.php file in the root of my Prestashop project I call a method ModuleManagerBuilder::getInstance(); that in turn calls other Legacy Prestashop classes like Configuration This throw an error: [Error] Class 'Configuration' not…
-3
votes
1 answer

should I avoid static method as it's hard for testing?

I read the book Working effectivly with Legacy code. I understand the technics to break dependencies in Legacy code But I want to understand how to avoid these dependencies for the first time: 1- Regarding static methods: I understand Introduce…
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
-5
votes
4 answers

What is this Swift ternary operator? A == B ? C : D

I inherited an iOS app that is crashing at this line (unexpected nil). What is your best interpretation of what is going on here? indexPath.row.number == selectedItem ? cell.deselectStyle() : cell.dedeselectStyle() The cell.deselectStyle() and…
Nils Guillermin
  • 1,867
  • 3
  • 21
  • 51
1 2 3
31
32