You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you please add complete typing to (at least all externally visible) methods (both for input arguments and return types)? Without these it is hard to trust the code basis or use it reliably.
Instead of the magic values you use for nodes, tasks, etc. could you please use Enums (or at the very least constants)? If you use enums, then you can add clear types to input arguments in all of your methods and you can typify objects that have these values as their keys. That way your code will be more readable/usable, and the intention of each variable, input argument, key, etc. will be clearer for outside developers.
One might think that the enum is just a redundant duplicate of the hardcoded values, but this is not the case as one cannot add types to methods for hardcoded values and convey the desired intended input/output arguments. For even if, for example, you added types to argument, e.g.
the code falsely suggests that any values can be used e.g. for source_node, whereas this is not the case—only a fixed small finite number of options should be used here ('paper', 'venue', etc.).
One can theoretically also set the values of the enums to integers instead of these being duplicates of the names.
The text was updated successfully, but these errors were encountered:
Could you please add complete typing to (at least all externally visible) methods (both for input arguments and return types)? Without these it is hard to trust the code basis or use it reliably.
Instead of the magic values you use for nodes, tasks, etc. could you please use Enums (or at the very least constants)? If you use enums, then you can add clear types to input arguments in all of your methods and you can typify objects that have these values as their keys. That way your code will be more readable/usable, and the intention of each variable, input argument, key, etc. will be clearer for outside developers.
Here is an example of an implementation mit enums
One might think that the enum is just a redundant duplicate of the hardcoded values, but this is not the case as one cannot add types to methods for hardcoded values and convey the desired intended input/output arguments. For even if, for example, you added types to argument, e.g.
the code falsely suggests that any values can be used e.g. for
source_node
, whereas this is not the case—only a fixed small finite number of options should be used here ('paper'
,'venue'
, etc.).One can theoretically also set the values of the enums to integers instead of these being duplicates of the names.
The text was updated successfully, but these errors were encountered: