Live data from Hacker News

Code is run more than read

olano.dev

151–160 of 325 posts

Re: Code is run more than read

#151
post #95

> I can’t make a Google search without getting back a pile of garbage. I think SEO / Spammer share lots of that guilt. Not sure how to attribute them correctly.

It's quite easy: Google giving better results than the minimum needed to make sure users don't switch is detrimental to its ads revenue.

If you look at how many people are working on search at Google, it's just a small part at this point, vast amount of people at Google work on different ways of monetizing it.

Re: Code is run more than read

#152
post #8

For many of us, running our code 1 billion times will cost less than a few minutes of a developer's time. Hell, I could spend $200 for a month of server time on AWS and run a lot of my (web API) code 100 billion times. Optimizing for human readers is always better until you're working on something that proves itself to be too slow to be economical anymore.

The problem with "costs less than developer's time" math is that, usually, it's not you who's paying . Your users are, often in nonobvious ways, such as through higher electricity bills, reduced lifespan[0], lost opportunities, increased frustration, and more frequent hardware upgrades. (And most of your users don't have developer's salary, or developer's quality of life, so it hurts them that many times more.) -- [0…

I've been calling the thinking of the parent "trickle-down devonomics": that by making the code better for the user, the benefits will trickle down to the users. Obviously, as the name suggests, that never happens. Devs get the quality of life and users end up paying for our disregard.

Re: Code is run more than read

#153
post #33

TIL of ≹, which "articulates a relationship where neither of the two compared entities is greater or lesser than the other, yet they aren't necessarily equal either. This nuanced distinction is essential in areas where there are different ways to compare entities that aren't strictly numerical." ( https://www.mathematics-monster.com/symbols/Neither-Greater-... )

That article is misinterpreting the meaning of the symbol. It isn't useful in mathematics because it is a contradiction in terms: if "neither of the two compared entities is greater or lesser than the other" then they are equal. The author of the original article uses it correctly - think about it more in regards to importance for their example. The business is no more or less important than the developer, but they a…

> It isn't useful in mathematics because it is a contradiction in terms: if "neither of the two compared entities is greater or lesser than the other" then they are equal.

That’s only true for a total order; there are many interesting orders that do not have this property.

It holds for the usual ordering on N, Z, Q and R, but it doesn’t hold for more general partially ordered sets.

In general one has to prove that an order is total, and this is frequently non-trivial: Cantor-Schröder-Bernstein can be seen as a proof that the cardinal numbers have a total order.

Re: Code is run more than read

#155
post #33

TIL of ≹, which "articulates a relationship where neither of the two compared entities is greater or lesser than the other, yet they aren't necessarily equal either. This nuanced distinction is essential in areas where there are different ways to compare entities that aren't strictly numerical." ( https://www.mathematics-monster.com/symbols/Neither-Greater-... )

That article is misinterpreting the meaning of the symbol. It isn't useful in mathematics because it is a contradiction in terms: if "neither of the two compared entities is greater or lesser than the other" then they are equal. The author of the original article uses it correctly - think about it more in regards to importance for their example. The business is no more or less important than the developer, but they a…

That’s only true for linearly ordered structures, but isn’t true for partially ordered ones.

For example, set inclusion. Two different sets can be neither greater than not smaller than each other. Sets ordered by inclusion form a partially ordered lattice.

Re: Code is run more than read

#156
post #103

Earlier quoted context omitted.

Reminds me of the concept of games in combinatorial game theory, they are a superset of surreal numbers (which are themselves a superset of the real numbers) in which the definition of the surreal numbers is loosened in a way which looses the property of they being totally ordered. This creates games (read weird numbers) which can be "confused with" or "fuzzy" with other numbers, the simplest example is * (star) whic…

Heres a relevant video on the topic: https://www.youtube.com/watch?v=ZYj4NkeGPdM I really love that video.

Exactly this video made me read more into this topic, I'm currently reading winning ways and lessons in play simultaneously. It's quite fun! I've just gotten started and am looking forward for what's left.

Re: Code is run more than read

#157
post #103

Earlier quoted context omitted.

Reminds me of the concept of games in combinatorial game theory, they are a superset of surreal numbers (which are themselves a superset of the real numbers) in which the definition of the surreal numbers is loosened in a way which looses the property of they being totally ordered. This creates games (read weird numbers) which can be "confused with" or "fuzzy" with other numbers, the simplest example is * (star) whic…

> By creating numbers from switches you can create even more interesting hot games. Well, don't leave us hanging! What are some of your favorite hot games on top of switches?

I'm just starting to learn about all this stuff, but iirc thr game of Go is famously "hot". Also I will emphasize thats when talking about "games", usually what is meant is a game position. What spe cific game you are playing isn't too important as it can be shown that some positions in different games are equivalent.

Re: Code is run more than read

#158

Earlier quoted context omitted.

That article is misinterpreting the meaning of the symbol. It isn't useful in mathematics because it is a contradiction in terms: if "neither of the two compared entities is greater or lesser than the other" then they are equal. The author of the original article uses it correctly - think about it more in regards to importance for their example. The business is no more or less important than the developer, but they a…

> It isn't useful in mathematics because it is a contradiction in terms: if "neither of the two compared entities is greater or lesser than the other" then they are equal. That’s only true for a total order ; there are many interesting orders that do not have this property. It holds for the usual ordering on N, Z, Q and R, but it doesn’t hold for more general partially ordered sets. In general one has to prove that a…

Example: alphabetic ordering in most languages with diacritics. For example, "ea" as far as the ordering function is concerned, but they are obviously also NOT the same glyph.

Re: Code is run more than read

#159
I'm not sure I've ever read an article where so many times I thought "ok fine, but ..." only to have the next paragraph address that exact point each and every time. The ending point especially.

As others here have pedantically pointed out (as HN is wont to do), there are ways to misinterpret or muddle some of the phrasing used here. But I think that's true of any reasonably simple (and therefore broadly useful) mental model. To me, this is a useful way of framing these ideas at a high level.

Re: Code is run more than read

#160
post #33

TIL of ≹, which "articulates a relationship where neither of the two compared entities is greater or lesser than the other, yet they aren't necessarily equal either. This nuanced distinction is essential in areas where there are different ways to compare entities that aren't strictly numerical." ( https://www.mathematics-monster.com/symbols/Neither-Greater-... )

I find this concept is important in understanding causal ordering for distributed systems, for example in the context of CRDTs. For events generated on a single device, you always have a complete ordering. But if you generate events on two separate devices while offline, you can't say one came before the other, and end up with a ≹ relationship between the two. Or put differently, the events are considered concurrent.

So you can end up with a sequence "d > b > a" and "d > c > a", but "c ≹ b".

Defining how tie-breaking for those cases are deterministically performed is a big part of the problem that CRDTs solve.

Post reply on HN