This is a long term task and will likely require more than 1 PR to complete. A lot of previously written code is written in a very clever but very hard to read way e.g.
- ImageUtils is passed as a kwarg so it's hard to find where it's actually being used
- Confusing ways of overloading functions e.g.
@classmethod
def from_json(cls, serialized: dict) -> "GoogleDriveFile":
return {
GoogleDriveTextFile._code: GoogleDriveTextFile.from_json,
GoogleDriveImageFile._code: GoogleDriveImageFile.from_json,
}.get(serialized["_code"], lambda x: GoogleDriveFile(x, from_serialized=True))(
serialized
)
# it's much more obvious just to use an if else statement
Though this is readable to an experienced Python developer, it makes it very difficult for new Daily Bruin contributors to understand the code. We should this code (mostly in kerckhoff.packages) so that it is more readable to the average person
This is a long term task and will likely require more than 1 PR to complete. A lot of previously written code is written in a very clever but very hard to read way e.g.
Though this is readable to an experienced Python developer, it makes it very difficult for new Daily Bruin contributors to understand the code. We should this code (mostly in kerckhoff.packages) so that it is more readable to the average person