这是indexloc提供的服务,不要输入任何密码
Skip to content

WGSL: Use let instead of var? #1234

@mrdoob

Description

@mrdoob

Talking with @Kangz today I learnt that WGSL is using var and const for declaring variables and I thought the JavaScript ecosystem would find it confusing.

let and const were introduced in JavaScript in 2015 and at this point most of the browsers support them. Over the last few years JavaScript developers have been moving their code from var everywhere to let and const to the point that when they see a var they think the code is old and/or unmaintained.

Would it be a good idea to align with JavaScript and use let and const too?

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions