Social Games and their Clean Code

129
Social Games and their Clean Code

description

How Clean Code is used for social games in a big company.

Transcript of Social Games and their Clean Code

Page 1: Social Games and their Clean Code

Social Gamesand their Clean Code

Page 2: Social Games and their Clean Code

http://www.vgchartz.com/gamedb/?name=fifa+soccer+13 || http://cartelthemes.com/fifa-13-193-hd-wallpapers.html

12.79 Mio.

Page 3: Social Games and their Clean Code

30.11 Mio.

http://www.vgchartz.com/gamedb/?name=Call+of+Duty%3A+Modern+Warfare+3 || http://www.alextv.de/2011/11/10/call-of-duty-modern-warfare-3-review

Page 4: Social Games and their Clean Code

Video Games = special interests

Page 5: Social Games and their Clean Code

159.79 Mio.

Page 6: Social Games and their Clean Code

Social Games = Games for everybody

Page 7: Social Games and their Clean Code

Berlin

Page 8: Social Games and their Clean Code

2009 — 20 employees

Page 9: Social Games and their Clean Code

Today — 250 employees

Page 10: Social Games and their Clean Code

20 Game-Teams

Page 11: Social Games and their Clean Code

Independent

development teams

Page 12: Social Games and their Clean Code

Mutable,

small teams

Page 13: Social Games and their Clean Code

Consistency

Page 14: Social Games and their Clean Code

Way of working

Page 15: Social Games and their Clean Code

No fixed roles

Page 16: Social Games and their Clean Code

High responsibility

Page 17: Social Games and their Clean Code

Configurability

Page 18: Social Games and their Clean Code

Maintainability

Page 19: Social Games and their Clean Code

Weekly releases

Page 20: Social Games and their Clean Code

Tracking & Reporting

Page 21: Social Games and their Clean Code

Agile way of working

Page 22: Social Games and their Clean Code

Agility

Page 23: Social Games and their Clean Code

Consistency

Maintainability

Agility

improves

allows

Page 24: Social Games and their Clean Code

Bubble Island

Page 25: Social Games and their Clean Code

2009Start of development

Page 26: Social Games and their Clean Code

2011Not more maintainable!

http://www.flickr.com/photos/mecklenburg

Page 27: Social Games and their Clean Code

But stillsuccessful!

Page 28: Social Games and their Clean Code

Refactoring!

Page 29: Social Games and their Clean Code

1Consistency

Page 30: Social Games and their Clean Code

Consistency

Page 31: Social Games and their Clean Code

Consistency

Page 32: Social Games and their Clean Code

Consistency

Page 33: Social Games and their Clean Code

Naming

Consistency

Page 34: Social Games and their Clean Code

Naming

•Speaking names

Consistency

Page 35: Social Games and their Clean Code

Naming

•Speaking names

•No Abbreviations

Consistency

Page 36: Social Games and their Clean Code

Naming

•Speaking names

•No Abbreviations

•1 word per concept

Consistency

Page 37: Social Games and their Clean Code

Consistency

Page 38: Social Games and their Clean Code

Consistency

Page 39: Social Games and their Clean Code

Consistency

Page 40: Social Games and their Clean Code

Consistency

Page 41: Social Games and their Clean Code

Consistency

Page 42: Social Games and their Clean Code

Consistency

Page 43: Social Games and their Clean Code

Consistency

Page 44: Social Games and their Clean Code

Consistency

Page 45: Social Games and their Clean Code

Formatting

Consistency

Page 46: Social Games and their Clean Code

Formatting

•Indentation

Consistency

Page 47: Social Games and their Clean Code

Formatting

•Indentation

•Wrapping braces

Consistency

Page 48: Social Games and their Clean Code

Formatting

•Indentation

•Wrapping braces

•Variables first

Consistency

Page 49: Social Games and their Clean Code

Formatting

•Indentation

•Wrapping braces

•Variables first

•Public in front of non-public methods

Consistency

Page 50: Social Games and their Clean Code

Consistency

Page 51: Social Games and their Clean Code

Consistency

Page 52: Social Games and their Clean Code

Comments

Consistency

Page 53: Social Games and their Clean Code

Comments

•Avoid them if possible

Consistency

Page 54: Social Games and their Clean Code

Comments

•Avoid them if possible

•Usage scenarios

Consistency

Page 55: Social Games and their Clean Code

Comments

•Avoid them if possible

•Usage scenarios

‣Warnings

Consistency

Page 56: Social Games and their Clean Code

Comments

•Avoid them if possible

•Usage scenarios

‣Warnings

‣ Simplified explanations

Consistency

Page 57: Social Games and their Clean Code

Consistency

Consistency

Page 58: Social Games and their Clean Code

Consistency

•Naming

Consistency

Page 59: Social Games and their Clean Code

Consistency

•Naming

•Formatting

Consistency

Page 60: Social Games and their Clean Code

Consistency

•Naming

•Formatting

•Comments

Consistency

Page 61: Social Games and their Clean Code

2Maintainability

Page 62: Social Games and their Clean Code

Maintainability

Page 63: Social Games and their Clean Code

Maintainability

Page 64: Social Games and their Clean Code

Maintainability

Page 65: Social Games and their Clean Code

Maintainability

Page 66: Social Games and their Clean Code

Maintainability

Page 67: Social Games and their Clean Code

Methods

Maintainability

Page 68: Social Games and their Clean Code

Methods

•As small as possible

Maintainability

Page 69: Social Games and their Clean Code

Methods

•As small as possible

•1 level of abstraction

Maintainability

Page 70: Social Games and their Clean Code

Methods

•As small as possible

•1 level of abstraction

•1 functionality

Maintainability

Page 71: Social Games and their Clean Code

Maintainability

Page 72: Social Games and their Clean Code

Maintainability

Page 73: Social Games and their Clean Code

Maintainability

Page 74: Social Games and their Clean Code

Maintainability

Page 75: Social Games and their Clean Code

Classes

Maintainability

Page 76: Social Games and their Clean Code

Classes

•1 reason to change (SRP)

Maintainability

Page 77: Social Games and their Clean Code

Classes

•1 reason to change (SRP)

•Only a few instance variables

Maintainability

Page 78: Social Games and their Clean Code

Classes

•1 reason to change (SRP)

•Only a few instance variables

•High kohesion

Maintainability

Page 79: Social Games and their Clean Code

Maintainability

Page 80: Social Games and their Clean Code

Maintainability

Page 81: Social Games and their Clean Code

Maintainability

Page 82: Social Games and their Clean Code

Maintainability

Page 83: Social Games and their Clean Code

Maintainability

Page 84: Social Games and their Clean Code

Maintainability

Page 85: Social Games and their Clean Code

Data structures

Maintainability

Page 86: Social Games and their Clean Code

•Avoid train wrecks

Data structures

Maintainability

Page 87: Social Games and their Clean Code

•Avoid train wrecks

•Use data transfer objects

Data structures

Maintainability

Page 88: Social Games and their Clean Code

•Avoid train wrecks

•Use data transfer objects

•Separate production and use of systems

Data structures

Maintainability

Page 89: Social Games and their Clean Code

Maintainability

Maintainability

Page 90: Social Games and their Clean Code

•Methods

Maintainability

Maintainability

Page 91: Social Games and their Clean Code

•Methods

•Classes

Maintainability

Maintainability

Page 92: Social Games and their Clean Code

•Methods

•Classes

•Data structures

Maintainability

Maintainability

Page 93: Social Games and their Clean Code

3Agility

Page 94: Social Games and their Clean Code

Islands of knowledge

Agility

http://flickr.com/photos/92928628@N04

Page 95: Social Games and their Clean Code

Pair Programming

Agility

Page 96: Social Games and their Clean Code

•Avoid islands of knowledge

Pair Programming

Agility

Page 97: Social Games and their Clean Code

•Avoid islands of knowledge

•Integration of new team members

Pair Programming

Agility

Page 98: Social Games and their Clean Code

•Avoid islands of knowledge

•Integration of new team members

•Collective responsibility

Pair Programming

Agility

Page 99: Social Games and their Clean Code

Difficult to read

& unstructured

Agility

Page 100: Social Games and their Clean Code

Regular refactorings

Agility

Page 101: Social Games and their Clean Code

•Continuous improvements

Regular refactorings

Agility

Page 102: Social Games and their Clean Code

•Continuous improvements

•The Boy Scout Rule (Robert C. Martin)

Regular refactorings

Agility

Page 103: Social Games and their Clean Code

No safeguarding

Agility

http://flickr.com/photos/99995147@N00

Page 104: Social Games and their Clean Code

Unit tests

Agility

Page 105: Social Games and their Clean Code

•Safety net

Unit tests

Agility

Page 106: Social Games and their Clean Code

•Safety net

•Facilitated training

Unit tests

Agility

Page 107: Social Games and their Clean Code

•Safety net

•Facilitated training

•Playground

Unit tests

Agility

Page 108: Social Games and their Clean Code

Features late testable

Agility

http://www.flickr.com/photos/adesigna

Page 109: Social Games and their Clean Code

Continuous integration

Agility

Page 110: Social Games and their Clean Code

•Early available software artifacts

Continuous integration

Agility

Page 111: Social Games and their Clean Code

•Early available software artifacts

•Verifiable expectations

Continuous integration

Agility

Page 112: Social Games and their Clean Code

•Early available software artifacts

•Verifiable expectations

•Foreseeable problems

Continuous integration

Agility

Page 113: Social Games and their Clean Code

Agility

Agility

Page 114: Social Games and their Clean Code

•Pair Programming

Agility

Agility

Page 115: Social Games and their Clean Code

•Pair Programming

•Regular refactorings

Agility

Agility

Page 116: Social Games and their Clean Code

•Pair Programming

•Regular refactorings

•Unit tests

Agility

Agility

Page 117: Social Games and their Clean Code

•Pair Programming

•Regular refactorings

•Unit tests

•Continuous integration

Agility

Agility

Page 118: Social Games and their Clean Code

4Tools

Page 119: Social Games and their Clean Code

https://www.pivotaltracker.com

Tools

Page 122: Social Games and their Clean Code

Tools

CPD & PMD

Page 123: Social Games and their Clean Code

Benefit for Wooga

Page 124: Social Games and their Clean Code

Flexible team building

http://www.flickr.com/photos/scoobay

Page 125: Social Games and their Clean Code

High productivityover long period of time

http://www.flickr.com/photos/stephenbegin

Page 126: Social Games and their Clean Code

changing requirementshttp://www.flickr.com/photos/jimculp

Rapid response to

Page 127: Social Games and their Clean Code

Clean Code as

a common language

Page 128: Social Games and their Clean Code

Less wtf/minute

Page 129: Social Games and their Clean Code

Questions?

jobs.wooga.com

@StephanPartzsch