Skip to content

exercises(triangle): return an optional, not an error union#257

Closed
ee7 wants to merge 1 commit into
exercism:mainfrom
ee7:exercises-triangle-prefer-optional
Closed

exercises(triangle): return an optional, not an error union#257
ee7 wants to merge 1 commit into
exercism:mainfrom
ee7:exercises-triangle-prefer-optional

Conversation

@ee7

@ee7 ee7 commented Mar 12, 2023

Copy link
Copy Markdown
Member

We simplified the error set to contain only one error (4a4665a), so there's an argument to use an optional instead.

Refs: #229


Thoughts on whether this is an improvement? I'm not convinced for this particular exercise. Basically, if you call init with some strange side lengths, do you want an error or null?

I'll did this to see what it'd look like as null, but I'm leaning towards closing this PR. We can reopen it if we feel it's worth considering.

We simplified the error set to contain only one error [1], so there's an
argument to use an optional instead.

[1] 4a4665a exercises(triangle): simplify error set (2023-03-12)

Refs: exercism#229
@ee7 ee7 closed this Mar 12, 2023
@ee7 ee7 changed the title exercises(triangle): return optional, not error union exercises(triangle): return an optional, not an error union Mar 16, 2023
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.

1 participant