goatlang / goat

Extended flavor of the Go programming language, aiming for increased value safety and maintainability
MIT License
63 stars 1 forks source link

make ”private” the default #6

Closed PaperPrototype closed 1 year ago

PaperPrototype commented 1 year ago

One less keyword to have to deal with. It’s more like go

avivcarmis commented 1 year ago

@PaperPrototype It's more like go but also more fragmented, at least if we allow both implicit private and explicit private. I can see how you have public and package modifiers (without private) and everything else is private. This is only very similar to go in the sense that there is only one way to express private. However, wouldn't it be clearer and easier to understand if every symbol had a visibility modifier without any implicit assumptions?

PaperPrototype commented 1 year ago

@avivcarmis

However, wouldn't it be clearer and easier to understand if every symbol had a visibility modifier without any implicit assumptions?

No, I really believe that it would be very easy to understand, everything is private by default. It's a simple rule as long as there are not exceptions (which there shouldn't be). I wish more languages did that tbh. Like C# has private by default, but then also has private?! I'm like what the hell..

Also, an idea is to make things immutable by default like rust, and introduce a mut keyword... haha, but thats for another issue

avivcarmis commented 1 year ago

Let's do it. Omit private keyword, make everything private by default. Will you be able to open a PR updating the visibility section in the spec here ? That's simply updating the readme file in this repo.

avivcarmis commented 1 year ago

@PaperPrototype regarding const assignments, there's a open discussion here. Please weigh in so we could make a decision

avivcarmis commented 1 year ago

GG