Skip to main content
39 votes
Accepted

Chess game for my students

I would include a comment at the top of the file indicating the version of the relevant software you've used. A quick comment stating "Tested with Python 3.6 (installed through Anaconda)" or ...
spyr03's user avatar
  • 3,052
19 votes

Chess game for my students

Since @spyr03's extensive (and awesome) answer did not include it, here are some small comments. You want this to be an example for your students of how code should look like. You should include a <...
Graipher's user avatar
  • 41.7k
14 votes

Chess game for my students

When I think back to my student days, the most crucial point for me to understand code was always the entry point. In my experience, it takes a lot of experience to understand a code concept as a ...
Lars Wissler's user avatar
7 votes

Chess game for my students

One thing I don't see mentioned in spyr03's excellent review: I think it's unnecessarily inconsistent (and thus confusing) for you to use mixin classes to implement 100% of the ...
Quuxplusone's user avatar
  • 19.7k
3 votes

Chess game for my students

It has been some time since I asked the question. I used your advice to improve the code and gave it as an exercise to my students. It's been a tremendous success. I will detail some of the ...
Infinity's user avatar
  • 525
2 votes

Proper naming for objects which have a position and bounds on a plane

Everything is an Entity! If you would follow the Entity Component System approach, that is. The idea is that all objects are entities, and each Entity has several components. Size, Position, Movable -...
Simon Forsberg's user avatar
2 votes
Accepted

Ensuring that attributes referenced by a mixin are present in the children class

I think the norm is to just try to access the schema attribute and let it fail with an AttributeError if there isn't one. But here are two possibilities to catch it ...
RootTwo's user avatar
  • 10.7k
1 vote

Ensuring that attributes referenced by a mixin are present in the children class

The point of a mixin, at least as I've always understood it, is to inject methods into other classes -- and not to create instances of the mixin class itself. So putting an ...
FMc's user avatar
  • 13.1k
1 vote

SASS mixin for a font-awesome before/after usage

The $type can be passed in directly to the pseudo-class selector after you check its validity. ...
Adam's user avatar
  • 251
1 vote

SASS/SCSS mixin for button states

Formatting Format your code better. Put a space after the colon after properties. Don't put multiple properties in one line. Use of SASS Put your colors and lengths into variables so you can reuse ...
RoToRa's user avatar
  • 11.6k

Only top scored, non community-wiki answers of a minimum length are eligible