• 3 Posts
  • 208 Comments
Joined 2 years ago
cake
Cake day: June 18th, 2023

help-circle
  • Similarly, what would you gain by saying uint32_t const* x = my_var.get<uint32_t>();

    To be frank: You gain the information that MyConcreteType::get<uint32_t> returns a uint32_t, which I otherwise couldn’t infer from the docs. Of course, I could assume it, based on the template parameter, but I don’t want to go around assuming a bunch of stuff in order to read docs.

    Take an example like auto x = my_var.to_reduced_form(), it’s very clear that x is the “reduced form” of my_var, which could be meaningful in itself, but what type is it? I need to know that if I want to do anything with x. Can I do x += 1? If I do, will that modify my_var? Let’s say I want to make a vector of whatever to_reduced_form returns… and so on.

    All these questions are very easily answered by MyConcreteType x = my_var.to_reduced_form(). Now I immediately know that everything I can do with my_var, I can also do with x. This makes me happy, because I need to do less digging, and the code becomes clearer to read.


  • Thanks, that was a good read :)

    However, my impression is that he’s largely using the existence of templates and polymorphism as arguments that “we don’t really care about type”. I disagree: A template is essentially a generic type description that says something about what types are acceptable. When working with something polymorphic, I’ll prefer ParentClass&, to indicate what kind of interface I’m working with.

    Sure, it can be very useful to hide exact type information in order to generalise the code, but I think that’s a weak argument for hiding all type information by default, which is what auto does.


  • I really like C++ (I know, shoot me), and I think auto should be avoided at (almost) all costs.

    One of the things I love about a language like C++ is that I can take one glance at the code and immediately know what types I’m working with. auto takes that away while adding almost no benefit outside of a little convenience while writing.

    If I’m working with some very big template type that I don’t want to write out, 99/100 times I’ll just have a using somewhere to make it more concise. Hell, I’ll have using vectord = std::vector<double> if I’m using a lot of them, because I think it makes the code more readable. Just don’t throw auto at me.

    Of course, the worst thing ever (which I’ve seen far too often) is the use of auto in examples in documentation. Fucking hell! I’m reading the docs because I don’t know the library well! When you first bother to write examples, at least let me know the return type without needing to dig through your source code!







  • Exactly this. The whole premise of the tax system is based around the historically correct idea that you need to physically move goods in order to sell them, or physically be somewhere to sell services.

    Companies like google are making buckets of money all over the world, and don’t need to tax a dime most places, because they have no physical presence there. This makes it pretty much impossible to compete with the international behemoths, because they have access to a munch of tax-free revenue, while a startup will typically be centred around wherever they’re based, where they also need to pay taxes.



  • I never said the kicking and screaming would have been successful. I’m just trying to explain why I think so many people went quietly, and pointing out that most people, when faced with the prospect that their entire family, all their friends, and they themselves face imminent death if they do nothing will tend to do something, regardless of whether it’s likely to succeed.


  • Of course, historically people “could have imagined”. I’m talking about seeing this through the eyes of a civilian that is brought off a train wagon and told they are being put in a labour camp. In that situation, I think very few people have it in them to imagine that their captors are organising the largest and most industrialised mass murder in history, and that they won’t even make it out of the “showers” alive.

    I don’t expect them to launch a revolt, but with prisoners outnumbering guards 100:1, I don’t think so many would have walked to their execution in orderly files. I think there would have been a lot more kicking and screaming involved if they knew what was coming. Remember that these weren’t strangers either: We’re talking about whole families and all their friends sitting calmly together on the train and walking willingly into the gas chambers. That only happens if people are lured into thinking this is something other than it is.


  • If I remember my history correctly, a major point of the gas chambers was that the prisoners were convinced that they had been sent to a labour camp, and were sent into the chambers to shower. By convincing people that they weren’t in immediate life threatening danger, it was much easier to control them.

    Of course, nobody could even imagine the absolute horror of the Holocaust. If you told me that someone would take hundreds of thousands (millions) of fit, working age people and simply wipe them out, I would have a much easier time believing the other guy that said “no, you’re being sent to take a shower before being placed in a labour camp. Life will be hard, but obviously we wouldn’t waste resources just killing everyone on the spot.”


  • I thought part of the premise is that this technology is so far beyond our comprehension that we couldn’t even begin to contemplate replicating it.

    Imagine gifting a modern jet aircraft to the Roman Empire, a nuclear reactor to the Egyptian empire, or a modern computer to a caveman: How much do you think that would speed up the development of said technology? My guess is: Not a lot, if at all. The tech is so far beyond what they had in the era, and there are so many intertwined developments in science and engineering needed to replicate it, that it might as well be magic to them.

    Even for the Romans to replicate a jet, they would first need to make around 2000 years of progress is fuel refining and metallurgy. Not to mention that they would need to understand fluid dynamics and thermodynamics that weren’t developed until the 1800’s. This again relies on mathematics that weren’t developed until the 1600’s-1700’s.

    Now imagine this “perpetual 1 W source” relies on stuff we won’t develop for the next 20 000 years. We wouldn’t even know where to start if we were to replicate it.




  • That completely depends on what you’re doing. If you’re doing tasks that python can completely offload to some highly optimised library written in C/C++/Fortran, then yes. However at that point you’re not really comparing Python to C anymore, but rather your C implementation to whatever library you used.

    A fair comparison is to compare pure python to pure C, in which case you need to mess up the C-code pretty bad if Python is to stand a chance.


  • thebestaquaman@lemmy.worldtoxkcd@lemmy.worldxkcd #3124: Grounded
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    1 month ago

    Do you have a source for this? My only reference here is hiking at > 10 000 ft (3000 m), and from that I can say that this seems very unlikely: If you stay at 3000 for a couple hours without acclimating first, you will definitely start to feel the effects. To be fair, you’re usually not moving around a lot in an aircraft, but a couple hours at 3000 m can make you feel sluggish and weak, and even a bit light-headed, you could even get a mild headache from oxygen deprivation.

    Note that not everyone will see severe symptoms already at 3000 m. Plenty of people can go to 4000 m before seeing significant symptoms. However, given that I’ve never heard of anyone experiencing altitude sickness in a properly pressurised aircraft, it seems unlikely to me that they’re pressurised to 3000 m.


  • I had fantasies about women initiating affection, taking active roles during intimacy, and expressing a primal hunger to take the reins

    In my personal experience, this is pretty much the norm. Women can have just as much sex drive as men, and can express it just as “aggressively”. In every relationship I’ve had, there are times where I’ll initiate, times where she’ll initiate, and times where we’ll both look at each other with a “Yes. Right now.” look. Note that I’ve never been into any BDSM or other “exciting” kink stuff, I’m just talking about initiative and passionately expressing that “I want you” feeling.

    Of course, this is a side of women you won’t see until you get with someone that both wants you and feels comfortable enough you to express it.

    So long story short: What you’re looking for is pretty much the norm as far as I can tell.