Is there any sort of (semi) official convention?
--
programmer, author http://www.midnightbeach.com
and father http://www.midnightbeach.com/hs
<access specifier><override/virtual/abstract...><return-type><Method name> (<params>)
This convention is what I had seen almost always which may be considered as official :). But nevertheless, some ppl (though very rare) do use the other one too.
Regards,
fbhcah
I guess there isn't. However, many C#ers are coming from C++ where you had
to split the interface into public, protected and private *sections*:
class X
{
public:
void F();
void Y();
protected:
void Z();
private:
int x;
};
So having the access specifier first is more natural, to people coming from
C++, that is...
Regards,
Andreas
P.S. I'm unsure whether Java has any restrictions here...
Nope. So long as the return type is immediately before the method name,
the rest is fine.
The conventions are the same though.
--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Java does not have any such restrictions (except virtual is not a keyword as
everything is virtual in Java).
However, as Java, Delphi, Visual Basic and just about every language there
is have as convention of specifying scope before modifiers and I would hate
to see 'virtual public' being used. For me, it simply looks wrong.
Programmers looking for modifiers will scan the second word first, why
confuse them. =)
- Michael S