clean up your mess!

23
Clean Up Your Mess! By: Omnia Gamal twitter: @Omnia_G webSite: omnia.ninja

Upload: omnia-helmi

Post on 28-Nov-2014

334 views

Category:

Software


1 download

DESCRIPTION

This slides show some concepts of how clean your code mess

TRANSCRIPT

Page 1: Clean up your mess!

Clean Up Your Mess!

By: Omnia Gamaltwitter: @Omnia_GwebSite: omnia.ninja

Page 2: Clean up your mess!

Code Organization

Page 3: Clean up your mess!

Piles on the Floor

Please, give me the white T-shirt ?

WHAT???

Page 4: Clean up your mess!

The file pattern: a file for each type of object

Page 5: Clean up your mess!

The Sock Drawer

Please, give me the blue T-shirt, the blue jeans and blue shoes.

Page 6: Clean up your mess!

The folders pattern: a directory for each type of object

Page 7: Clean up your mess!

Modularity

Now any random developer can open the top-level folder and immediately gain insight into what the application does.

The module pattern: a module for each feature

Page 8: Clean up your mess!

Writing Maintainable Code

Page 9: Clean up your mess!

● Is readable● Is consistent● Is predictable● Looks as if it was written by the same person● Is documented

what that mean?

Page 10: Clean up your mess!

Minimizing Globals

Page 11: Clean up your mess!

Patterns

Page 12: Clean up your mess!

● Not reinvent the wheel.● Abstraction● Communication between developers

Why?

Page 13: Clean up your mess!

Writing Clear GIT Commit Message

Page 14: Clean up your mess!
Page 15: Clean up your mess!
Page 16: Clean up your mess!

Told me, Which would you rather read?

Page 17: Clean up your mess!

A diff will tell you what changed, but only the commit message can properly tell you why.

Page 18: Clean up your mess!

The rules of a great git commit message

1. Separate subject from body with a blank line2. Limit the subject line to 50 characters3. Capitalize the subject line4. Do not end the subject line with a period5. Use present tense.6. Don’t use “I”, “Me”, ...7. Use the body to explain what and why vs. how

Page 19: Clean up your mess!

Writing API DOC

Page 21: Clean up your mess!

KEEPCLAM

AND

CLEAN UPYour MESS

Page 22: Clean up your mess!

Any Question?

Page 23: Clean up your mess!

ref:● Scalable code organization in AngularJS ● Code Organization in Large AngularJS and JavaScript Applications ● How to Write a Git Commit Message● Essentials - Chapter 2 / O’REILLY - JavaScript Patterns by Stoyan

Stefanov