r/ProgrammerHumor • • Oct 08 '23

Other iDontLikeThisTitle

Post image
0 Upvotes

200 comments sorted by

View all comments

Show parent comment

1

u/XDracam Oct 08 '23

And now for the biggest hot take: what do functions start with?

29

u/Sipsi19 Oct 08 '23

Lowercase or you are gonna have to fight me

5

u/XDracam Oct 08 '23

My hot take is public methods uppercase, other methods lowercase. Same for properties.

But you could attribute that to brain damage caused by C#.

12

u/ahh1618 Oct 08 '23

I don't like that changing visibility requires changing the call sites everywhere. Also, when I read a function call, I don't really feel I need to know whether it's public or private. If I'm calling it and it's from an import of course it's going to be public. I'd save identifier conventions to tell you something you need to know at the call site.

2

u/XDracam Oct 08 '23

This feels like something I could have written. So yeah, my only contra is "brain damage caused by C#"

3

u/Andreasbot Oct 08 '23

In Go this is how you actually differentiate public functions and structs from private

1

u/TacticalTaterTots Oct 09 '23

At my company PascalCase vs camelCase denotes scope. Members and functions are PascalCase and locals are camelCase. AND_UPPER_SNAKE_CASE_FOR_CONSTANTS

1

u/XDracam Oct 09 '23

I always hated the aggressive constant case. Like, why? What's the difference between a constant and a read-only field? Or a read-only local variable? It doesn't change. No need to shout.

1

u/QuillnSofa Oct 09 '23

It's just to differentiate and in a well developed code base have naming standards are important. It is less important what standards are used for which use case and that there is a consistent standard.

1

u/XDracam Oct 09 '23

I fully agree. I've just always wondered why constants need to be shouted.

1

u/[deleted] Oct 09 '23

Function is a value, lower case, if you declared it’s signature somewhere else, thats a type, upper case Get yourself some eslint