Why Nostr? What is Njump?
2025-05-23 08:00:02
in reply to

Danny Morabito on Nostr: besides the obvious ai smell of having comments that describe what's obvious by just ...

besides the obvious ai smell of having comments that describe what's obvious by just reading the code, and no checking of anything whatsoever, it's not implementing a queue in any way, that's just an array with extra steps, it loses all the benefits of a real queue.

It probably stole that code from someone who doesn't understand data types either.

A queue has a pointer to a start and end; it has a limited size, and depending on the implementation and what you're trying to achieve it should either circularly wrap if it achieves the size limit, or it should throw an error.

Enqueuing and dequeueing should be constant time (O(1)), that means that adding and removing elements should always take around the same time.

Arrays wrappers like what chatgpt there created get progressively slower over time, as they work in linear time (O(n)).
Author Public Key
npub1ven4zk8xxw873876gx8y9g9l9fazkye9qnwnglcptgvfwxmygscqsxddfh