<FromGitter>
<rjnienaber> Looking for some advice: I'm working on a library that interfaces to a web api. The library will have a client that accepts fully typed data structures that will be serialized into json (or xml!) and sent to the web api. These data structures might hold 1 variable or they may hold 22+ variables and those variables could contain nested data structures. ⏎ ⏎ Given I also don't know how the library will be
<FromGitter>
... used, what makes more sense as the base type for the data structures: structs or classes?
<FromGitter>
<rjnienaber> Writing that all out makes me think that classes are the right choice because for bigger pieces of data, that could induce a lot of copying?
ur5us has joined #crystal-lang
_ht has quit [Quit: _ht]
walez has quit [Quit: Leaving]
<FromGitter>
<Blacksmoke16> if you're wanting to be able to pass around the payload data obj and expect it to be mutable, id go with a class
<FromGitter>
<Blacksmoke16> tho if you just want to have a base type so you can restrict methods and stuff with it then you could, assuming the base types are empty, use a module and leave it up to the end user