What I did is a process of refactoring to the bubble_sort code base. I've just cleaned it up a little and make it much more understandable, simple and communicative to the user. Of course that it can be better but I leave it better than I found it.
An update to the algorithm is using return instead of break, even tough they act like the same here, break is a bad practice and it should be avoided as it acts like a goto and we all know how harmful goto can be to the code. I consider that using it would make other new programming learners to use this keyword maybe even if is not neccesary.
I am creating a pull request for...
[] New algorithm
[x] Update to an algorithm
[] Fix an error
[x] Other - Describe below
What I did is a process of refactoring to the bubble_sort code base. I've just cleaned it up a little and make it much more understandable, simple and communicative to the user. Of course that it can be better but I leave it better than I found it.
An update to the algorithm is using return instead of break, even tough they act like the same here, break is a bad practice and it should be avoided as it acts like a goto and we all know how harmful goto can be to the code. I consider that using it would make other new programming learners to use this keyword maybe even if is not neccesary.
THIS IS NOT VALID