best coding practices
TRANSCRIPT
![Page 1: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/1.jpg)
Best coding practices
Programmingworkshop
![Page 2: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/2.jpg)
NO best language out thereBestProgrammingLanguageFor.me
![Page 3: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/3.jpg)
NO best language out thereBestProgrammingLanguageFor.me
![Page 4: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/4.jpg)
![Page 5: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/5.jpg)
![Page 6: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/6.jpg)
Where to write
TextEditor
![Page 7: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/7.jpg)
Where to write
TextEditorIDE
![Page 8: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/8.jpg)
Java / Android -- Intellij IDEAPython -- PyCharmC / C++ -- ClionObj. C / Swift -- App CodeC# -- ReSharper / RiderPhp -- PhpStormRuby -- RubyMineJavascript -- WebStormDBA -- DataGrip
JetBrains studentprogramjetbrains.com/student
![Page 9: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/9.jpg)
How to manage :: VCS
![Page 10: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/10.jpg)
How to manage :: VCS
![Page 11: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/11.jpg)
Themostimportantrule
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
![Page 12: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/12.jpg)
![Page 13: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/13.jpg)
![Page 14: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/14.jpg)
Remember the second law of thermodynamics? It implies that disorder in a system will always increase unless you spend energy and work to
keep it from increasing.
It is hard to write clean code
![Page 15: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/15.jpg)
![Page 16: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/16.jpg)
![Page 17: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/17.jpg)
Reinventing the wheel
![Page 18: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/18.jpg)
Software design patternsDesign patterns can speed up the development process by providing tested, proven development paradigms.
Effective software design requires considering issues that may not become visible until later in the implementation.
Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects familiar with the patterns.
![Page 19: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/19.jpg)
Creational
Creationaldesignpatternsaredesignpatternsthatdealwithobjectcreationmechanisms,tryingtocreateobjectsinamannersuitabletothesituation.Thebasicformofobjectcreationcouldresultindesignproblemsoraddedcomplexitytothedesign.Creationaldesignpatternssolvethisproblembysomehowcontrollingthisobjectcreation.
Software design patterns
![Page 20: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/20.jpg)
Software design patterns
CreationalStructural
StructuralDesignPatternsareDesignPatternsthateasethedesignbyidentifyingasimplewaytorealizerelationshipsbetweenentities.
![Page 21: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/21.jpg)
Software design patterns
CreationalStructuralBehavioral
Behavioraldesignpatternsaredesignpatternsthatidentifycommoncommunicationpatternsbetweenobjectsandrealizethesepatterns.Bydoingso,thesepatternsincreaseflexibilityincarryingoutthiscommunication.
![Page 22: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/22.jpg)
Variableandmethodnaming
1. Useintention-revealingname
![Page 23: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/23.jpg)
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename
![Page 24: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/24.jpg)
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute
![Page 25: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/25.jpg)
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute4. Useonewordperconcept
![Page 26: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/26.jpg)
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute4. Useonewordperconcept5. Useverbsforfunctionnamesandnounsforclassesandattributes
![Page 27: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/27.jpg)
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute4. Useonewordperconcept5. Useverbsforfunctionnamesandnounsforclassesandattributes
![Page 28: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/28.jpg)
Functions
1. Thesmaller,thebetter(butdon’tbecrazy)
![Page 29: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/29.jpg)
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething
![Page 30: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/30.jpg)
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter
![Page 31: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/31.jpg)
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter4. Nosideeffects
![Page 32: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/32.jpg)
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter4. Nosideeffects5. Avoidoutputarguments
![Page 33: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/33.jpg)
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter4. Nosideeffects5. Avoidoutputarguments6. Don’trepeatyourself
![Page 34: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/34.jpg)
Commets
![Page 35: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/35.jpg)
Commets
1. Don’tcommentbadcode,rewriteit
![Page 36: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/36.jpg)
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments
![Page 37: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/37.jpg)
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments
![Page 38: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/38.jpg)
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments4. Warnofconsequencesincomments
![Page 39: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/39.jpg)
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments4. Warnofconsequencesincomments5. Emphasizeimportantpointsincomments
![Page 40: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/40.jpg)
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments4. Warnofconsequencesincomments5. Emphasizeimportantpointsincomments6. Noisecommentsarebad
![Page 41: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/41.jpg)
DEMOTIME!github.com/aganezov/python-samples
![Page 42: Best coding practices](https://reader031.vdocuments.mx/reader031/viewer/2022021919/587a60ad1a28ab520b8b77bd/html5/thumbnails/42.jpg)
NextmeetingofJetBrains GWUMarch24th,2016
LehmanAuditorium(B1270)5:00– 7:00pm
“MasteringPython”
Facebookhttps://www.facebook.com/groups/jetbrains.gwu/