Hacker Newsnew | past | comments | ask | show | jobs | submit | klibertp's commentslogin

> Why not?

Time. CPython compiles in a few minutes on an underpowered laptop. I don't recall last time I compiled GCC, but I had to compile LLVM and Clang recently, and it took significantly longer than "a few minutes" on a high-end desktop.


If a language has a well-designed collections library (think Smalltalk and derivatives, not C++'s STL), the difference between 1 and 0-based indexing is hard even to notice, much less lead to "less elegant" code. Between Stream and Collection subclasses, the API is rich enough that using indexes is reserved for very low-level operations that you seldom use in non-FFI, non-VM code.

What you say is true for languages that don't have collections, real arrays, or vectors, only memory ranges. This is the case of C, but not Fortran, Pascal, or Ada. So yeah, if all you have is a hammer, you'd better use 0-based nails; hopefully, though, we'll allow for non-hammer tools in popular toolboxes sometime this century.


It would be nice if the eventual AI overlord was called Borland...

> I'd like to believe there is some correlation between proper punctuation and the quality of the answer.

I'd love to believe that, but it's unrealistic in 2025, given all the correctly punctuated slop that brings negative value (wastes time, gives no info) to readers everywhere on the Internet. As much as I hate to admit it, I think this ship has sailed.


Arainach:

> Using proper language is how I think.

logicprog:

> because it's closer to how I think them — usually in something like the mental form of full sentences

Yeah, I'm the same. However, I'm also very aware that not everyone thinks like that.

I'm sensitive to sounds, and most of my thinking has to be vocalized (in the background) to make sense to me. It's incredibly hard for me to read non-Latin scripts, for example, because even if I learned the alphabet, I don't recognize the word easily before piecing together all the letter clusters that need to be spoken specially. (I especially hate the thing in Russian where "o" is either "o" or "a" depending on how many of those are in the word. It slows my reading of Cyrillic script down to a crawl.)

Many people - probably most of them, even - don't need that. Those who think in pictures, for example, have it much easier to solve Sudoku or read foreign scripts. They don't need that much linguistic baggage to think. At the same time, when they write, they often struggle to form coherent sentences above a certain length, because they have to encode their thought process (that can be parallel and 3D) into a 1D sequence of tokens.

I don't know whether this distinction between types of thinking has any scientific basis - I'm using it as a crutch to explain some observable phenomena in human-to-human communication. I think I picked up the notion from some pseudo-scientific books I read as a teen (I was fascinated by "neuro-linguistic programming," which tends to list three distinct types of thinking: visual, auditory, and kinesthetic). It unexpectedly finds applications in human-computer interfaces, too, but LLMs have made it even easier to notice. While "the three NLP modalities" can well be bullshit, there seems to be something that differs between people, and that's where threads like this one seem to come from.


Isn't it the other way around - people, especially when young, like to imagine themselves as someone special, so the media give them the perspective of the most special individuals they can find? Being a king, on its own, may not qualify - but the popular shows are rarely about "just" kings, it's mostly about ones who did something impressive (if evil; though I agree that last part tends to be edited out).

In fantasy literature, a hero is almost certainly either a prince or at least of royal blood; in sci-fi, he's at least a progeny of a war hero or great inventor. Even in romance slice-of-life, you'll get mysterious amnesiacs, rich CEOs children, shrewd nerds with underworld connections, etc. much more often than statistically possible - nobody wants to read about "normal people", not really (when we think we do, it's just the author writing so well that he convinced us his "normal people" are different!)

I can't rule out the possibility that this natural tendency is being exploited and manipulated in some cases, but the stories have always been about heroes, long before anyone thought of erasing anyone else's class consciousness.


I mean, It's the same as consciousness of ourselves in the present.

There are pieces of media that present the real struggles of the average worker. But not that many. Many films are instead invested in the ephemeral (and ever lasting) questions of reality, fiction(fantasy/action/drama), or inane or politically convenient biopics (if not totally altered).

You will occasionally see a nod to "struggling to pay bills" or some mundane romanticized struggle, stuff like that, but almost never a picture of what its actually like.

For the few popular films that do show it, and this is my critique of most media, they never compel the viewer to ANSWER the question of why this happens. This is because to present the real working class life is also to critique it and the conditions that create it.

The working class life reveals it's own critique. And that critique is not something that media owners like because it puts into question the whole status quo. It is INHERENTLY politically charged content.

So they avoid painting a real picture of average people. This lack of real exposure is a heavy influence on our ideas of reality. And essentially the viewers take this image and runs with it. The viewers ends up not learning HOW the world works, they start to see themselves as "temporarily embarrassed millionaires", and end up seeing society as a pool of ever-permanent social mobility, its just not their turn yet.

This is, essentially, the same thing they do with the past.

And I do not have anything against "special people" in media. This can be helpful, even, if done appropriately, by being sure to present kids with the REAL AND RELEVANT paths on how to attain this specialty (if it isn't real and relevant its just escapism). What I critique is the role that medias self-reflection plays in the world and in the past that is problematic.

To come back to the actual post: Who originally started to view cottage living or working class farm life as cute and WHY? Was it truly our grandmas and grandpas? Or was it people compelled and organized to sell historical-fantasy books?


Kagi uses Yandex to improve search results for relevant queries. That's all they do.

As a company providing the service of web search, Kagi should do whatever it takes to improve search results. I imagine Yandex is the biggest and most complete index of Russian-language content - not using it would make the search results worse. The fact that Kagi still cross-references other indexes and allows users to downgrade specific results provides a check on propaganda content.

It's OK to have an opinion, and it's OK to dislike Kagi because it doesn't have the same opinion. It's wrong to mischaracterize what Kagi does, using wording that strongly suggests actions way more nefarious than giving a few dollars to a Russian company in exchange for some (anonymized) API calls.


As long as you still offer an easy way to highlight the button text.

Triple-click (at least in FF on Linux) highlights paragraphs or other block-elements contents; it should be allowed on things where a single-click does navigation. This would be very out of the way for normal users, but would allow easily and quickly highlighting (and copying) parts of the interface.


Yeah, that's about it. Personally, I'm not sure I'd get this much out of the picture, but you can see the information is there.

> surely it can't be just three iterations?

To save others a search: you stop when the remaining sub-arrays are sorted by definition (ie. [] or [x]/size of 0 or 1).


Also, to save any further puzzling: In practice the very fast sort you use, even if it is labelled "Quicksort" probably doesn't actually do this "all the way down" even though that's the strict algorithm.

They'll have a highly optimised small sort and use that whenever sorting very small things. So e.g. IPN Sort the Rust stdlib unstable sort will do this for 16 items, even though for a big slice it'd quick sort them by default, once it's down to say 10 items they're going to the specialised small sort.

Any serious "fast" sort in 2025 will be a hybrid, using several of these classic sorting algortihms, plus other insights to produce the overall best solution to their problem on modern hardware.


If I didn't know how quicksort works - and I had to learn, since for some reason in FP languages quicksort is typically next after "hello world" - I would struggle to make sense of the pictures, I think. However, it's absolutely brilliant as a memory refresher: it packs so much info in so little space that it's insanely efficient. I imagine it would pair well with a good textbook on algorithms.


> for some reason in FP languages quicksort is typically next after "hello world"

Because the recursive implementation is surprisingly straightforward and concise, and more-less demonstrates what the whole paradigm is about. As much as I hate to admit it, it's a good learning artifact.


It’s straightforward to a programmer. Who doesn’t need an ikea diagram in the first place.

This is why developer docs are trash. Because 90% of us can’t even identify when we are talking over everyone’s heads.


Am I alone in that I always felt like mergesort was easier to explain (and the O(n lg n) behaviour was easier to prove)?


Merge Sort is much easier to explain when you do the non-recursive version that's upside-down. Merge size 1 together, merge size 2 together, merge size 4 together, merge size 8 together, etc...


O(n lg n) is indeed hard to prove for quicksort, because it is not even true in the general case. Worst case is O(n^2).


> Because the recursive implementation is surprisingly straightforward and concise

It's also technically not quicksort


> since for some reason in FP languages quicksort is typically next after "hello world"

How does FP handle the random selection?


They use the first element. Like, it's random enough, right? :) (I mean, it still works, but goes badly for lists already sorted in reverse, etc.)


There's no problem with randomness in FP?

You could use a monad/external state for an OS-level RNG, or define a purely functional PRNG


It's usually quicksorting a linked list, where a random pivot, median of three, etc. are terrible for performance.

(Merge sort is of course the natural sort for lists, but qs is like 2 lines of Haskell so it gets demoed for being clever)


Just do the Sedgewick thing and take the median of the first, middle, and last elements.


Quicksort in FP?

Surely you mean mergesort, that's the classic FP sorting example.


quicksort, e.g. the haskell[0] example is quite well known. Problem is, it's not real since it doesn't work in place defeating the whole point.

[0] https://qnikst.github.io/posts/2020-10-18-quicksort.html


It really shines if you want a shortcut on a whiteboard interview, though.


Step six: draw the rest of the fucking owl.

Yeah this is lousy. This wouldn’t teach anyone anything.


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

Search: