Skip to content

Instantly share code, notes, and snippets.

@CopperStarSystems
Last active January 14, 2017 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CopperStarSystems/0537f4fa805f1a6131eb0de5fe3cf83e to your computer and use it in GitHub Desktop.
Save CopperStarSystems/0537f4fa805f1a6131eb0de5fe3cf83e to your computer and use it in GitHub Desktop.
An example of mixed abstraction levels in a method
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