Skip to content

Comments

Refactoring#1

Open
DaisyMolving wants to merge 6 commits intomasterfrom
refactoring
Open

Refactoring#1
DaisyMolving wants to merge 6 commits intomasterfrom
refactoring

Conversation

@DaisyMolving
Copy link
Owner

Trying to work on:

Extracting functions for clarity.
Naming functions for clarity.
Making functions private where their behaviour can be tested through other functions.

Any feedback on this would be super!

def ask_question([], _), do: perfect_score_message
def ask_question([current_question | next_questions], score) do
validate_input(request_answer(current_question[:question]), current_question[:answer], score, next_questions)
request_answer(current_question[:question])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expand this pipe 😄
current_question[:question]
|> request_answer
|> validate_answer...
|> continue?

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

Successfully merging this pull request may close these issues.

2 participants