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

Readability #165

Open
ageorgou opened this issue Dec 4, 2020 · 2 comments
Open

Readability #165

ageorgou opened this issue Dec 4, 2020 · 2 comments
Labels

Comments

@ageorgou
Copy link
Collaborator

ageorgou commented Dec 4, 2020

There are many ways we can write code that produces a particular result. Often these different ways will trade off one aspect over another; for example, people sometimes choose to sacrifice readability for speed, or brevity for clarity.

For this exercise, we will focus on what makes code easier to read and maintain. Even when you have written some code yourself, it can be hard to understand it immediately if you come back to it after a long time. This can be even more difficult for those seeing the code for the first time! Many factors can affect how easy your code is to read for someone who is new to it.

The branch week09 has two short files named version1.py and version2.py, which contain some code for a hypothetical analysis. The files don't work by themselves, as they require some (fictional) libraries. Both versions do the same thing, but are written differently.

Look at the two files, then think about which one is easier to read, and why. Put your answers in the Moodle questionnaire.

@ageorgou ageorgou added the week09 label Dec 4, 2020
@twemyss
Copy link

twemyss commented Dec 4, 2020

This is an interesting task, thanks.

Just to save people a few seconds of time, it looks like the files have been moved and the actual links are:

version1.py
version2.py

@ageorgou
Copy link
Collaborator Author

ageorgou commented Dec 4, 2020

Thanks for catching that, @twemyss.

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

No branches or pull requests

2 participants