They are similar, except for where they are different.
Here, we're talking about interfaces, which are very different from struct
and class naming conventions. An object has only one class in OOP, but in
Go it is normal for a single type to implement many interfaces, including
ones it doesn't even
struct and class semantics aren't equivalent but they are similar. Which is
why I think the rule "avoid -er" is relevant. If you're struggling to name
something then you probably don't know what it is and what it needs to do.
I'm not advocating going to the Java extreme of fifty syllable names.
Ra
That's advice for a very different style of language than Go.
Go does not have "objects" in the sense of that post. A Go interface, for
example, does not "have lots of instance variables, lots of arguments, and
pass lots of data around probably."
A class is not a struct is not a Go interface.
Th
There's a good oop blog article on the caveats of naming classes (struct)
ending in -er.
http://objology.blogspot.co.uk/2011/09/one-of-best-bits-of-programming-advice.html?m=1
I know the reader/writer interface kind of flies in the face of this but I
think that's partly associated with it being an
The package names blog post may be useful, though it does not provide
specific guidance on singular vs plurals:
https://blog.golang.org/package-names
On Tue, Jul 12, 2016 at 10:40 AM Sam Whited wrote:
> On Tue, Jul 12, 2016 at 9:19 AM, Rayland wrote:
> > When does it make sense for a package to
On Tue, Jul 12, 2016 at 9:19 AM, Rayland wrote:
> When does it make sense for a package to be named in plural? For example,
> I'm currently working on a MVC framework and for me it makes sense to have a
> "controller" package as opposed to "controllers", but I saw that Beego
> prefers plural for t
I prefer the singular form unless pushed towards the plural for
some reason (for example, because we want both plural and
singular forms).
The plural package names in the stdlib are generally there
because the singular form is a reserved word or
keyword (strings, types, errors, bytes).
On 12 Ju
When does it make sense for a package to be named in plural? For example,
I'm currently working on a MVC framework and for me it makes sense to have
a "controller" package as opposed to "controllers", but I saw that Beego
prefers plural for the same case.
--
You received this message because y