a-renzini / pygwb

MIT License
3 stars 3 forks source link

[JOSS Review] Code style #6

Closed Sbozzolo closed 10 months ago

Sbozzolo commented 12 months ago

This package is well-written. The overall code style is "boring" (in a positive sense), meaning that there are not excessive/unnecessary abstractions/use of fancy features, and so on. I like that most variables have long and verbose names. In my opinion, this is exactly the style needed for a scientific code (which makes it more accessible to domain experts and students).

From a technical point of view, there are a few choices that are not fully idiomatic. Examples are:

(There are also a lot of non-significant white spaces.)

I bring this up only to point out that there are some small opportunities to write better and more efficient code. The reason some patterns are more idiomatic is because they are objectively better/faster (e.g., dict() is more expensive than {} because there's the overhead of a function call). There are tools and services that can identify some of the above issues. In addition to the various linters/static analysis tools, you could have a look at deepsource (most of the features are going to be an overkill, but you can learn a lot from it; it's free with an educational account).

Feel free to close this issue at any time without changing the code (but it would be nice to at least remove the non-significant whitespaces).

kevinturbang commented 10 months ago

White spaces were removed and we will keep the other points mentioned above in the back of our mind for future development of the code.