-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Player Code Python Style Guide
Nick Winter edited this page Oct 20, 2016
·
2 revisions
We're teaching people Python. Therefore it is important that we have a consistent and clear coding style that is as close to standard Python as possible. Every Artisan should apply this coding standard in her levels to keep the code through all the levels consistent.
Just basically follow PEP 8, but with these exceptions:
- Try to keep lines to 60 characters or less. (We are working with very narrow code editors sometimes.)
- Use double quotes.
- Put placeholder
pass
statements at the end of empty blocks.
- Use camelCase, not snake_case, for compatibility with CodeCombat APIs.
- Avoid single letter names. Be descriptive with your naming.
- Event handler functions should be prefixed with the word
on
, likeonPetSpawn
CodeCombat | Home | Blog | Forum | Teachers | Legal | Contribute
- Home
- Archmage Home
- Artisan Home
- Diplomat Home
- Archmage General
- Mission statement
- Coco Models
- Coding Guidelines
- Cookbook
- File system
- JSON Schema
- Technical overview
- Testing
- Third party software and services
- Artisan General
- Building A Level
- Coding Guidelines for Artisans
- Editing Thang Components
- Important Artisan Concepts
- Keyboard Shortcuts
- Debugging
- Artisan How-To Index
- Diplomat General
- i18n
- i18n Glossary nb
- i18n Glossary ru
- i18n Glossary es-419
- Dev Setup
- Dev Setup: Linux
- Dev Setup: Windows
- Dev Setup: Mac
- Dev Setup: Vagrant
- Dev Setup: Issues
- Game Engine
- Component
- Multiplayer
- Surface
- System
- Thang
- Thang Component System
- Tome
- World
- Artisan Tabs
- Components And Systems
- Scripts
- Settings
- Thangs
- Other
- Aether
- Client models
- Developer organization
- Educational Standards
- Events, subscriptions, shortcuts
- Chat Room
- Chat Room Rules
- Permissions
- Project Ideas List
- Treema
- Versioning
- Views