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 ...
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 <...
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 ...
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 ...
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 ...
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 -...
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 ...
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 ...
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.
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mixins × 30sass × 6
ruby × 5
inheritance × 5
javascript × 4
python × 3
object-oriented × 3
css × 3
c++ × 2
typescript × 2
template-meta-programming × 2
extension-methods × 2
meta-programming × 2
less-css × 2
java × 1
c# × 1
performance × 1
php × 1
c++11 × 1
design-patterns × 1
ruby-on-rails × 1
scala × 1
c++14 × 1
logging × 1
kotlin × 1