"Battleship" style game

Lie Lie.1296 at gmail.com
Thu Feb 26 17:39:12 EST 2009


On Feb 26, 3:50 am, Shawn Milochik <Sh... at Milochik.com> wrote:
> On Wed, Feb 25, 2009 at 11:38 AM, Marco Mariani <ma... at sferacarta.com> wrote:
>
> > Yes it's in Python alright, but it's not Pythonese yet. You could try
> > avoiding the getter/setter stuff, and camelCase method naming, things like
> > that, for a start.
>
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> What do you mean avoiding the getter/setter stuff? If I understand
> correctly, you're saying to directly access the attributes, which I
> specifically want to avoid because I may want to enforce some rules
> (such as not changing a ship length after it's created).

I just want to add the note that since you're planning to move the
code to Java, although you should avoid getter and setter in python
(since it's redundant because of property), you should use getter and
setter in the Java version because it is the best practice in Java.

> The camel-case thing I get -- I use that and this_type quite a bit,
> probably because of the inconsistency of the languages I use
> regularly, and standards at work and conventions in my hobby
> programming.




More information about the Python-list mailing list