Automatic constraints
as a team maturity accelerator for startups
François-Guillaume
RIBREAU
@FGRibreau
Bringr
Performance oriented
Social MediaManagement
Bringr
Leader européen de
l'engagement client en
temps réel.
(click2chat, click2call,
click2video, community, ...)
#sold
Bringr
Developer oriented
real-time monitoring and
administration service
for Redis
LET ME TELL YOU
A STORY...
A growing startup...
A growing startup...
= a lot of newcomers
= ever changing directions
= need to move fast
[Where, How, What to follow] to start?
- How to start alone a new project?
- Where are the conventions?
- What are the best practices?
- How can I quickly start on a new language?
- How to setup my dev. env?
- How to deploy in production?
Only one quality guard:
code reviews
PROBLEM
SOLUTION
Let’s create conventions!
... or how to add a new problem on top of another
http://bit.ly/1iJ27GA
http://bit.ly/1MmjFln
http://bit.ly/1iJ2BfV
js best practices
java code-style http://bit.ly/1G4rjvN
Okay.
So what’s the workflow now?
read
conventions
write code
production
ready
memorise
conventions
pass
the code-review
Hard learning curve
& easy to forgot conventions
while writing code
Humans are faillible
BACK TO
SQUARE ONE
Only one quality guard:
code reviews
blabla ...
blabla ...
(...
Why not add tests ? #tradeoff
...)
Even with conventions,
It’s still hard to detect
issues in code-reviews
- code-style
- undefined variables
- misused functions
- wrong types
- DRY/SoC respect
- security
- project structure
- file naming...
Does conventions mean scalability ?
Nope.
more
feedbacks
production
more
recruits
more
code-reviews
human
error
more
code-reviews
more
feedbacks
human
error
production
productio
n
It does. not. scale.
- learning curve is too hard
- too hard for newcomers on other projects
- conventions grow too fast
- technology is moving faster than conventions
SOLUTION
Don't rely on principle,
rely first on automation.
AUTOMATE

EVERYTHING
Automate
code-style checks
jscs
.jscsrc
jscs
Automate
quality-checks
with static-analysis
.eslintrc
Eslint
Eslint
Automate
DRY-checks
with static-analysis
JSInspect
Match - 2 instances
- ./domain/DateRangeInterval.ValueObject.js:35,37
+ ./domain/MeasurementQuery.ValueObject.js:205,207
if (!_.isObject(req) || !req || !_.isObject(req.query)) {
return new PrettyError(400, 'Invalid request');
}
LET’S INVENT
A NEW
PRINCIPLE
@FGRibreau
“DON’T CREATE
CONVENTIONS
YOU CAN’T
ENFORCE
Still.
- when & how to run these checks?
- how to manage legacy code?
- how to talk about automated conventions?
- how and who choose conventions?
- how to be quickly up to speed with new
projects/platform/languages?
when & how
to run these checks?
read
conventions
write code production
memorise them
pass
code review
before
write code production
pass the
code review
CI
automated
checks
continuous
checks
after
Let’s introduce
check-build
(for javascript)
http://bit.ly/109XewR
5
SecurityFreshness
Code styleD.R.Y.ness
Syntax/
GoodPractices
JSInspect
David
Nsp
http://bit.ly/109XewR
how to manage
legacy code?
PROBLEM
Bringr
#monolith
SOLUTION
First,
don’t feed the damn monolith
Bringr
Bringr
Strategy
Bringr
Impact
Bringr
...
Bringr
Sourcing
Bringr
...
Bringr
Alerts
Then,
only automate checks on new code
Bringr Strategy Bringr Impact
Bringr Backend
....
Bringr Sourcing Bringr Account
...
Bringr Alerts
Filtering
Statistics
Rules EnginePublishing
Statistics Updater
UIUIUI
Indexing
G+
Vimeo
Facebook
Youtube
Wordpres
Twitter
Notifications
... ... ...
only automate new code
how to talk about
automated conventions
PROBLEM
Automating everything
can sometimes means
less readable conventions & best practices
.jscsrc
SOLUTION
Generate readable documentation
from automated tools
write code production
pass the
code review
CI
automated
checks
continuous
checks
before
write code production
pass the
code review
CI
continuous
checks
after
readable
convention
automated
checks
.jscsrcbefore
http://bit.ly/1itmabjafter
http://bit.ly/1itmabj
how and who
choose conventions?
Conventions
should be versioned
Debates
should be around
Pull-Requests
@FGRibreau
“DON’T CREATE
CONVENTIONS
YOU CAN’T
ENFORCE
how to be quickly up to speed
with new projects/platform/languages
CI
check-build
centralize
conventions
keep
settings
DRY
Still.
You still need to explain the WHY.
We record internal talks about
why we do what we do.
One last thing...
These automated principles
were about code.
How to spread wider principles?
(e.g. application architecture)
stories2
@FGRibreau
constants files
environme
nt
variables
distribut
ed
Simplicity Genericity
Knowing every running
environments
One configuration
to rule them all
CONFIGURATION
@FGRibreau
“EVERY CONSTANT
NUMBER, BOOLEAN OR STRING*
SHOULD BE
CONFIGURABLE
How can we be sure
developers will follow this principle?
Build base libraries
Ease the learning curve.
Constrain by API design.
microservice
API
documentation
API
schema
API
validation
swagger/json-schema/hapi/json-api
(Pre-configured in a bootstrap project)
Everything we just saw
makes a common base
- leads the developer mindset while coding
- brings developers quickly up to speed
- flatten issues to cross-language concerns
- being able to capitalize on & standardize issues with
an adapted tooling is a huge win
What about non-code principles?
E.g. github repository names?
A cron checks every days repository names.
If a developer makes a mistake, he will be notified.
PRINCIPLES
CONVENTIONS
AUTOMATION
CONSTRAINTS
CODE
@FGRibreau
Questions?
Join us @iAdvize!
Don’t forget to take some stickers!
Thank you!

Automatic constraints as a team maturity accelerator for startups