Replies: 1 comment 1 reply
-
I am sorry I haven't seen your discussion earlier, but I don't agree with your points. i) A well-named and well-organized single file can be just as specific. Moreover, having them in one file allows developers to get an overview of all the data types at once(better DX), which is often more beneficial for understanding the system as a whole. ii) Why this is not true: The constant multiple imports that someone has to do would simply not be "less repetitive". This method would likely increase the amount of repetitive code, as each file will have to import its dependencies independently. Moreover, it make the structure more complex to manage. iii) Splitting the data types into separate files could increase the surface area for mistakes and misunderstandings, particularly if the separation makes it harder to see how the types are connected to each other. The advantages of having all your structs and libraries under the same umbrella:
Given these considerations, I strongly suggest for maintaining our current approach. |
Beta Was this translation helpful? Give feedback.
-
This idea just came to me - what if we split
DataTypes.sol
into multiple files?types/Generics.sol
types/Lockup.sol
types/LockupDynamic.sol
types/LockupLinear.sol
This design is (i) more specific, (ii) less repetitive, and (ii) more robust in the long term because the
DataTypes.sol
file would not get cluttered with increasingly more types.Beta Was this translation helpful? Give feedback.
All reactions