CLEAN WEB
-
Upload
seda-yalcin -
Category
Engineering
-
view
69 -
download
2
Transcript of CLEAN WEB
![Page 1: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/1.jpg)
CLEAN WEB
SEDA YALÇIN & ÖMER TAŞKIN
![Page 2: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/2.jpg)
Outline
ü About Us
ü Meaningful Names
ü Functions
ü Comments
ü Formatting
ü Questions
![Page 3: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/3.jpg)
ABOUT US, ABOUT YOU?
Software Engineer@GG
Seda Yalçın
Software Engineer@GG
Ömer Taşkın
![Page 4: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/4.jpg)
Why Clean Web?
Remembrance
Just for being in a better Web World
Just for being a better programmer
Just for next programmer
Just for us
![Page 5: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/5.jpg)
What is Clean Code about?
If (((!about getting artistic points)
||
(!about being a nerd one))
&&
(about a well disciplined programmer)) {...}
![Page 6: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/6.jpg)
Meaningful Names
What is meaningful name? Small answer of the big question. Small warning of the big danger.
Not your tongue-twister.
Not your shopping list.
Don’t be lazy or shy.
Show your intent!
![Page 7: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/7.jpg)
Meaningful Names
Use intention-revealing names
![Page 8: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/8.jpg)
Meaningful Names
![Page 9: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/9.jpg)
Meaningful Names
VENDETTA!!!
![Page 10: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/10.jpg)
Meaningful Names
Avoid disinformation
![Page 11: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/11.jpg)
Meaningful Names
![Page 12: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/12.jpg)
Meaningful Names
Use pronounceable & searchable names
![Page 13: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/13.jpg)
Meaningful Names
Avoid mental mapping
![Page 14: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/14.jpg)
Meaningful Names
Don’t be cute
Pick One Word per Concept
![Page 15: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/15.jpg)
Functions
Small
![Page 16: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/16.jpg)
Functions
Keep it small
Do one thing
Blocks and Indenting
![Page 17: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/17.jpg)
Functions
Function Arguments
![Page 18: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/18.jpg)
Functions
Don’t repeat yourself Have No Side Effects
![Page 19: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/19.jpg)
Functions
ü Don’t return null ü Causes dirty null checks!
ü Forgotten nullchecks causes NullPointerException!
![Page 20: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/20.jpg)
Functions
ü Don’t return null ü Causes dirty null checks!
ü Forgotten nullchecks causes NullPointerException!
![Page 21: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/21.jpg)
Functions
Prefer Exceptions
![Page 22: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/22.jpg)
Functions
Prefer Exceptions
![Page 23: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/23.jpg)
Functions
Overloading is good but!
![Page 24: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/24.jpg)
Comments
Do not write comment for bad code!
Make it clean!
![Page 25: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/25.jpg)
Comments
TODO Comments
Subversion system and IDE will warn you about TODO comment
![Page 26: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/26.jpg)
Comments
Journal Comments
![Page 27: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/27.jpg)
Comments
Commented Out Codes
if its unnecessary; Don’t fear, delete it!
![Page 28: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/28.jpg)
Comments
Noise Comment
![Page 29: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/29.jpg)
Formatting
Formatting
ü You should have code standards. ü IDE’s have formatting tool. ü You can define special format on IDE
![Page 30: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/30.jpg)
Code Smells
![Page 31: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/31.jpg)
Wake Up!
![Page 32: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/32.jpg)
Here we are!
![Page 33: CLEAN WEB](https://reader034.fdocuments.in/reader034/viewer/2022052509/55a203611a28ab47268b47ea/html5/thumbnails/33.jpg)
References
Clean Code, A Handbook of Agile Software Craftmanship Robert C. Martin
https://class.stanford.edu/c4x/Engineering/CS144/asset/Naming.pdf