FestivalDelGelato
When should/shouldn't I split off code into a separate lib project?
rather than start immediately worrying about
- IDE performance
- compile time
- binary size
- runtime performance
i would first analyze the designing part
if a project/library is isolated it means it is a dependency, so it has a version, so it is to maintain in all these aspect, which could be a good thing or a bad thing
it depends how many libraries there are, how many people will maintain it, and so on, so i would complete a general study on that and then take decisions
76 replies
✅ how should I deal with common/similar data types between the backend and front?
the issue here is it's not clear what
ShopItemDTO
is being used for
because if it's a creation model, for example, it shouldn't have an id
if it's a viewing model maybe you don't want to give all the fields or maybe you want to add more fields that could be useful like an image
so it could be useful to have a shared abstract class (or even interface) for some 'core' fields, but most probably there will be fields dedicated to the specific feature12 replies
Serialize HashSet into a binary file
if you want to use unsafe context, get a pointer, and then write the size of the object, i believe you can if you really wish to do so (to a limited extent)
(keeping in mind this should not be used in a production environment, BinaryFormatter has been removed for a reason)
218 replies
Serialize HashSet into a binary file
you can take all the private fields of an object and write them in a file (and then do the reverse procedure when reading the file), but it's risky because if you screw up something then data is unreadable, and also if framework gets updated that data is unusable
218 replies