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


I haven't laughed like this all year. Great reply!

This is the kind of snark I come to HN to see

1-based indexing is great. It's just _different_ - from C, where the array index is just sugar for pointer arithmetic, and from other languages which borrowed the practice without reasoning.

There are arguments for why 0-based indexing is _better_, unrelated to pointer arithmetic. https://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831...

> we had better regard β€”after all those centuries!β€” zero as a most natural number

Of course, a counter argument is that we've already made the mistake of indexing with 1 in natural language (first, second, ...). That decision is not free of annoyances, though: the 19th century are year numbers 18xx, floors below the first have a varying names when they could have been negative numbers, etc.


That EWD is one if my pet peeves. Dijkstra makes an unfair comparison because he lists plenty of examples where 0-based indexing is more convenient but ignores the equally numerous situations where 1-based is more convenient. For example, iterating backwards over an array is much better in an 1-based world.

I like the argument that 1-based is better for indexing and 0-based is better for offsets: https://hisham.hm/2021/01/18/again-on-0-based-vs-1-based-ind...


To be honest, I actually agree that Dijkstra's argument seem a bit one sided. It's also interesting to see the argument in your linked article that offset and index doesn't have to be the same.

If I get the root of the argument in the linked article, it is that zero-based indexing is more of a optimization than anything, but I would disagree; there are reasons beyond that (see the examples in my previous comment).

Also, here's an example of an 1-index based system that has caused me some headaches: In music theory, the first note of the scale is called the "first", etc. It also talks about e.g. "stacking thirds", which means take the third of the scale, than take the third from there. However, the offsets are two. (first=offset 0, second=offset 1, third=offset 2). Which is hard to work with in my opinion.

You have an interesting argument about iterating backwards, although I would say; if we need a tie-breaker between the two, iterating forward should have more weight than backwards.

I appreciate your comment, and while trying as best I can to be convinced of the "other side", I still land on 0-indexing. The only argument I buy, is that it matches our natural language starting at 1. Which, of course, is a strong argument.


The reasoning is to be consistent with C and it's more than enough reasoning for me. I don't know if 1-based indexing is fundamentally better. However, I know the probability that I will need to use other languages in the future is 100%, and they'll use 0-based index.

It's like right-click-to-select.


I cannot fathom why anyone would use a code freeze. Just create a branch at the commit you want to "freeze" and let dev teams keep working with their regular branches.

A code freeze is often a bad attempt at β€œfixing” a problem that should be resolved by feature freeze, controlled rollouts, and better testing.

"The hardest part of learning any creative skill is that your taste develops faster than your ability."

I needed to read this sentence. Thank you!



Nope, its a well-researched article which shows its sources and qualifies its conclusions. You may not like the conclusions, but that doesn't make it FUD.

Same. I've managed to convince exactly one person how great password managers are; the others just let Chrome handle it. (It's always Chrome.)

Thanks for the correct link! AST-based version control sounds like a great idea.


Darcs did this decades ago with the "replace" command. It's not a legitimate semantic replacement, though - it's more just telling your VCS to do a find/replace.


As far as I remember, that's just because only the find/replace was implemented, and it could have more sophisticated (semantic?) features.


The behaviors of NFT advocates and AI advocates are shockingly similar.

Remember how NFTs were supposed to be the future or art ownership, and all it amounted to was awful pictures of bored apes and ahegao lamas? The NFT bros proudly displayed their shitty art - not because it was good, but because it signaled their allegiance.

Now go on to any pro-AI blog. Look at the images. They've stopped trying to edit out the AI errors - they proudly display images with garbled text and bad anatomy. Just like before, it signals allegiance to AI consumption.

Even the last sentence of your post is the same sentiment as "have fun staying poor" was for the crypto bros.


> The behaviors of NFT advocates and AI advocates are shockingly similar.

It’s the same people every time. Stupid, gullible idiots.

Remember when HN was obsessed with the room temp superconductivity fraud a few years back? Remember the zealous indignation at anyone suggest skepticism? The empty attempts to downplay their rabid stupidity afterwards?


I wish I remembered the source of this quote: "If you didn't take the time to write it, I'm not taking the time to read it." This saved me from reading the story.


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

Search: