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: Refactoring #4

Closed
lauraporta opened this issue Sep 26, 2023 · 0 comments
Closed

Exercise 3: Refactoring #4

lauraporta opened this issue Sep 26, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@lauraporta
Copy link
Member

lauraporta commented Sep 26, 2023

Exercise 3

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.

@alessandrofelder alessandrofelder changed the title Ecercise 3: Refactoring Exercise 3: Refactoring Sep 26, 2023
@lauraporta lauraporta added the good first issue Good for newcomers label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants