-
-
Save CopperStarSystems/0537f4fa805f1a6131eb0de5fe3cf83e to your computer and use it in GitHub Desktop.
An example of mixed abstraction levels in a method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeClass | |
{ | |
string inputLine; | |
List<string> extractedValues = new List<string>(); | |
// We're assuming that inputFile is a .csv file | |
// containing input values. | |
public void DoSomeWork(string inputFile) | |
{ | |
using (var file = new StreamReader(inputFile)) | |
{ | |
while ((inputLine = file.ReadLine()) != null) | |
{ | |
// do some work on the line | |
var inputData = inputLine.Split(','); | |
var desiredValue = inputData[3]; | |
extractedValues.Add(desiredValue); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment