[-] shy_mia@lemmy.blahaj.zone 11 points 1 week ago

I really wanna know where you get your language info and examples from because nearly every single one you wrote in your comments is just wrong.

Program state in Rust isn't immutable. datastruct.nextState() is not only possible, but perfectly reasonable, it's exactly how iterators are implemented.

[-] shy_mia@lemmy.blahaj.zone 2 points 2 weeks ago

At least it has something to complain about, unlike Karens.

[-] shy_mia@lemmy.blahaj.zone 16 points 2 weeks ago* (last edited 2 weeks ago)

The fact that it can be used as a scripting language doesn't mean it's a scripting language. You could use C++ as a scripting language as well, but it would suck.
C# even supports native compilation nowadays, not just JIT, so it's definitely not a lowly scripting language.

Anyways you've got options. Go may also be one of them if you want GC, I forgot to mention it.

[-] shy_mia@lemmy.blahaj.zone 23 points 2 weeks ago* (last edited 1 week ago)

I've found working with Rust and Bevy to be quite pleasant. If you're used to working with ECS, I suggest you at least give it a go.
Rust is as functional as C++ 20 with ranges and views is, which is to say it isn't. Not sure where you got that impression from, but while it does borrow some ideas from functional languages, it's still very much a procedural one.

Zig doesn't have headers, nor inheritance. Again, not sure where you got that from, but Zig is basically a modern C, so there's no OOP anywhere, let alone multiple inheritance.

As for what to use, I think they're both viable alternatives. I lean more towards Rust, but that's just due to familiarity. Odin also looks like a viable option, if you don't mind a smaller ecosystem.
If you want a garbage collected language, then I'd go for C#. Despite its historic reputation as a Windows only language, it's been cross platform and open source for roughly a decade at this point. I find it great to work with.

[-] shy_mia@lemmy.blahaj.zone 5 points 1 month ago* (last edited 4 weeks ago)

I get the mistake. Wouldn't even call it one tbh, just an oversight. But when someone points it out normally one doesn't reply with "don't force your political views onto me" as if non male devs was some weird "woke" concept. A simple "whoops, missed that" would have been perfectly fine and everyone would've moved on. With that said, having followed the whole debacle I can say it could have been handled better by both sides.

[-] shy_mia@lemmy.blahaj.zone 3 points 1 month ago* (last edited 1 month ago)

The problem was more the fact that the devs viewed using anything other than 'he' as political, not the presence of gendered language itself. The devs themselves made a big deal about changing it. The way I see it, it's not even about trans people. How about just women? Is including women in software developent considered political? One would hope not, but here we are...

[-] shy_mia@lemmy.blahaj.zone 2 points 1 month ago

Especially considering what the context already was

[-] shy_mia@lemmy.blahaj.zone 3 points 1 month ago* (last edited 1 month ago)

It wasn't just to accomodate trans people but just... anyone who isn't male? Apparently women being software developers is a controversial concept for Andreas.

[-] shy_mia@lemmy.blahaj.zone 5 points 1 month ago

I find this to be true for every new language I try out. Since every language has a different way of doing things and gives me a new perspective, in the long run they all end up improving my programming style as a whole. I always end up integrating the best parts of each into my next project when possible.

Experience will always be more valuable than any set of rules these kind of books tout as "the way things are meant to be done".

[-] shy_mia@lemmy.blahaj.zone 3 points 1 month ago* (last edited 1 month ago)

Oh for sure. I have nothing against getters and setters when they're justified, but in the case of bare fields with no validation like that example it's just annoying.
Also stuff like this just grinds my gears (oversimplified example again):

class IntegerAdder {
    private int a, b;
    public IntegerAdder(int a, int b) {
        this.a = a;
        this.b = b;
    }
    
    public int get_sum() {
        return a + b;
    }
}

Just make it a bloody function.
You may say it's silly, but I've genuinely found code like this in the wild. Not that exact code snippet of course but that was the spirit.

[-] shy_mia@lemmy.blahaj.zone 5 points 1 month ago

It really depends on the context frankly. I did say it was a crappy example ;)
Try to read this snippet I stole from Clean Code and tell me if it's readable without having to uselessly jump everywhere to understand what's going on:

public class SetupTeardownIncluder {
  private PageData pageData;
  private boolean isSuite;
  private WikiPage testPage;
  private StringBuffer newPageContent;
  private PageCrawler pageCrawler;


  public static String render(PageData pageData) throws Exception {
    return render(pageData, false);
  }

  public static String render(PageData pageData, boolean isSuite) throws Exception {
    return new SetupTeardownIncluder(pageData).render(isSuite);
  }

  private SetupTeardownIncluder(PageData pageData) {
    this.pageData = pageData;
    testPage = pageData.getWikiPage();
    pageCrawler = testPage.getPageCrawler();
    newPageContent = new StringBuffer();
  }

  private String render(boolean isSuite) throws Exception {
     this.isSuite = isSuite;
    if (isTestPage())
      includeSetupAndTeardownPages();
    return pageData.getHtml();
  }

  private boolean isTestPage() throws Exception {
    return pageData.hasAttribute("Test");
  }

  private void includeSetupAndTeardownPages() throws Exception {
    includeSetupPages();
    includePageContent();
    includeTeardownPages();
    updatePageContent();
  }


  private void includeSetupPages() throws Exception {
    if (isSuite)
      includeSuiteSetupPage();
    includeSetupPage();
  }

  private void includeSuiteSetupPage() throws Exception {
    include(SuiteResponder.SUITE_SETUP_NAME, "-setup");
  }

  private void includeSetupPage() throws Exception {
    include("SetUp", "-setup");
  }

  private void includePageContent() throws Exception {
    newPageContent.append(pageData.getContent());
  }

  private void includeTeardownPages() throws Exception {
    includeTeardownPage();
    if (isSuite)
      includeSuiteTeardownPage();
  }

  private void includeTeardownPage() throws Exception {
    include("TearDown", "-teardown");
  }

  private void includeSuiteTeardownPage() throws Exception {
    include(SuiteResponder.SUITE_TEARDOWN_NAME, "-teardown");
  }

  private void updatePageContent() throws Exception {
    pageData.setContent(newPageContent.toString());
  }

  private void include(String pageName, String arg) throws Exception {
    WikiPage inheritedPage = findInheritedPage(pageName);
    if (inheritedPage != null) {
      String pagePathName = getPathNameForPage(inheritedPage);
      buildIncludeDirective(pagePathName, arg);
    }
  }

  private WikiPage findInheritedPage(String pageName) throws Exception {
    return PageCrawlerImpl.getInheritedPage(pageName, testPage);
  }

  private String getPathNameForPage(WikiPage page) throws Exception {
    WikiPagePath pagePath = pageCrawler.getFullPath(page);
    return PathParser.render(pagePath);
  }

  private void buildIncludeDirective(String pagePathName, String arg) {
    newPageContent
      .append("\n!include ")
      .append(arg)
      .append(" .")
      .append(pagePathName)
      .append("\n");
  }
}

That's what I was talking about.

[-] shy_mia@lemmy.blahaj.zone 11 points 1 month ago

The moon would disappear though, so you'd notice by looking at the sky if it wasn't obstructed by clouds.

view more: next ›

shy_mia

joined 4 months ago