Yo whatup

  • 0 Posts
  • 174 Comments
Joined 2 years ago
cake
Cake day: September 28th, 2023

help-circle
  • Douno off the top of my head. To take a wild guess they might just wrap a file handle and give it s nice api? If that’s what they do then moving from the file zeros out he handle for basically the same reason smart pointers set their internal pointer to nullptr, so they don’t delete it (or close the file in this case) underneath the new object.


  • Depends on the object what happens when they are moved from. Some objects are put into a valid moved from state (usually depends on if doing so is free or required anyway. For example to satisfy the invariant of the moved to unique pointer the moved from pointer needs to be set to nullptr in order to prevent the moved tos unique pointer being deleted from underneath it)








  • JavaScript doesn’t have typed parameters or variables. The function expects a string and does things in the function body which converts the object into a string. JS shares this behavior with all dynamically typed languages and it’s extremely useful in some contexts and extremely frustrating in others. It’s down to what it’s being used for. Dynamic languages make excellent scripting languages, see Python really just being a souped up shell lang






  • What ramdon ass language could they possibly be pulling out of their ass for you to he completely unable to write a for loop? I’ve yet to see a for loop, or really any sort of loop that doesn’t look pretty much exactly like the standard C style for loop

    for(int x = 0; x < z; x++) {
    }
    

    If you have a C style language with iterator for loops like C++, Java and friends you almost certainly have this syntax

    for(int x : numbers) {
    }
    

    Python has exclusively iterator for loops with this syntax

    for x in range(z)
    

    The only real difference is that instead of a colon : you use the in token.

    At best I can see the need for a quick refresh on what the exact syntax is but if your a senior any languages you actually use should have a template for junk like this. I don’t think I’ve manually written a loop in ages, I just type out iter for an iterator for loop or when I rarely need an index fori and the rest gets stamped out for me.

    If your being tested on random languages you can simply just not be familiar with a language. I haven’t touched Zig once but I’d totally be down to learn it. Everybody whos got a couple languages under their belt knows how easy it is to pick up new ones.







  • Bro that’s crazy has it crossed your mind that I don’t want to be rich? Put me in that position and I’d be paying for ads and shit to get the government to tax people like me more.

    Your not gonna catch me on any of that “Oh so you think wealthy people shouldn’t exist” bs either btw. In a vacuum I think people should be able to make a lot of money from stuff they do but billionaires shouldn’t exist full stop. The amount of good you can do with merely one billion dollars is genuinely kind of inconceivable and we have multiple multi-billionaires, and not anywhere close to enough good being done by them. They simply shouldn’t exist. They’ll be just as happy being multimillionaires though I’d quite like taxes to dramatically ramp up once your in the 10 millions, even that is far above where middle class is meant to be.