I always have to laugh when some gate keeper tries to act like a smart ass. Oh you are so smart but you can't see why they teach a stupid simple algo? Jesus Christ, it's to learn the basics and what not to do.
Donald Knuth actually stated in "The Art of Computer Programming" there is no practical reason to teach Bubble Sort aside from the catchy name. He recommends teaching "Insertion Sort" as the first O(n2 ) sort students are taught.
Owen Astrachan (principle investigator of the multi-year AP Computer Science courses & exams) agrees. The guy is actually on a personal crusade to stop teaching Bubble Sort totally. He's used far harsher language to describe it.
There isn't a great reason to teach Bubble Sort. It isn't gate keeping, it is just wasting the teacher's & student's time because literally every other sort is superior. Shell Sort is actually far more intuitive, and Insertion Sort is heavily used in modern hybrid sorts algorithms (some of the fastest known, as a fall back mechanism within quick sort's partitions). There's way better uses of everyone's time than teaching Bubble Sort.
What I'm trying to say is prioritizing subject matter to be impactful and make best use of everyone's time isn't gate keeping.
Donald Knuth actually stated in “The Art of Computer Programming” there is no practical reason to teach Bubble Sort aside from the catchy name. He recommends teaching “Insertion Sort” as the first O(n2 ) sort students are taught.
Bubble sort has nothing to do with a catchy name. It is stupid simple to explain to a broad variety of people. Regardless of sorting, it’s just an excellent beginner’s example of an algorithm.
Teaching insertion sort and pointing it out as O(n2) completely misses the point.
I am shocked that a professor at one of the greatest comp sci programs on the planet thinks bubble sort is not worth his 2 minutes.
There isn't a great reason to teach Bubble Sort.
It's simple.
While a comp sci class at UC or an AP class will only spend 15 minutes on this, a community college course is going to spend days on this, and have MANY students missing any real mathematical background.
I'll actually look into the reasoning behind this later but I cannot imagine a good reason for skipping a 15 minute lecture on this purely as and introduction and example on what not to do. For many, understanding the difference between insertion, bubble, and merge is a complex topic which will need reinforcement.
Yup, definitely wasn't trying to gatekeep.. was actually quoting my intro to CS professor from a decade ago.. he's known in his field for developing and writing books for CS101 courses. Gave a strong speech why he refused to teach bubblesort.
Why would you teach anyone how not to do something? You know there is many ways to inefficiently sort a list. Why make a video about any of them?
If you're going to teach bubblesort, you might as well teach Bogosort.. maybe eventually after seeing all the ways you're not supposed to sort a list, the student will arrive at a better algorithm on their own. But this seems inefficient. IMO, the introductory algorithm to sorting is Selection sort. It's intuitive and while not terribly efficient, it does allow you to build on the knowledge and introduce more complex algorithms, bubblesort does not.
Bubblesort, is just some stupid peace of trivia that people who are full of themselves like to bring up as a stupidly overused joke.
You know there is many ways to inefficiently sort a list.
That's a terrible assumption. Not everyone is as gifted as you.
We can't keep people out of a passing lane or use blinkers and you think people are naturally, and casually looking for better ways to improve their sorting efficiency?
What? All I am saying, is if you were to teach someone sorting algorithms, do not teach them something useless that has no potential to build up to anything useful.
What you are arguing is that the best way to teach a kid how to tie their shoes is by first showing them how to make a dead knot. Sure it's simple, but what is it's use, not like you can go on and teach other knots from there. You're basically teaching someone how to fuck up.
Why would you teach anyone how not to do something?
Umm. To explain strengths and weaknesses? To explain how to optimize something that already fulfills requirements but isn’t efficient? To make a design trade off that the simpler algorithm is sometimes good enough?
IMO, the introductory algorithm to sorting is Selection sort.
Selection sort introduces state and is therefore way more complicated to explain.
And why do you think it's more complicated to explain? It is literally how a fourth grader would approach sorting a list of numbers, it is how you would sort the money in your wallet, it is the default human way of thinking.
17
u/BruhWhySoSerious Dec 02 '19 edited Dec 02 '19
I always have to laugh when some gate keeper tries to act like a smart ass. Oh you are so smart but you can't see why they teach a stupid simple algo? Jesus Christ, it's to learn the basics and what not to do.