

Already tried that. We hoped that by buying massive amounts of Russian oil and gas they would see that peace is worth a lot more than war.
But they decided war anyways. And suddenly we had to find a replacement for all that energy.


Already tried that. We hoped that by buying massive amounts of Russian oil and gas they would see that peace is worth a lot more than war.
But they decided war anyways. And suddenly we had to find a replacement for all that energy.
The newest windows terminal is called “terminal”.
I used to type “cwd”, but after installing terminal, I type “terminal”. Probably same situation for OP.
My comment explicitly avoids the “standard” problem.
A user could have many "theming system"s installed at once, while only having 1 DE. The user ideally would configure only one, and some program should try to translate that system into the other ones.
Then each app will fetch the list of theming systems the user has installed, and choose whichever the app prefers. And if there’s no match, fall back to a default hard coded theme.


I see you ignored my entire comment.
I don’t know what is more explicit about expect. Unwrap is as explicit as it gets without directly calling panic!, it’s only 1 abstraction level away. It’s literally the same as expect, but without a string argument. It’s probably top 10 functions most commonly used in rust, every rust programmer knows what unwrap does.
Any code reviewer should be able to see that unwrap and flag it as a potential issue. It’s not a weird function with an obscure panic side effect. It can only do 2 things: panic or not panic, it can be implemented in a single line. 3 lines if the panic! Is on a different line to the if statement.


An unhanded error will always result on a panic (or a halt I guess). You cannot continue the execution of the program without handling an error (remember, just ignoring it is a form of handling). You either handle the error and continue execution, or you don’t and stop execution.
A panic is very far from a segfault. In apparent result, it is the same. However, a panic is a controlled stopping of the program’s execution. A segfault is a forced execution stop by the OS.
But the OS can only know that it has to segfault if a program accesses memory outside its control.
If the program accesses memory that it’s under it’s control, but is outside bounds, then the program will not stop the execution, and this is way worse.
EDIT: As you said, it’s also an important difference that a panic will just stop the thread, not the entire process.


Replace uncaught exception for unhanded error.


“unwrap should not exist” is true as long as you don’t want to ever use the language. If you actually want to use it, you need it. At least while developing.
Some values cannot have a default value. And some cases it’s preferable to panic even if it has a default value.
unwrap is not the problem. Cloudflare’s usage is.


It’s really hard to do without Rc (or similar) or unsafe.


I’ve read a lot of people saying “oh what a horror, they used unwrap in production, they should NEVER do that”. But I don’t think that’s true at all.
That being said, this was clearly a case where ? should have been used, since the function has a clear error case. And it also is a critical application that can’t afford panicking as an error handling method.
EDIT:
Just to clarify, the way you would do this is by having a type Features that can error on creation/parsing which has a limit of 200 entries. And afterwards you can just use that type knowing that it will always have <= 200 entries. And you gracefully handle that one error case on creation/parsing.
EDIT2: Another point for why I disagree with “production should never have unwrap”:
assert(my_variable.is_some). I don’t know a single person that would say “you should never have asserts in production code”, the only reason I disable some assertions for release builds is for performance. Asserts are statements that should never do anything, by that logic they pose no harm by being there, so no need to remove them, their only effect should be wasting a few CPU cycles. Since asserts are only put when the programmer assures that a certain precondition will always be met. And if it is not, it’s because the code changes and automatic tests should catch that.

Based on the responses (i haven’t watch the video), hu just revered according to Unicode codepoints (chars). Therefore this should do the same.
Of course chars() hides the complexity, that’s what makes it easy.


In fact it is easy in rust. Might not be the most performance (or maybe it is), but you should be able to do just “my_str”.chars().rev().collect::<String>()


It’s not one thing or the other.
For example I often end up using event loops. Where an event is a tagged union. Some events take up 1 byte, some 400. It’s almost effortless to put the big variants in the heap, and just keep a pointer in the union. So why not do it from the start.
Sure, optimizing every loop to make it vectorizable is probably not worth it, since that loop you wrote on the 10th commit might not even exist when the software is released. But there are many low hanging fruit.
Also, some optimizations require a very specific software architecture. Turning all your arrays of structs into structs of arrays may be a pain if you didn’t plan for making that switch.


If what you want is low level, I recommend wgpu. And you can go even lower level of you go for wgpu-core instead.
However, when you go this low level, making a game is not the objective, since it would be incredibly tedious compared to using an actual game engine. I had a lot of fun doing small things with wgpu though. Learned a lot too.
I don’t understand why any user would have to care or even know what GUI toolkit an app uses.
I don’t know why the burden is put on the user/DE. You shouldn’t have to care about what GUI toolkit your DE uses either.
DE and themes should be decoupled from eachother. So the user can install whatever “theming system” they want, and GUI toolkits should aim to support as many theming systems as practical.
GUI toolkits are implementation details, the user doesn’t care about implementation, it cares about what it sees. And what it sees is the colors and icons.


In my opinion, this question makes no sense so it belongs nowhere.
But for it to be on topic, it would need to go in a general technology or OS community.


Data storage devices are the last items you wanna buy second hand though. A drive failing could mean much more than just having to buy a new one.


I hope this is satire. But I can’t be certain if it is.


No it is not. This has nothing to do with programming.
Programming is writing in a programming language so the computer can execute it.
This post mentions no programming language, nor any set of programming languages. It isn’t either something that applies to all languages.
In short, it has nothing to do with programming


Maybe they changed the defaults. I stopped using GitHub after they trained their AI over private repos.
But I remember clearly that I was annoyed when looking at my own repos because my forks (for actually doing PRs) would show at the top instead of my own repos.
My M turned upside down. I’m leaving it like this