HNHacker News
TopNewBestAskShowJobs

Skeime

278 karma · joined August 23, 2018

submissionscomments
Skeime··on Why Python's integer division floors (2010)
I strongly disagree. I would estimate that in 90% of cases where I use modulo in languages that truncate (instead of flooring), I write (a % b + b) % b, or something similar, just to get the right behaviour. The exceptional cases are those where I can convince myself that negative numbers simply won't come up. (It's never because I actually want the other behaviour for negative numbers.)

- When using modulo to access an array cyclically. (You might get lucky that your language allows using negative numbers to index from the back. In that case, both conventions work.) - When lowering the resolution of integers. If you round to zero, you get strange artifacts around zero, because -b+1, ..., -1, 0, 1, ..., b-1 all go to zero when dividing by b. That's 2b-1 numbers. For every other integer k, there are only b numbers (namely bk, bk+1, ..., bk+b-1).

I have never seen a case where truncation was the right thing to do. (When dealing with integers. Floats are different, of course, but they are not what this is about.)

Skeime··on Shittier: Code formatting tool that makes your code look terrible
Why is the source code not formatted using the tool itself?
Skeime··on Things unexpectedly named after people (2020)
Um actually, neo is Greek as well. (Latin would be some form of nov-.)
Skeime··on Deciyear Calendar
I’m somewhat partial towards the centiday (roughly 15 minutes, 14m 24s to be precise).
Skeime··on Deciyear Calendar
My favorite part is that they designed a new calendar system where the months are named starting at one (Primilis, Secundilis, etc.) but numbered starting at 0. So Primilis is month 0, Secundilis is month 1, and Decilis is month 9. This somehow feels even worse than our current system where there’s a shift of 2 in the other direction for September to December.

They also claim that this is useful when dealing with quarters despite their number of month not being divisible by 4. (Admittedly, it works on the level of weeks.)

Skeime··on The Stroad
The only rational argument? Cars are also dangerous for their surroundings and their passengers. In addition, individual cars are an environmental disaster, in terms of noise, air pollution, climate, and use of natural resources. Finally, I believe (admittedly without having a source at hand) that not using a car is beneficial to one’s health because modern humans move their body way too little — biking or walking, even just to the next bus stop, are much better (but of course, this last part is ultimately a private decision).
Skeime··on World of Goo 2
Yes. “Purchase” of any “intellectual property” is essentially a marketing trick that we have come to accept. (Note that when you purchase my physical property, it is now your property. If you purchase my “intellectual property”, it’s almost certainly still my property, you just have some license to it. Which license precisely? Well, read this 50-page EULA.) The closest you can get is a DRM-free copy that you can back up yourself.

In this case, though, I assume that your original World of Goo would still work if you had kept it on your phone (and maybe prevented it from being updated automatically?). It’s “just” that it is no longer available for re-download.

Skeime··on The Stroad
Yeah, and there are absolutely no people with an agenda to make cars a necessity. I mean, who would that be? It would need to be a huge industry that makes its profit from selling cars to people. I can’t think of any such industry. /s

Sure, hyper-dense cities are not ideal, but neither are spread-out asphalt wastelands where cars are the only means of getting around. This is terrible for anyone who can’t drive (children, people with impaired vision, people who can’t afford cars). I have also lived in Houston (without a car) and I found getting around absolutely miserable. Even when I had friends pick me up with their cars, the distances were huge and a lot of the time, this would be because of parking lots creating gigantic empty space everywhere. (At least, this was my impression.)

Skeime··on The `hanging-punctuation property` in CSS
I’m pretty sure there is a setting in Word that allows you to turn off the automatic conversion of quotes. And I think that defaulting to performing the replacement is sane, as most people do just type “"” whenever they need any quotation mark and cases where “curly” quotation marks are appropriate are much more common than straight-quote cases outside of tech-related contexts.
Skeime··on Apostrophe Protection Society
Consistent with how language works. Words have partial overlaps and “subset” relations all the time.

In the case of less and fewer, there isn’t even really a problem, because there are very few cases where using less when fewer would (also) be appropriate leads to confusion. (Otherwise the same distinction would surely also exist for more.)

I’m afraid, the only real “problem” is that for people who are accustomed to the distinction, using the “wrong” one gives a nails-on-chalkboard sensation.

Skeime··on Apostrophe Protection Society
You said in your post that mass nouns are “inherently plural”, which grammatically they are not. I suppose you were referring to the meanings of those words, though.
Skeime··on Apostrophe Protection Society
Merriam-Webster, OED, Wiktionary. (If you have a preferred dictionary not on the list, I’m sure you can look there yourself.) All of them have some variant of “to pass through” as the primary meaning of to transit and “to change from one state, place, etc. to another” as the meaning of to transition.

And I didn’t claim that quest and question had a similar relation as transit and transition in meaning, only that in both cases, the two words have the same etymological root. I mentioned this in reference to your claim that my opinion was not supported by etymology. It doesn’t have to be, because etymology doesn’t dictate the current meaning of a word, it can just try to explain it.

Skeime··on Apostrophe Protection Society
But quest and question have the same etymology, just like transit and transition. Having the same etymology clearly does not mean that the words cannot diverge in meaning. And if you looked up transit and transition in a dictionary, you’d find that they’re considered distinct in meaning, much along the lines of what I wrote.
Skeime··on Apostrophe Protection Society
I disagree that to transit is the right verb form of transition in general. Transit (to my ear) is pretty much limited to a change of place, usually even through something (you might “transit a stretch of wood”, to steal Merriam-Webster’s example). Transition is more generally about a state of change.

By the same token, you could still reject to question because the verb to quest exists.

Skeime··on Apostrophe Protection Society
(1) is even more annoying in German where we use single quotes ‚like this‘ (i.e. a comma-looking opening quote and the English opening quote as the closing quote). Apostrophes are the same as in English, though.

Unfortunately, (almost?) all smart quote implementations default to replacing ' at the end of a word by a closing quote (even if no opening quote precedes it), so you get tons of apostrophes pointing in the wrong direction (looking like 6 instead of 9).

Skeime··on Apostrophe Protection Society
The problem with the example is: Some has used less where you would have preferred fewer. You answer with an example, where fewer is used but only less is generally considered grammatical. (In other words, the replacement goes in the opposite direction.) But it is perfectly consistent to say that fewer is restricted to countable nouns while less can be used universally.
Skeime··on Apostrophe Protection Society
I don’t understand what you mean here.
Skeime··on Apostrophe Protection Society
Because scissors is plural, which does not have an indefinite article. You can ask for scissors, like you can ask for documents. (And you cannot ask for a documents, only for a document.)
Skeime··on Apostrophe Protection Society
One nitpick: Grammatically, mass nouns are not (necessarily) plural. You’d say “Paper is made from wood.”, not “Paper are made from wood.” (Of course, the pair words like scissors are different, i.e. “My scissors are in my backpack.” (I also seem to recall that there are non-pair mass nouns that only exist in plural form, but I cannot think of any examples.)
Skeime··on Subtle ways Microsoft Word has changed how we use language
It also happens to be aligned with how other similar words are written (S-Bahn, U-Boot, …), so I think it was likely to become that anyway.
Skeime··on The world nearly adopted a calendar with 13 months of 28 days
The emperors are not at fault. They renamed months and didn’t insert new ones. It’s just that the beginning of the year changed from March to January at some point. (Hence the leap day at the end of February as well.)
Skeime··on Flexoki, an inky color scheme for prose and code
What’s the font used in those screenshots? It looks great!
Skeime··on XML is better than YAML – Hear me out
It does. However, it’s much more common to edit the end of a list, in my experience. Still, a syntax that is entirely uniform (like trailing commas) is preferable, in my opinion.
Skeime··on Visa, Mastercard Prepare to Raise Credit-Card Fees
From the context, I suspect they meant “And then it is fine if they offer a cash discount” (but you have to give the full price for non-cash customers as the default).
Skeime··on Python Type Hints – *args and **kwargs (2021)
Of course it’s an opinion. But in my experience, I almost exclusively have some sort of “template” with some parts to fill out, and string interpolation represents this better (in my opinion). This is especially true if the different parts to fill in are of different types.

As I wouldn’t use string concatenation for this purpose, it’s impossible for me to run into a situation where I wanted the concatenated string. (And even if I did, I would be glad for the reminder to change this into an f-string.)

And the bugs that it catches are of the form: I took some user input, expecting it to be a number, but forgot to convert it into one. Then I passed it to a function expecting a number, and it thankfully crashed instead of turning everything else into strings as well.

Maybe this is also a question that informs your view on this: Do you expect "abc" or 123 to be the “variable” part of that expression?

- If "abc" is a literal in the code with 123 coming from a variable, wanting 123 to turn into a string as well is somewhat unterstandable. - However, if 123 is the literal part of the code and "abc" the value of some variable, I would expect to mostly run into this in cases where I am actually doing some math and that the variable is a string just is some accidentally unparsed input.

In what I do, the second case would be more common.

Skeime··on Python Type Hints – *args and **kwargs (2021)
I strongly disagree. Not converting the int to a string automatically is absolutely the right decision. In all code I write, this TypeError would catch an actual error, because concatenation of strings is just not the right tool for creating "abc123" from "abc" and 123, so I would not use it for that. Hence, if this exception occurs, it indicates that I probably mixed up variables somewhere. Use one of the (admittedly too) many string formatting tools that Python offers, for example an f-string like f"abc{123}". (Also, if you have enough type annotations in your code, the type checker will warn you about these, so you can fix them before they hit testing or even production.)
Skeime··on Asphalt Wasteland: Maybe parking does explain the world
Oh, yeah, I was. While underground parking does certainly exist, it’s not all that common yet. (Again, quite a few old buildings and lots of smaller housing units …) I’m actually not sure how this would go down in an underground parking structure.
Skeime··on Asphalt Wasteland: Maybe parking does explain the world
Oh, and I forgot: If you want to put a big-ish new structure somewhere, you also need to get a building permit, which is work and will lead to questions about parking.
Skeime··on Asphalt Wasteland: Maybe parking does explain the world
That would be nice, but is often prevented by regulations. Essentially, the idea is that you might always get a car in the future (or move out and sell your home to a car owner), so the parking spot needs to be preserved for this possibility.

Now, depending on how strictly the rules are interpreted, this can mean that you need to provide an actual parking spot at all times even if you don’t own a car (and do not have to let anyone use it!), or you might be allowed use the parking spot for other purposes, provided your changes are easily reversible. (So planting trees or building a shed is off limits, but placing down potted plants and some seating might be fine – as judged by someone of your local authorities.) Having an actual garage might also be preferable as a non-car owner, as that can at least serve as dry storage space while still counting as a parking spot.

Last, the idea is still a bit inane. Japanese-style rules where you need to show that you have a parking spot when buying a car (instead of tying it all homes) would be much preferable in my book. But this is difficult, as there are still many places where streets are so old that cars did not yet exist when they were designed. (And the houses actually touch each other and the street, so there is no place where they could add parking.) These houses are usually exempt from needing to provide parking for their units. Doing it on a house-by-house basis instead of a car-owner-by-car-owner basis is just easier because of this.

Skeime··on NP-hard does not mean hard (2017)
“Not polynomial” is an easy trap to fall into (and one I have fallen into) but it’s really not correct. All polynomial-time problems are also NP problems (P=NP is about whether the converse is true, and if P=NP, all problems in NP are actually polynomial-time). So even if talking to a layman, saying that NP is non-polynomial is really missing the point of the question.
← PreviousPage 3 of 5Next →