News for hackers. Stuff that matters.
Re:More powerful Go execution traces by akira2501 on Thursday March 14, 2024 @07:01PM (#39710002)
I love go, but I hate CamelCase so much that I often find myself using a thesaurus to find better names for my structs and functions. It's the only thing I don't like about writing go code.
Re:More powerful Go execution traces by lagichikool on Thursday March 14, 2024 @07:10PM (#39710080)
I was just thinking today that the case style is the only thing I continue to find objectionable on a day-to-day basis after a decade of writing/reading Go.

I've fantasized about the idea of a future `go fmt` version rewriting all the code which seems possible if somewhat impractical.

Re:More powerful Go execution traces by bdzr on Thursday March 14, 2024 @08:38PM (#39710790)
Re:More powerful Go execution traces by Xeoncross on Thursday March 14, 2024 @07:05PM (#39710044)
That's actually PascalCase, which I like better than camelCase and snake_case.
Re:More powerful Go execution traces by biomcgary on Thursday March 14, 2024 @07:57PM (#39710483)
PascalCase for public variables, camelCase for private variables. Just to keep you on your toes.
Re:More powerful Go execution traces by cwbriscoe on Friday March 15, 2024 @07:32PM (#39721778)
and snake_case for db/sql.
Re:More powerful Go execution traces by biomcgary on Tuesday March 19, 2024 @01:32PM (#39758232)
kebab-case might be feeling left out of the party.
Re:More powerful Go execution traces by 38 on Thursday March 14, 2024 @07:58PM (#39710485)
> I love go, but I hate CamelCase so much that I often find myself using a thesaurus to find better names for my structs and functions

what does one have to do with the other? also yeah I agree, CamelCase is awful. for a while I was doing:

    Camel_Case
but it just didnt fit with anything, so now I use:

    CamelCase // just the normal style, for public identifiers
    snake_case // for private identifiers
but, I do not respect acronyms, as keeping them hurt readability I think:

    HtmlHello
    HelloHtml
Re:More powerful Go execution traces by badrequest on Thursday March 14, 2024 @10:29PM (#39711478)
There's nothing about the Go compiler that enforces any case standard. I can't imagine a more trivial hill to die on.
Re:More powerful Go execution traces by semiquaver on Thursday March 14, 2024 @10:55PM (#39711611)
Nitpicking, but Go is one of the only languages I’m aware of where identifier case is semantically relevant (to determine visibility). Given that fact it’s hard to say “nothing” enforces a case standard.
Re:More powerful Go execution traces by rob74 on Friday March 15, 2024 @03:34AM (#39712967)
Adding to that, the compiler doesn't enforce using "mixed caps", as the documentations calls it, but it's strongly recommended (https://go.dev/doc/effective_go#mixed-caps)
Re:More powerful Go execution traces by dezgeg on Friday March 15, 2024 @05:51AM (#39713797)
Haskell enforces that types and type constructors start with Uppercase, and that everything else starts with lowercase.
Re:More powerful Go execution traces by akira2501 on Thursday March 14, 2024 @11:02PM (#39711646)
> I can't imagine a more trivial hill to die on.

I can't imagine why this attitude pervades on hacker news. I can't imagine a more trivial reason than yours to make a reply.

I guess some people see this as a place to discover differences, and others see it as a place to enforce blind conformity to the current fad.

Re:More powerful Go execution traces by umanwizard on Friday March 15, 2024 @02:13AM (#39712522)
That is a bizarre thing to care so much about.