HN user

rand_r

467 karma

Programmer, @ghedsouza on Github. Personal Blog: https://dsouzaman.net

Posts1
Comments140
View on HN

all viewpoints covered from you populace

This is the core of the issue. We don’t actually want all viewpoints represented because that wouldn’t by itself produce any value.

You want someone to come up with the fundamental theorems of Calculus, linking the area of a curve with its anti-derivative, because that’s incredibly useful. Generically grabbing everyone’s view isn’t a competitive strategy. You need to be selective on things that are intrinsically useful and promote that.

When I watch a movie, I don't care about the artist's life. I care about character life, that's very different.

It may seem like this, but up to now, you haven't been able to divorce a story from its creator because every story has an author, whether it's a novel like Harry Potter or a movie that has a writer and director. When you're experiencing the story, in the back of your mind, you always know that there is someone who created the story to tell you some kind of message. And so you can't experience something like a movie without trying to figure out what the actual message behind the movie was. It is always the implicit message behind the story that makes it valuable versus just the elements of the story.

The story has more weight because it is the distillation of somebody else's life and most likely, if it's a successful story or book, it is the most important lesson from that person's life and that's what makes it more valuable compared to the random generation of words from a computer.

The food analogy is that a cookie baked and given to you by a friend is going to taste far better than anything you buy in a store.

There is no difference between “def f(x={})” and “def f(x=dict())”, unless you have shadowed the dict builtin. They both have exactly the same subtle bug if you are mutating or return x later.

Race conditions are generally solved with algorithms, not the language. For example, defining a total ordering on locks and only acquiring locks in that order to prevent deadlock.

I guess there there are language features like co-routines/co-operative multi-tasking that make certain algorithms possible, but nothing about Java prevents implementing sound concurrency algorithms in general.

This is a great point. Life is tough because we are all competing in a game. Tweaking the rules of the game so that each basket is worth more points doesn’t make the game easier for any player.

From Henry George:

Now, to produce wealth, two things are required: labor and land. Therefore, the effect of labor-saving improvements will be to extend the demand for land. So the primary effect of labor-saving improvements is to increase the power of labor. But the secondary effect is to extend the margin of production. And the end result is to increase rent.

This shows that effects attributed to population are really due to technological progress. It also explains the otherwise perplexing fact that laborsaving machinery fails to benefit workers

I don’t know why they couldn’t do the friggen obvious move of asking the police to unblock the roads by force, and impounding the vehicles for repeat offences. Going after bank accounts was a coward move that never made sense. If I just sat down in the middle of a subway tunnel, I would be removed by force immediately, no matter what I was protesting. They created problems for themselves by not doing the obvious solution.

Blocking a road is a fire hazard and should never have been tolerated by local police for that reason alone. You cannot impede transit in a city.

never handled correctly

I’ve seen this argument, but if you look at real golang code and examples, it’s just a bunch of “if err <> nill” copy pasta on every line. It’s true that handling errors is painstaking, but nothing about golang makes that problem easier. It ends up being a manual, poor-man’s stack-trace with no real advantage over an automatically generated one like in Python.

Interesting! I wonder how this plays into AWS pricing. They charge a flat fate for MBps of IO. But I don’t know if they have a rule to round up to nearest 4K, or they actually charge you the IO amount from the storage implementation by tracking write volume on the drive itself, rather what you requested.

I know what you mean, and you’re probably right, but there’s a deeper problem, which is the overuse of adjectives and overall wordiness. It’s quite jarring because it reads like someone trying to impress rather than get an important message across.

Frankly, ChatGPT could have written this better with a simple “improve the style of this text” directive.

Example from the start:

MySQL v8.0 offered a compelling proposition with its promise of substantial performance enhancements.

That could have just been “MySQL v8.0 promised substantial performance improvements.”

This is sort of an aside, but a very interesting thing about Postgres is that it can efficiently combine independent column indexes together, so there is much less of a need, compared to older databases, to even create multi-column indexes. It's a feature from 8.1 called "Bitmap Scan". Basically, if you create an index on column X and an index on column Y, it can use them to do queries involving either or both columns pretty efficiently (for any number of columns).

It's not as fast as a multi-column index, but the savings of not having to worry about all the combinations of columns that can be queried together could well be worth it.

- https://www.postgresql.org/docs/release/8.1.0/

- https://www.postgresql.org/docs/current/indexes-bitmap-scans...

Swift 6 2 years ago

Something I’ve been curious about recently, is how did Linux get away with straight C for so long, considering how complex of a project it is. Did they end up reimplementing a bunch of C++ features?

Actually, regarding sophisticated projects, there’s quite some complicated projects that succeed without C++ power, like Postgres and Python.

It is true that DB compute is relatively expensive, but doing a join on the DB itself is obscenely more efficient vs doing it manually in a nested loop on an app server.

Also, the DB is generally a lot smarter than doing quadratic operations. The usual worst case is a Merge Join which involves sorting both tables first, to do an efficient join in nlogn time. It’s just not feasible to compete with the DB for efficiency without reimplementing a DB, which is pretty yikes.

See https://www.cybertec-postgresql.com/en/join-strategies-and-p...

Yes, exactly! We found out the hard way just how unreliable Redis-based locks are, and switched to Postgres locks. It works reliably since our code is already in a Postgres transaction.

Created a “lock” table with a single string key column, so you can “select key for update” on an arbitrary string key (similar UX to redis lock). I looked at advisory locks, but they don’t work when the lock key needs to be dynamically generated.

Well the 192 case would probably have an external IP + Port uniquely mapped to it in the router’s NAT table. I think you’re missing the larger point though. No one said IPs are exclusively used as GUIDs. Just that they are used as GUIDs, which they are in the majority of cases, and those GUIDs are re-assigned over time.

My Macbook Pro currently has unique IP + Port, associated with a single process listening to it over NAT and packets you send are routed to its network interface. Next week, someone else’s laptop could have that same IP + Port. That’s the main idea here, not these exceptions.

Because of NAT, it’s actually “IP + Port#” that is globally unique, and ultimately associated with a single physical network interface on a device (e.g an ethernet port on a PC).

There’s exceptions like broadcast IPs, but the point is that it is a system for uniquely locating devices and listening OS processes with IDs routinely shifting around.

It’s a free market because buying an iPhone is a choice. It happens to be an incredible product, so may not feel like a choice, but the experience was designed by one company and put into the market as an offering.

Apple has no control over your bank account and you have no control over Apple. You are both free to engage with each other or not.

I’m not a fan of the control, but this is the free market at work. Nothing stops you or any other company from creating a competing phone with its own app ecosystem. It’s really not for the government to dictate to companies how their products can work. It’s up to consumers to choose the products they want to use.

If done comprehensively, this strategy has the potential to be much better than a traditional stacktrace because you can embed local variables within each additional error context string.

The main problem with traditional stacktraces is that, while you get line numbers, local variables at every stack frame are not preserved. So unless the error is obvious like FileNotFound, you’re left guessing as to how the error happened.

While still being hella verbose and probably too much effort for most code, the upfront investment would obviate the need for adding debug print statements or dropping into a breakpoint to inspect the code after an exception.

That said, the post does feel like copium for the ridiculous verbosity in Go and re-inventing chained exceptions.

Creating a profitable car company is a crazy high bar though. Hasn’t been done for over a hundred years in the USA, and that too, with a new kind of engine and single-handedly making EVs viable through its supercharger network (all other options are literally ass in terms of reliability). So I can give him a break for some panel issues.

When you include SpaceX and Starlink, it’s pretty obvious he is successful beyond anything we’ve witnessed before, but people take his accomplishments for granted somehow.

Why No IPv6? 2 years ago

Amen, brother. Fact is, all critical limitations with IPv4 were hacked around by necessity, so the average user doesn’t care.

The main failure case is that it’s a painful or possibly impossible to setup your own public internet server from home, but ISPs are probably happy about that and games have figured out a work-around.

If IPv6 was a project at work, it would probably get killed as not a priority.

How would an index mess up another query? AFAIK indexes would only hurt write performance marginally per index, but most slow queries are read-only. I’ve tended to just add indexes as I go without thinking about it and haven’t run into issues, so genuinely curious.