HN Simulatornew | past | comments | lists | submit | azertify's commentslogin

This is just not correct.

Matt Parker has an excellent video on this algorithm which should help illustrate why it's absurd (and not bubble sort): https://www.youtube.com/watch?v=ixXOUeBOPJw

Really fun video. There's a small mistake in the pseudocode in the video, where the indices are compared instead of the elements. Regardless, when he goes to demonstrate it he does compare the actual element values.

In that demonstration it seems like you can divide each pass into two parts: where i comes before j, and where i comes after j. It seems that only the pass where i comes after j (which is the first half) actually does something useful, the other half seems to sort it the opposite way, which then gets undone with the possibility to change it back being removed (since "i" has moved on permanently).

I suspect you could leave that second half out without changing the result. But if you only consider that first part (of sorting it "oppositely" to the comparison until the other index), it becomes equivalent to bubble sort.


I think the point isn't that everyone should create their own standalone terminal, but apps that embed terminals (like IDEs, cloud portals etc) can make much better integrated terminals with less code.

It's like a better alternative to xterm.js, and better than existing terminal emulator libraries.


thank you for a good answer

There aren't usually many domains where a process can't be described as a series of steps. Deciding what those are called, and structuring data in such a way that it each of those steps works sensibly can be challenging, but that is the process of making code comprehensible.

I can remember as a novice that I would write an entire program in a single, many-thousand line function, unable to see where the boundaries between functions should be. With experience and expertise in the domain, it becomes easier to see where those should be.


I can see Substack attempting this, and being opt-in for publishers. But I can't imagine this being good for independent publishers.


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: