• 0 Posts
  • 1.72K Comments
Joined 3 years ago
cake
Cake day: June 21st, 2023

help-circle

  • I was able to turn the string into a char iterator, but I could not figure out how to change elements of said iterator (this can be seen at line 55).

    You have a few options here, but the easiest is to collect into a Vec<char>, replace the character there, then do a String::from_iter(chars) to get it back as a string.

    You can also manipulate the original chars iterator directly through takes, skips, and so on and collect it into a string, but that’s more complicated.

    Also, “character” is such a complicated concept because unicode is not simple. If you can work directly with bytes though, you can convert the string to a Vec<u8> (which is the underlying type for String), manipulate that directly, then do String::from_utf8 (or the same method for str) to convert it back to a string.


  • What happens when you import an library written in another language, and one of the functions is a reserved keyword in your language?

    This is already possible in Rust. You can import libraries written with different editions, and there are different reserved keywords across editions.

    The compiler just looks at what language the library was written in and switches internally based on that.

    In my C and C++ example, you’d pass different flags for that library during build time, although I’m not sure how this would work for header-only libraries.

    Edit: I see your reserved keywords example is an issue, and I raise you raw identifiers (r#if in Rust, @if in C#, etc)

    How would collaboration between people with different native languages work?

    Same way it currently does? It’s not like everyone who writes code knows English, but somehow they can all write it despite the keywords being in English.

    Who makes sure all language variant have equally good educational resources?

    The community around that programming language would be responsible for this, would it not? This is already a thing people do, though it’s impossible to translate all educational resources that exist into all languages. Fortunately we have services that can translate things for us though.

    There’s a reason why lingua francas change over time but always exist, and forgetting that will do more harm than good.

    It would do no harm here. People already write code in many languages. In most popular programming languages, you can already name things in Korean, French, Russian, and so on. Documentation for the languages exist already in all those languages. There is literally only one thing that would change: the keywords. It’s really not that complicated.


  • This might seem like an obvious question, but wouldn’t it be more effective for the README to be in Korean? Not that having it in English too is a bad thing, but people interested in a language with Korean keywords probably can read Korean more comfortably than English (if they can read English at all).

    Anyway, I don’t really see why PLs that support UTF-8 idents can’t just reserve multiple aliases in different languages for their keywords. Rust is mentioned here, so I’ll use that as an example, but Rust could just add a language field to Cargo.toml next to edition that defaults to English (which is what Rust currently uses), and that wouldn’t even need a new edition as far as I’m aware. C# could do a field in the csproj file, C and C++ can use compiler flags, and so on.



  • Adblocking is piracy, yet AMP, ChatGPT/AI overviews/etc, archival, and so on are perfectly okay, right? (Archival stands out here as being not a shitty thing to do but is still rehosting without serving paying ads)

    It’s only stealing when it inconveniences these creators. They seem perfectly content with what Google’s doing, though.

    Flipping it around, if the creators want more money, they need to solve that problem themselves. Charge money for some (or all) content if you need it. Sell merch. Find creative ways to showcase sponsored products that actually serve as valuable content. Being lazy and turning on ads or showing the same sponsor segment you’ve used dozens of times already isn’t going to do anything but annoy people.






  • I’m left wondering what the profession is turning into for other people.

    All the code I review looks good at first glance and makes shit up as it goes once you read into it more. We use two different HTTP libraries - one sync, one async - in our asynchronous codebase. There’s a directory full of unreadable, obsolete markdown files that are essentially used as state. Most of my coworkers don’t know what their own code does. The project barely works. There’s tons of dead code, including dead broken code. There are barely any tests. Some tests assert true with extra steps. Documentation is full of obsolete implementation details and pointers to files that no longer exist. The README has a list of all the files in the repo at the top of it for some reason.

    I will admit that I’m more in the naysayers camp, but perhaps that’s from a fear of losing my livelihood?

    People are being laid off because of poor management and a shitty economy. No software devs are losing their jobs because AI replaced them. CEOs are just lying about that because it’s convenient. If software devs truly were more effective with these tools, you’d hire more.

    Am I predisposed to see how these tools are lacking? Have I not given them a fair chance?

    That’s up to you to decide. Try using them if you want. But don’t force yourself to become obsessed with them. If you find yourself more productive, then that’s that. If not, then you don’t. It’s just a tool, albeit a fallible one.


  • people are often nasty when others ask questions they assume to be stupid.

    It sounds to me like you might want to reevaluate the communities you’re in. This sounds incredibly toxic.

    And I agree, for simple questions, it can be helpful. I would caution against overreliance on the answers though. Even the best models available today hallucinate regularly. Always verify answers when they are important.

    Also, learning to read documentation directly is a valuable skill to develop. Even if you don’t rely on the documentation directly, reading a lot of it will make it easier to write documentation as well.


  • I think the post (well, this translation anyway) is best read as a fantasy rather than associated with reality. It’s predicated on a lot of assumptions, including the assumption that AI has the ability to develop large software almost entirely autonomously, that large brands have no means to lock users within an ecosystem, that people will be able to articulate exactly the software they need and how it should be designed, and so on.

    The future being described by this post is the elimination of all roles of software and product development, spanning from developers to designers to even product managers.

    As a thought experiment, it’s interesting. It shouldn’t be confused as reality, though.




  • Is this even a surprise? Giving away free access to Copilot hemorrhages money and only exists to convert those users into paying customers. It costs them nothing to take away some features from these users.

    The only real ways to prevent this are local hosting (which is much more realistic these days) or an explicit contract stating that the features you want will remain for the duration of the contract. The latter is not an option with GH Copilot, as far as I’m aware, and is basically nonexistent with any modern services.


  • Edit: Hey everyone, you can disregard the above comment by TehPers, because they clarified that they actually aren’t claiming booster packs are illegal:

    If you are only arguing about what is or isn’t legal, then you’re wasting your time. I’m not a lawyer, nor in a position to rule on laws. I don’t know if something gave you the impression otherwise.

    ;P

    Thank you for clarifying to all of us that you do not comment in good faith. It makes it much easier for me to know which people to block.


  • And yet are not “gambling” as the colloquial understanding of the regulated activity stand, nor certainly things that people want to be covered under gambling regulations.

    I didn’t say they were gambling, though trading shares is often associated with gambling. But in all of those examples, you receive something with value that changes in a way that is impossible to accurately predict.

    And since this is about what should fall under the regulated activity, doubly-irrelevant.

    And here you’re changing the topic to suit your needs. I replied to a comment discussing the definition of the word “wager”. As I’ve told you not long ago today, I don’t care much about the semantics of specific words. I’ll engage in the discussion though.

    And since this definition is irrelevant to the regulated activity, it’s irrelevant to TCGs or loot boxes if you are pushing for those to be considered regulated gambling.

    What? I’d like to remind you that you responded to me and solo’d out TCG boosters. In my response, I said very clearly that I am not a lawyer, nor do I make any claims as to what they should say in their case.

    If you are only arguing about what is or isn’t legal, then you’re wasting your time. I’m not a lawyer, nor in a position to rule on laws. I don’t know if something gave you the impression otherwise.

    If you’re arguing about what should or shouldn’t be legal, then it’s not an unpopular opinion that TCG booster packs should be regulated to some extent.


    Anyway, I’m disengaging. As you mentioned before, we assume good faith here. That is my initial assumption, so I engaged with the discussion. At this point, I believe you are arguing for the sake of arguing.


  • By this definition, buying anything is a wager.

    Mostly correct. Buying anything which retains value after the purchase is a wager. This includes shares in a company, collectible items, even a shipping crate of RAM.

    You’re not betting on a specific outcome in that definition, which is the “gamble” part of “gambling”.

    In the case of TCGs, the bet is that the value of the cards contained in the pack exceed the money spent on the pack. This is very common. And within TCG communities, there is a common understanding that this is gambling.

    That’s of course not to say that all purchases of a booster pack are with the intent to gamble. I’ve also played poker and blackjack for fun, and those games are full of wagers, bets, and outcomes. But the bar has never been that all possible reasons to do something are to gamble, just that gambling is a common motivation to do it.