Skip to main content
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

I'm going to respectfully disagree with Michael here, and some rather smart programmers, like Rich HickeyRich Hickey, tend to think along the same lines as me. The key here is that you take care not to pass this data structure all over the place, but you use it as a base layer from which you build the sort of abstractions that Michael talks about in his answer.

These sorts of data structures get a bad rap. They are extremely easy to manipulate, with highly reusable tools. Without knowing anything about your application other than that one line of code defining a data structure, I could write an interface to convert it to JSON, HOCON, or XML. I could store it in a database. I don't have to write any custom serialization/deserialization code, which lets me reuse generic libraries. I can easily write queries and filters to give me nice strongly-typed class-based layers above this one. When my CSV file format changes, I have this much more flexible and dynamic layer of isolation between it and my more rigid and static classes above it.

In summary, don't make it your sole data structure, but using it as an intermediate data structure can solve a lot of maintainability problems.

I'm going to respectfully disagree with Michael here, and some rather smart programmers, like Rich Hickey, tend to think along the same lines as me. The key here is that you take care not to pass this data structure all over the place, but you use it as a base layer from which you build the sort of abstractions that Michael talks about in his answer.

These sorts of data structures get a bad rap. They are extremely easy to manipulate, with highly reusable tools. Without knowing anything about your application other than that one line of code defining a data structure, I could write an interface to convert it to JSON, HOCON, or XML. I could store it in a database. I don't have to write any custom serialization/deserialization code, which lets me reuse generic libraries. I can easily write queries and filters to give me nice strongly-typed class-based layers above this one. When my CSV file format changes, I have this much more flexible and dynamic layer of isolation between it and my more rigid and static classes above it.

In summary, don't make it your sole data structure, but using it as an intermediate data structure can solve a lot of maintainability problems.

I'm going to respectfully disagree with Michael here, and some rather smart programmers, like Rich Hickey, tend to think along the same lines as me. The key here is that you take care not to pass this data structure all over the place, but you use it as a base layer from which you build the sort of abstractions that Michael talks about in his answer.

These sorts of data structures get a bad rap. They are extremely easy to manipulate, with highly reusable tools. Without knowing anything about your application other than that one line of code defining a data structure, I could write an interface to convert it to JSON, HOCON, or XML. I could store it in a database. I don't have to write any custom serialization/deserialization code, which lets me reuse generic libraries. I can easily write queries and filters to give me nice strongly-typed class-based layers above this one. When my CSV file format changes, I have this much more flexible and dynamic layer of isolation between it and my more rigid and static classes above it.

In summary, don't make it your sole data structure, but using it as an intermediate data structure can solve a lot of maintainability problems.

Source Link
Karl Bielefeldt
  • 148.9k
  • 38
  • 285
  • 485

I'm going to respectfully disagree with Michael here, and some rather smart programmers, like Rich Hickey, tend to think along the same lines as me. The key here is that you take care not to pass this data structure all over the place, but you use it as a base layer from which you build the sort of abstractions that Michael talks about in his answer.

These sorts of data structures get a bad rap. They are extremely easy to manipulate, with highly reusable tools. Without knowing anything about your application other than that one line of code defining a data structure, I could write an interface to convert it to JSON, HOCON, or XML. I could store it in a database. I don't have to write any custom serialization/deserialization code, which lets me reuse generic libraries. I can easily write queries and filters to give me nice strongly-typed class-based layers above this one. When my CSV file format changes, I have this much more flexible and dynamic layer of isolation between it and my more rigid and static classes above it.

In summary, don't make it your sole data structure, but using it as an intermediate data structure can solve a lot of maintainability problems.