• 0 Posts
  • 119 Comments
Joined 2 years ago
cake
Cake day: June 10th, 2023

help-circle
  • No. Alcohol is not mutagenic, the issues it causes in fetus are not DNA related. On the other hand smoking or other carcinogens definitely do affect DNA so they could “speed” evolution. Unfortunately any species advanced enough to smoke will also be advanced enough to be able to control the environment around them to a certain extent, so besides the one good trait getting develop you would also have dozens if not hundreds of bed ones that get preserved because the species is somewhat above natural selection.




  • First of all getting married is extremely cheap, just a small fee in most countries.

    A marriage is a legal document that brings many legal consequences, from tax to residency and even hospital and death care there are many reasons why that document might be important for you. If you’re going to spend the rest of your life with someone else, it makes a lot of sense to do it, it makes lots of stuff much easier.



  • Godot is objectively better as an engine, you might still prefer Unity for the amount of content you can pay to get, but if you’re doing everything yourself Godot is miles ahead of Unity. I always give this example because it’s so dumb but perfectly illustrates my point:

    If you’re writing a Single player game, you don’t care which controller pressed a button, otherwise if for some reason there are multiple controllers connected only one of them will provide input to the game. In Unity the way to deal with this is to make multiple mappings, e.g. Controller 1 button A means jump, Controller 2 button A means jump, etc, etc. Unreal has the same thing, Godot used to be the same, but a quick look at the code base and a couple of lines of code later and boom, Godot now has an Any Controller button A means jump mapping.

    This sort of thing makes Godot objectively better than Unity. There are other things too, but this one takes the cake for me.


  • Mixing up correlation with causation. A while back I was having a discussion here on Lemmy because people were saying pitbulls are dangerous and pointing to the disproportionate amount of deaths caused by pitbulls vs the percentage of dogs that are pitbulls. The argument goes something like this “Pitbulls are responsible for 55% of killings, but they’re only 12% of all dogs, therefore Pitbulls are dangerous”.

    Oh, and BTW if you agreed with that argument above, congratulations, you’re officially a racist, because those are the numbers of murder convictions and demographics for Black people in the USA. The argument is the same, and the reason why it’s flawed is the same: correlation does not imply causation. Just because there’s something seems disproportionate out of context doesn’t mean it has the most obvious cause, in both cases the reasons are much more complex and mostly have to do with education and opportunity (or lack thereof).




  • I was going to say VR, I almost never get motion sickness, never got motion sickness from reading on vehicles nor roller coasters. But the first time I put on a VR headset to play roller coaster simulator I almost threw up. Nowadays I can play Sairento doing backflips and wall running comfortably, but that first roller coaster simulation took me by surprise.


  • Yes, you can have a OnceLock<RWLock<T>> which is something that will get initialized at some point, and then you can acquire a lock on it for either read or write. To use it you need to check and handle both conditions, so it’s really secure.

    However if you’re writing a single threaded application a global let mut should also be safe, but Rust doesn’t know if your application is single-threaded, or even if it is, it might get imported by others that isn’t. So you’re forced to consider the safety of things that might not even be related to what you’re doing. Which was my point, if you’re writing a simple CLI single threaded app, the compiler blocking you from having a global variable seems pedantic and unnecessary, because it’s forcing you to deal with the edge case of your app becoming multi-threaded in the future.

    Don’t get me wrong, this is part of what makes Rust great, but it can be EXTREMELY pedantic.


  • You might want to take a look at C/C++ again at some point, you didn’t mentioned a single thing that I expected, I expected you to complain about memory allocation, double frees or stuff like that, instead you touched on lots of very accurate pain points for C/C++ that people who use it for years feel.

    • Preprocessor directives: I assume you mean macros like #ifdef _WIN32, macros will change the code before it gets compiled, so they allow you to write meta-code, as in code that writes code. Rust takes this to a whole new level, so you might want to understand the basic concept before looking into advanced Rust. That being said, I don’t think these are complicated in and of themselves, nor do I think you’re having problem with understanding what they mean, and it’s more likely a question of why, and the answer is that some stuff should happen at compile time, e.g. checking if you’re on Windows or Linux do define how you deal with paths or something. But the same can be extended to knowing if a given feature is enabled so you can compile only parts of the program. The lack of package manager is a pain, but C/C++ predate lots of those concepts, and there have been lots of attempts. Also if you’re using Linux your system already has a package manager so using some common standard like CMake for your projects makes it all “just work” (most of the time)… But yeah, this one is a pain, no question about it, and Rust solved it properly.
    • Essentially the compiler couldn’t find something, they shouldn’t appear randomly and that’s perhaps a VS bug, never used VS for C/C++ development so I’m not sure on that one, but whenever I had link errors I was forgetting an include or a library on my CMake.
    • What do you mean by errors? Compiler errors? You learn to read them with time, but yeah, Rust compiler errors are much nicer, although they can lead you into a rabbit hole by suggesting changes you shouldn’t use.
    • I do know that, it’s not intuitive if you’re thinking on a higher level, but if you think on low level stuff it makes absolute sense. I can’t think of why this would have caused you trouble needing debugging though, you could be occupying more memory than necessary, or you could be running into problems with unions, but I can’t think of why the order of a struct would make anything crash unless you’re naively converting between types by casting a pointer, which is a red flag on its own.
    • Well, C doesn’t need strings, what is a string? It’s just an array of characters. C tries to not impose anything on top of the very basics, so it makes sense it doesn’t have a string type, appending to a string or to an array of numbers is essentially the same, you just deal with strings more commonly. And this forces you to think on what you’re doing, e.g. my_str += "something" sounds like a very simple thing, but under the hood you’re allocating an entire new string, copying the content from my_str into it, appending something and then deleting the old one. C forces you to do that stuff manually so you have to be conscious of what you’re doing, string operations are not cheap, and you can gain a lot of performance by simply preallocating all you’ll need from the start. Rust is similar here, while they do have a String type, they make a very big difference between it and a slice of a string, so that makes you conscious of when you’re doing heap stuff.

    I spent years with C/C++ as my main language, and I can tell you that I would also not choose it for a random project. However I would also most likely not pick Rust either. Python is my go-to for “I need something quick”. Rust would be my go-to for “I need something robust”, or “I want to make sure this will work as intended”, it will mean a more tedious development cycle with a very slow iteration (much slower than C/C++, e.g. adding an enum value can mean lots of fixes on Rust, because most places where you’re dealing with that enum would fail to compile because you’re not taking the new value into consideration), but it will mean that every step will be solid (if it compiles after adding an enum value, I’m sure it’s being considered).

    Do learn Rust, it’s fun and personally I see a LOT of future in that language, but it also abstracts some of the concepts away while still requiring you to know them, e.g. heap/stack. I think learning C/C++ for the core concepts is better, but if you know those concepts Rust is a better language overall.


  • Yeah, that’s a good approach, learn it and it’s one more tool under the belt.

    That being said, I think you need to have some good level of proficient in C/C++ before lots of the Rust things make sense. I’m not sure what frustrated you about C/C++, and if you’d like to ask questions about that I’m happy to try to answer them. But a lot of concepts are the same just shown under a different light. For example, on C/C++ you chose to use stack or heap by declaring variables or allocating memory and storing it in pointers, in Rust you don’t allocate memory directly, instead you use types that store information on Heap, e.g. Box. I think that’s a lot less intuitive, and requires you to have a good grasp of heap/stack before it makes sense, but it prevents you from doing stupid stuff you might do accidentally on C/C++ like store a pointer to a stack object after it goes out of scope.

    But I might be wrong, it might be that for me all of that made sense because I knew C/C++ but that to you it will make sense regardless, and might even teach you those concepts that are useful on C/C++ too.


  • Let me start by saying I love Rust and think it’s great. I’ve been writing some personal stuff in Rust and it’s all that I’ve been looking for.

    However there is some stuff you said that makes me think Rust won’t be something you would fully appreciate Rust. Firstly every project, regardless of language, when it becomes big it becomes a hassle to maintain, especially if you’re not experienced enough to have set up a good architecture from the start.

    But more importantly, a lot of Rust benefits are stuff you didn’t mention, and some of the stuff you mentioned is not that important.

    • Speed: Performance gains will be minimal, most of the time your server takes on an API call is read/write disk/Network, and that takes as long as it takes regardless of language. Sure synthetic benchmark will tell you it’s twice the speed for a hello world, but the moment you start relying on outside stuff the line gets murky.
    • Less resources: Again, unless you have at least 10 instances of your service or are trying to get it to run in very minimal hardware conditions, you’re not likely to see any meaningful improvement. Sure your service now uses half the amount of RAM, but the hardware where you’re running it likely has a couple orders of magnitude more RAM than that anyways.
    • Garbage collection: You say that like it’s a bad word, but at the same time admit to have problems with C/C++, whose main differences are related to that.
    • Compilation: I don’t think you’re taking compilation into consideration, from line change to retest we’re talking a couple of minutes depending on the change. That can be annoying really fast, especially if you don’t understand the reason. Also, the Rust compiler is EXTREMELY pedantic, it will not let you compile stuff that you think should work because there’s an edge case that you’ve forgotten to consider because it’s not something you cared about, e.g. you can’t have global mutable variables because that can cause race conditions on multi-threading applications.
    • Security: you didn’t mention this but it’s one of the largest advantages of Rust, things like the Option or Result types as well as the match statements and the borrow checker are amazing and unmatched by anything else out there.
    • The Rust price: Rust is not free, you just pay beforehand, you win execution time at the expense of compiling time, you save on runtime errors at the expense of pedantic code checks, etc, etc. Rust is excellent if you understand why, and are willing to pay that price. Rust is for people who when the compiler says “you can’t do this because it will cause problems with X edge case” say “of course! Thanks!”, if you think “ugh, that’s never gonna happen, stupid compiler” then it’s not for you. To add to that, Rust can become quite complicated because of it.
    • A different way of structuring: Rust does not have classes or any OOP paradigms, it’s different from other stuff you’ve used and requires changes in how you structure your hada and application. Whether that’s for the best or not is very personal, but it’s definitely different.

    Finally I would like to finish up saying that Rust has the most excellent documentation: https://doc.rust-lang.org/book/ read that, then maybe do these https://github.com/rust-lang/rustlings if you get to the error types and are not drooling over the language, it might not be for you.



  • H is for High Performance, U is for Ultra-Low power usage. So if you want something for gaming choose an H if you want to have hours of battery life choose a U. Pretty simple and easy to st a glance see if s processor is what you’re looking for.

    The 7 is not repeated on Ryzen 7 9700X, otherwise you wouldn’t have stuff like the Ryzen 5 1600X. The first 7 (or the 5 in my other example) is the segment, i.e. towards which market it’s directed, Ryzen 3 are entry levels that you should consider for your grandma, Ryzen 9 are high power CPUs. Then the first number of the 4 digits is the generation, the second one is the how it stacks up to others in it’s series, the third and fourth are extra differentiation if needed, then there’s some letters for feature flags. So for example your Ryzen 7 9700X is a high-end 9th generation high clock/performance CPU, just by that name alone I can guess that it outperforms a Ryzen 7 9500X and possibly matches a Ryzen 9 7700X. If you learn to read those it makes it very easy to figure out if an upgrade is worth it just by the model number.

    USB naming convention is a mess, I’m not touching that.

    Also not sure about the pro, none of my phone’s ever were pro or even had a pro version so not sure.

    Sony is a bit weird, but WH-1000XM5 is a Wireless Headband (WH) 1000X is the model M5 is the generation, so those are newer than WH-1000XM4, and the next iteration of them will be called WH-1000XM6. The N is as you guessed noise canceling, the 1000X are top of the line so they have it too, no need to advertise it. I don’t know much about other products of them, but they do seem weird.

    Monitor names can be very helpful, for example Dell uses [Series][Diagonal][Year][Ratio or Resolution][Features] so just by looking at a short code, for example I’m not even sure this monitor exists but a U3224QWC is an ultrawide QHD 32 inches IPS with anti-glare monitor released in 2024 with a USB-C input. That being said https://www.reddit.com/r/funny/comments/j5pezf/computer_monitors/


  • I mean, yes, but there are ways around it. Windows could have a public key embebed somewhere and the private counterpart gives access, the command could depend on the time it’s received, so it’s never the same and without the private key it’s impossible to reproduce, and the Killswitch could be non-instantaneous, combine all of that and you have a Killswitch that:

    • It’s very hard for you to realize something happened, because by the time it happens the trigger is lost in a sea of other requests
    • Even if you were to fine comb through all of that and spot it, it’s encrypted
    • Even if you were to resend it it would do nothing, because the time has changed
    • Even if you managed to find the public key and decrypt it the actual content could be inocuos, like a random looking string
    • As long as the private key is secure enough it would be impossible to crack
    • Even if you somehow managed to crack it and send anything you want to the PC you don’t know the protocol to generate the random strings and you only have the one example of the message (which no longer works)
    • Even if several people did this the content could truly be random (in the common sense of the word, i.e. pseudo-random), since Microsoft controls the RNG on Windows they can use that to ensure that random data gets generated equally

    And I’m not even a cryptographer, people who come up with new encryption protocols can surely do a lot better than my naive example above which would make it almost impossible for someone to figure out.


  • I always find this so pedantic, yes, America is the continent but it’s also the name of the country, just like you probably say Argentina, Mexico or Brazil for the countries you mentioned instead of Argentinian Republic, United States of Mexico, or Federative Republic of Brazil. By that same token when you said United States I could have assumed you were talking about Mexico, heck until very recently in history Brazil was also named United States of Brazil so if I or you were old I could also asume Brazil. But I know what you meant by US and you know what he meant by America, stop being pedantic.



  • Maybe stop and listen to what I said, unless you have lived in very specific cities it’s almost assuredly I’ve had more risk to my life walking home in a week than you ever did in your entire life, having lived for a good chunk of my life in one of the most dangerous cities in the world.

    I’ve lived in places where you can get shot because you turned the wrong corner, places where you need to talk to people with machine guns to let you pass. Maybe you should unshove your head out of your own ass and see that other people also have problems, and alienating them is not going to make any friends. Unlike you I recognize the struggle that minorities face, I’m not looking only at myself and forgetting others exist and trying to pretend they don’t suffer. If your first response when someone says “I suffer” is “your suffering doesn’t matter because I suffer more” the person will reply (or at least think) “if you don’t care about my suffering, then I don’t care about yours”, and that’s not constructive, everyone suffers and everyone deserves to be treated equally.