Giter Site home page Giter Site logo

acs-4931-simplify-conditionals's Introduction

Refactoring Exercises for Deliberate Practice

In this series of exercises, we practice various refactoring techniques. You may want to run pylint on this script to find any pep8 compliance issues. Fix as much as issues you can.

  • Exercise 11: 'Introducing Explaining Variable' Technique

    • Study the file gauge_eyeballs.py. Use 'Replace Temp with query' technique to improve readability of the code.
  • Exercise 12: 'Decompose Conditional' Technique

    • Study the file detect_toxins.py. Use 'decompose conditional' technique to improve readability of the code.
  • Exercise 13: 'Consolidate Conditional Expression' Technique

    • Study the file mix_ice_cream.py. Use 'consolidate conditional expression' technique to improve readability of the code.
  • Exercise 14: 'Consolidate Duplicate Conditional Fragments' Technique

    • Study the file make_shirazi_salad.py Use 'consolidate duplicate conditional fragments' technique to improve readability of the code.
  • Exercise 15: 'Remove Control Flag' Technique

    • Study the file find_food.py. Use 'remove control flag' technique to improve readability of the code.
  • Exercise 16: 'Replace Nested Conditional with Guard Clauses' Technique

    • Study the file extract_position.py. Use 'Replace Nested Conditional with Guard Clauses' technique to improve readability of the code.
  • Exercise 17: 'Decompose Conditional' Technique

    • Study check_cholesterol_levels.py file. Use 'decompose conditional' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.
  • Exercise 18: 'Consolidate Duplicate Conditional Fragments' Technique

    • Study change_gear.py file. Use 'consolidate duplicate conditional fragments' Technique to improve the code.
  • Exercise 19: 'Remove Control Flag' Technique

    • Part 1: Refactor read_file.py
    • Part 2: Refactor backdoor_method.py
    • Use 'remove control flag' technique in combination with any other refactoring technique you've learned to improve readability of the code.
  • Exercise 20: 'Replace Nested Conditional With Guard Clauses' Technique

    • Study calc_adjusted_capital.py. Use 'replace nested conditional with guarded clauses' technique in combination with any other refactoring technique you've learned to improve readability/modularity of the code.

Where to Submit Your Answer

Please submit your work to Gradescope.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.