Talk:Cumulative standard deviation: Difference between revisions

→‎Function takes vector/array or single value?: unfortunate case of an unfairly restrictive task description
(→‎Function takes vector/array or single value?: unfortunate case of an unfairly restrictive task description)
Line 14:
 
: Rather than "cannotdo something" I would prefer the more accurate "should not do something". Presumably the focus on the detail of how the incremental process works has something to do with ideas about efficiency? But, depending on the language, this level of micromanagement might make things considerably more inefficient than they would be otherwise - I have seen this kind of issue lead to timing ratios where one implementation would be over 9000 times faster than the other for some test data sets (though smaller differences are also possible and I try not to care when the difference is less than a factor of 2 -- modern machines introduce variations which can easily reverse a "less than factor of 2" performance issue). --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 10:33, 17 June 2015 (UTC)
 
:: '''Unfortunate case of an unfairly restrictive task description'''
:: I too think that mandating a stateful function makes this task needlessly restrictive. If the task were ''called'' "Stateful function" this would be appropriate, but for a generic math-problem task called "Standard deviation", I think it's bad to force solutions into a particular idiom that may be appropriate in some languages but not others - because this effectively bars those other languages from showing off an idiomatic solutions to that math problem on RosettaCode.
:: If there weren't such a huge number of existing solution making changes unfeasible now, I would suggest to:
::* Rename the task to "Running standard deviation" (so that a separate "Standard deviation" task can deal with the simpler case of fixed inputs).
::* Change the task description to something like "''For a stream of values that may come in over time (e.g. from standard input or from another algorithm), calculate and print the running standard deviation immediately after each incoming value''". Leave it open to implementors how to do this. Some may use a stateful function that is called repeatedly with single values, while others may use a function that takes a stream or lazy list as argument, etc.
::It may be too late for this task, but lets try to sure that in the future, such needlessly restrictive tasks get fixed during draft stage (and before they become big). Tasks asking for specific programming idioms or language features should be clearly named as such - generic math-problem tasks should not be hijacked for that.
::--[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 12:03, 17 June 2015 (UTC)
Anonymous user