Review of Jesse Phillips's CSV Parser

Robert Jacques sandford at jhu.edu
Mon Nov 7 20:28:20 PST 2011


On Sun, 06 Nov 2011 19:00:42 -0500, Jesse Phillips <jessekphillips+d at gmail.com> wrote:
> And only one pending request, csvFormatter. I am still considering how I
> want to approach this. I don't want to rush it in so I don't plan on
> having it complete before voting starts.

My primary use of csv files is as a method of saving data to later graph / view / format in Excel. i.e.

csvWrite("filename",["x","y","z"],x,y,z);

where x, y, z are ranges with possibly different lengths and/or types.

I also have some API design concerns. Primarily, most of the type names are overly broad and unclear. For example: Record, Records, Malformed could just as easily be part of a database API. And because of this, not only does one reading the code not know what the object is, but if namespace conflicts can occur, then code reviewers will probably make the wrong assumption half the time as to what Record is and not bother looking it up.

Furthermore, Records and Record, are essentially internal ranges/structs returned by csvReader. In the tradition of std.algorithms these should be defined inside the csvReader function (preferably) or as CsvReader / CsvReader.Record.


More information about the Digitalmars-d mailing list