-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Update average run time #430
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this, since I think all the other values have exactly one valid JSON type. But it's probably not too annoying for configlet lint
, and I can agree that getting an error for 5
feels a bit painful.
An alternative is to move to integer only. But:
- that requires an Exercism-wide PR, which probably isn't worth our time.
- if a track gets down to very low average run times, the difference between e.g.
1.0
and1.5
may be meaningful enough.
So I'm OK with this PR. But I think I prefer it as float only. I think configlet lint
would need some custom parsing hook to not error when it sees an integer when it's expecting to set the value of a float
field. And it's not like tracks are often seeing an error for an incorrect type here, right?
Are there any other values where we want to be more permissive with the type? But e.g. we don't accept a value of "3"
for a version, even though we could argue that "we know what the user means".
Also, when
The answer to both questions should be the same, because So we have two options:
Things are simpler if the type of everything is known at compile time. So I think this PR isn't worth it. Thoughts? |
Well, why not? Should be easy enough.
It won't be though, as there are many other factors that influence the average run time, like how crowded our servers are. People won't notice a difference of half a second. |
Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com>
There are two reasons for this change:
Having the average run time as a float gives the impression of being exact, whereas the actual run time wildly varies due to a wide variety of reasons (e.g. how busy it is on the server). That fractional component will almost never actually conform the real situation.
jq
is often used to work with trackconfig.json
config files (e.g. to add elements to it), and it will remove any trailing.0
fractional part from a number, which causedconfiglet lint
to fail. Those JQ scripts then have to work around this by manually adding.0
to it.