User talk:Dinosaur: Difference between revisions

→‎Sorting algorithms/Insertion sort: Righto, I've re-twiddle the code.
(→‎Sorting algorithms/Insertion sort: Righto, I've re-twiddle the code.)
Line 48:
== [[Sorting algorithms/Insertion sort]] ==
 
Please don't remove the "incorrect" template. It's important so that the task appear here: [[:Category:Fortran examples needing attention]]. And it's easy enough to write a correct insertion sort, it's absolutely not enough to leave it as is and hope it won't crash. Either correct it, and then reomveremove the template, or leave it so that someone can see it and make the proper modifications.
 
[[User:Eoraptor|Eoraptor]] ([[User talk:Eoraptor|talk]]) 15:33, 29 December 2017 (UTC)
 
:So, could you have one to provided suitable modifications? I imagine that the originator did test runs on their system, and all went without surprise. I suspect that many other compilers will produce working code too, so anyone copying this source code would likely gain success as well. It is likely that there will be textbooks showing this code without warning, so, I thought introducing a warning to the source file sufficient, as it is followed by an older-style version with the compound test broken into the formal equivalent (and thus wastefully testing J the first time) for an example. Anyone implementing an insertion sort should check its working on their system, even though one might expect published algorithms, correctly transcribed, would work correctly. Alas, given the unreliable vagueness of the language specification on this question, seemingly minor changes to the code may result in changed behaviour! So indeed, the code should be such as not to succumb to this vagueness, and documenting the risk might be regarded as insufficient.
 
:The twiddled version is not actually a formal equivalent of the commented-out DO WHILE loop, nor need it be. I've left the "incorrect" template in for your possible removal, as my judgement may not be to your taste. Cheers, and happy New Year. [[User:Dinosaur|Dinosaur]] ([[User talk:Dinosaur|talk]]) 02:03, 30 December 2017 (UTC)
1,220

edits