Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# Exercise 3 #14

Closed
github-actions bot opened this issue Sep 27, 2023 · 0 comments
Closed

# Exercise 3 #14

github-actions bot opened this issue Sep 27, 2023 · 0 comments

Comments

@github-actions
Copy link

For this exercise, we will look at how to rewrite (refactor) existing code in different ways, and what benefits each new structure offers.

Some reading

How to write better code? People have interrogated themselves on this question a lot and they came up with a set of useful principles to guide their craft.
One of them is DRY, another one is the single responsibility principle (part of SOLID).
Another good read at this stage is PEP 8, the style guide for python code.

Let's refactor!

According to what you have been reading, do you see ways to improve the methods in times.py?

Review your changes

Run your script. Does it still behave as expected?
Do your tests still pass? Do they still map to the new methods you have created?
Are your docstrings still reflecting the behaviour of your methods?

Final tasks

Commit your changes!
Create a pull request from your branch to the original friend-group repository and use the text in the description to link your PR to this issue Answers neuroinformatics-unitrse-best-practices-playground#3.
Think of the benefits and drawbacks of this approach compared to the original version.
If you have time, think of other changes you consider useful and try them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant