Skip to content
This repository has been archived by the owner on Oct 12, 2018. It is now read-only.

Standardize comments and optimizations across all examples #5

Open
gamedevsam opened this issue May 5, 2014 · 1 comment
Open

Standardize comments and optimizations across all examples #5

gamedevsam opened this issue May 5, 2014 · 1 comment

Comments

@gamedevsam
Copy link
Contributor

Each example should be as complete and straight forward as possible (including ample use of comments). Also, we should strive to use the best coding practices we can think of, considering users are likely to use this code as the framework for their own projects.

Watch this video, and this video, to learn more about the concept of "clean code", to learn some good coding practices.

In general:

  • Keep comment capitalization consistent.
  • Comment everything.
  • Avoid branches that just return if the condition is false at the top of a function, move that check upwards, and branch before calling the function (see example here).

We should keep this list updated, and turn it into a contributing guide, for those interested in adding their own examples.

@gamedevsam gamedevsam changed the title Standardize comments and optimizations across all bullet examples Standardize comments and optimizations across all examples May 5, 2014
@Gama11
Copy link
Contributor

Gama11 commented May 6, 2014

"Commenting everything" is dangerous. You'll quickly run into comments that don't add any value, they just rephrase what the code already says and are pretty useless. Example:

// make the block immovable
groundBlock.immovable = true;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants