arendjr

joined 1 year ago
[–] [email protected] 12 points 2 months ago (2 children)

I found the title of that section slightly triggering too, but the argument they lay down actually makes sense. Consistency helps you to achieve correctness in large codebases, because it means you don’t have to reinvent what is correct over and over in separate pockets of the codebase. Such pockets also make incremental improvements to the codebase harder and harder, so they do come back to bite you.

Your example of vendors doesn’t relate to that, because you don’t control your vendor’s code. But you do control your organisation’s.

[–] [email protected] 3 points 2 months ago* (last edited 2 months ago) (3 children)

Well, looking at your example, I think a good case can even be made for it.

“s23” doesn’t look like an HTTP status code, so including it can make total sense. After all, there’s plenty of reasons why you could want custom error codes that don’t really align with HTTP codes, and customised error messages are also a sensible use case for that.

Of course duplicating the actual HTTP status code in your body is just silly. And if you use custom error codes, it often still makes sense to use the closest matching HTTP status code in addition to it (so yeah, I agree the 200 in your example doesn’t make a lot of sense). But neither of those preclude good reasons for custom codes.

[–] [email protected] 1 points 3 months ago (1 children)

Oh, and then I pair it with a very boring Dell mouse for extra style.

[–] [email protected] 2 points 3 months ago (3 children)

Ha, I better not tell you about the Apple Keyboard I use with my Linux laptop then. Don’t like macOS much, but I love their flat keyboards.

[–] [email protected] 5 points 3 months ago

Another data structure that you can consider is the red green tree: https://willspeak.me/2021/11/24/red-green-syntax-trees-an-overview.html

We use it in Biome too, and it’s great for building trees that are immutable and yet still need frequent updates, as well as traversal in all directions. Its implementation contains quite a bit of unsafe to make it fast, though as a consumer you’re not really exposed to that.

[–] [email protected] 5 points 3 months ago (1 children)

There is a serious attempt for that actually: https://www.assemblyscript.org/

It doesn’t offer full compatibility with the regular TypeScript though, despite being very similar.

[–] [email protected] 10 points 3 months ago* (last edited 3 months ago)

In fairness, this also happens to me when I write the bash script myself 😂

[–] [email protected] 1 points 3 months ago

Thanks! I’d be happy to hear your thoughts.

[–] [email protected] 1 points 3 months ago (1 children)

Mostly the same reason why democracy worked for quite a while too. As long as people believe in a system and see the benefits to themselves as well, they can go quite a while with it.

In general I also think most people aren’t out to screw one another, no matter how much it may seem that way sometimes, so as long as that keeps for the monarchs in a majority of districts, the system could balance itself.

But yeah, I’m not going to say it’s perfect. Sooner or later it would collapse, and when it does my money would be on the same reason as yours.

So I think the main question is: would it be able to last longer than democracies can, especially in the face of mass media manipulation and other challenges. I can’t prove it, but I suspect it might have a decent shot, mostly because the monarchs would be more agile to respond against unforeseen threats.

[–] [email protected] 1 points 3 months ago

Pray tell, what does it tell?

[–] [email protected] 1 points 3 months ago (5 children)

Your proposal is just an idealistic version of early US.

Thanks, I guess :)

You claim that corruption is fundamentally impossible, but assume that magically “the monarchs aren’t allowed to own property” without regard to enforcement.

I make no such claim, and I don't make assumptions regarding enforcement either. Constitutional enforcement is discussed in quite some detail.

You claim to have an alternative to democracy but still propose majority voting on replacing rulers and constitutions.

There is majority voting on deposal of rulers, to be specific. Their replacement isn't voted on by a majority of the population.

Constitutional changes are voted on through majority, but first require a majority of the monarchs to be on board.

Both these limitations are intentionally designed to mitigate manipulation of the population.

You simply assume that monarchs will keep each other in check and not devolve into the conspiring, warmongering tyrants that history is full of.

There is quite some detail about the enforcement mechanisms. The idea is very much not to assume, but to persuade the monarchs to act in a benevolent manner, by enticement through both the carrot (wealth for as long as they rule), but also the stick (deposal if the majority doesn't vote in favour of their actions, with a threat of assassination if they refuse to be deposed).

Power can always be abused to get more power and go against all your original ideals. The only way to definitely prevent corruption is to ensure power is never concentrated in the hands of few.

Ah. So it wasn't me that claimed that corruption is fundamentally impossible, it's you that claim to have the definitive answer.

For what it's worth, I agree power shouldn't be concentrated in the few. Which is why I split power across districts, and between citizens and monarchs, and why the group of monarchs for each district cannot be too small either. It's all there if you could try to be a little less dismissive.

[–] [email protected] 0 points 3 months ago

:D

From your other responses I can see you're being sarcastic, but yeah, seems that many won't read any further after seeing the word monarchy :shrug:

244
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Slide with text: “Rust teams at Google are as productive as ones using Go, and more than twice as productive as teams using C++.”

In small print it says the data is collected over 2022 and 2023.

 
 

I have a fun one, where the compiler says I have an unused lifetime parameter, except it's clearly used. It feels almost like a compiler error, though I'm probably overlooking something? Who can see the mistake?

main.rs

trait Context<'a> {
    fn name(&'a self) -> &'a str;
}

type Func<'a, C: Context<'a>> = dyn Fn(C);

pub struct BuiltInFunction<'a, C: Context<'a>> {
    pub(crate) func: Box<Func<'a, C>>,
}
error[E0392]: parameter `'a` is never used
 --> src/main.rs:7:28
  |
7 | pub struct BuiltInFunction<'a, C: Context<'a>> {
  |                            ^^ unused parameter
  |
  = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`

For more information about this error, try `rustc --explain E0392`.
error: could not compile `lifetime-test` (bin "lifetime-test") due to 1 previous error
 

Today I'm sharing a little trick that I like to use to make switch statements cleaner and more type-safe. Happy to hear other ideas!

 

As part of my Sudoku Pi project, I’ve been experimenting with improving the Bevy UI experience. I’ve collected most of my thoughts on this topic in this post.

 

I wrote a post about how our Operational Transfomation (OT) algorithm works at Fiberplane. OT is an algorithm that enables real-time collaboration, and I also built and designed our implementation. So if you have any questions, I'd be happy to answer them!

view more: ‹ prev next ›