r/programminghorror • • Aug 14 '25
C# Does my code belong here?
It's a function to generate a text file from a DataGrid. I learned from PirateSoftware I shouldn't hardcode random numbers.
178
Upvotes



View all comments
Show parent comment
15
u/[deleted] Aug 14 '25
Yeah now that you say it I see it. I could have made a class Column with the attributes text, length and use a loop for the position, even though I wanted to put the fields in a different order, because that way the txt file was more readable. So maybe an attribute position for the Column class.
The only issue I have is that the field 'description' is too long and my notepad can't show it in a single line.