• 0 Posts
  • 8 Comments
Joined 2 years ago
cake
Cake day: August 3rd, 2023

help-circle
  • The basic problem is that identifiers can be either types or variables, and without a keyword letting you know what kind of statement you’re dealing with, there’s no way of knowing without a complete identifier table. For example, what does this mean:

    foo * bar;
    

    If foo is a type, that is a pointer declaration. But if it’s a variable, that’s a multiplication expression. Here’s another simple one:

    foo(bar);
    

    Depending on how foo is defined, that could be a function call or a declaration of a variable bar of type foo, with some meaningless parentheses thrown in.

    When you mix things together it gets even more crazy. Check this example from this article:

    foo(*bar)();
    
    

    Is bar a pointer to a function returning foo, or is foo a function that takes a bar and returns a function pointer?

    let and fn keywords solve a lot of these ambiguity problems because they let the parser know what kind of statement it’s looking at, so it can know whether identifiers in certain positions refer to types or variables. That makes parsing easier to write and helps give nicer error messages.






  • Laura Chambers, who stepped into an interim CEO role at Mozilla in February, says the company is reinvesting in Firefox after letting it languish in recent years,

    It’s sort of amusing to me that Mozilla would let the Firefox browser languish. Is that not the raison d’etre of your entire organization? What are you doing with your time and effort if you are allowing your core product to languish? What would people say if Microsoft said “yeah, we’ve allowed windows to languish in recent years.” What an insane notion.


  • The confusion arises because there are 5 different ways to do the same thing, the non-experimental methods shouldn’t be used even though they’re recommended in the official docs

    I appreciate what you’re trying to say, but you’re kind of illustrating exactly the point I was making about conceptual simplicity and atrocious UX.