Remix.run Logo
azangru 6 hours ago

I know it doesn't matter, but...

...who invented this letter-casing convention?

    import (
        "embed"
        "html/template"
        "net/http"
    )

    //go:embed templates/*.html
    var files embed.FS

    var tmpl = template.Must(template.ParseFS(files, "templates/*.html"))
why is the name of a module lower-cased

but the names of functions accessed via its namespace upper-cased?

how does this make sense?

5 hours ago | parent | next [-]
[deleted]
lanstin 5 hours ago | parent | prev [-]

Upper case symbols in a module are exported. Everything else should be lower case.

azangru 5 hours ago | parent [-]

Oh; in that case the lowly Javascript/typescript does this so much cleaner with the explicit `export` keyword. "Explicit is better than implicit."

x0re4x 2 hours ago | parent [-]

Go language is explicit: identifiers starting with a capital letter are exported.

https://go.dev/ref/spec#Exported_identifiers