• 3 Posts
  • 4 Comments
Joined 1 year ago
cake
Cake day: June 18th, 2023

help-circle
  • thepiggz@programming.dev
    hexagon
    toPhilosophy@lemmy.mlDoes Intrinsic Value Exist?
    ·
    10 months ago

    After some thought, my new inclination:

    Whether intrinsic value exists or not is unknowable to us, specifically because we did not create our own universe. I can’t say for certain there is value in truth, justice, love, etc. beyond what we humans assign to these things. Yet, I can’t say for certain that there is not. Intrinsic value by its very nature and definition is a mystery.




  • Interesting perspective. Yet, server admins actually do have control over who they federate with. People do have control over what servers they use. Why not exercise this control?

    My understanding is that one can post things publicly online but still retain rights, including distribution rights in certain jurisdictions.

    I don’t think it is out of the question that the fediverse as a whole could make some decisions going forward that would make it more difficult for Meta (or other official corporations) to monetize the things we post with ads in their clients or through training of predictive models.



  • thepiggz@programming.dev
    hexagon
    toTypeScript@programming.devOO awkward
    ·
    10 months ago

    GPT4 rewrite:

    Title: Optimizing TypeScript: Embracing Functional Patterns and Leveraging V8's Strengths

    Body:

    Hello TypeScript Community! Our journey in TypeScript development benefits greatly from a deeper understanding of JavaScript's core mechanics and the V8 engine's optimizations. It's become increasingly clear that JavaScript, and by extension TypeScript, subtly discourages traditional object-oriented (OO) programming in its built-in functionalities, favoring functional programming paradigms instead. Combining this with V8’s optimization techniques can significantly enhance our code's performance and readability.

    1. Functional Over OO in JavaScript's Built-ins:

      • Function References in Core Functions: JavaScript's built-ins, like addEventListener, setTimeout, setInterval, and array methods (map, filter, reduce), prefer function references over objects with expected methods. This design choice subtly favors functional programming over OO.
      • Closures for State Management: Instead of passing around shaped objects or using bind, closures provide a more natural and efficient way to maintain state in functions, aligning well with JavaScript's functional tendencies.
    2. Understanding and Utilizing V8's Optimizations:

      • Leveraging Hidden Classes and Inline Caching: Consistent object property initialization helps V8 create and reuse hidden classes efficiently, optimizing property access. Inline caching improves performance by optimizing repeated property and method access on objects.
      • Best Practices for V8 Optimizations: Avoid dynamic changes to object shapes and focus on writing monomorphic code to aid V8's optimization processes.
    3. Adapting to Functional Programming in TypeScript:

      • Functional Patterns for Performance: Embrace functional patterns, such as immutable data and pure functions, which V8 optimizes more effectively than complex class hierarchies.
      • Using TypeScript Features for Functional Code: TypeScript's powerful type system, including interfaces and type aliases, supports a more functional style of coding, which is inherently more aligned with V8’s optimization strategies.
    4. Moving Away from Classic OO Patterns:

      • Challenges with OO in TypeScript: The behavior of this, complex inheritance structures, and the awkwardness of bind highlight the incongruities of OO patterns in TypeScript.
      • Functional Techniques as Solutions: Opt for closures and composition over inheritance. Utilize functional programming constructs to create more modular, reusable, and efficient code.

    In conclusion, by understanding the inherent functional leanings of JavaScript and TypeScript, and by aligning our coding practices with V8’s optimization techniques, we can write more efficient and maintainable TypeScript code. This approach not only capitalizes on the language’s strengths but also ensures our code is primed for optimal performance by the V8 engine. Let's continue to explore and embrace these functional paradigms and share our insights on leveraging V8's capabilities in TypeScript development.