Upload
sergey-aganezov
View
138
Download
0
Embed Size (px)
Citation preview
Best coding practices
Programmingworkshop
NO best language out thereBestProgrammingLanguageFor.me
NO best language out thereBestProgrammingLanguageFor.me
Where to write
TextEditor
Where to write
TextEditorIDE
Java / Android -- Intellij IDEAPython -- PyCharmC / C++ -- ClionObj. C / Swift -- App CodeC# -- ReSharper / RiderPhp -- PhpStormRuby -- RubyMineJavascript -- WebStormDBA -- DataGrip
JetBrains studentprogramjetbrains.com/student
How to manage :: VCS
How to manage :: VCS
Themostimportantrule
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
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
Reinventing the wheel
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.
Creational
Creationaldesignpatternsaredesignpatternsthatdealwithobjectcreationmechanisms,tryingtocreateobjectsinamannersuitabletothesituation.Thebasicformofobjectcreationcouldresultindesignproblemsoraddedcomplexitytothedesign.Creationaldesignpatternssolvethisproblembysomehowcontrollingthisobjectcreation.
Software design patterns
Software design patterns
CreationalStructural
StructuralDesignPatternsareDesignPatternsthateasethedesignbyidentifyingasimplewaytorealizerelationshipsbetweenentities.
Software design patterns
CreationalStructuralBehavioral
Behavioraldesignpatternsaredesignpatternsthatidentifycommoncommunicationpatternsbetweenobjectsandrealizethesepatterns.Bydoingso,thesepatternsincreaseflexibilityincarryingoutthiscommunication.
Variableandmethodnaming
1. Useintention-revealingname
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute4. Useonewordperconcept
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute4. Useonewordperconcept5. Useverbsforfunctionnamesandnounsforclassesandattributes
Variableandmethodnaming
1. Useintention-revealingname2. Usepronounceablename3. Don'tbecute4. Useonewordperconcept5. Useverbsforfunctionnamesandnounsforclassesandattributes
Functions
1. Thesmaller,thebetter(butdon’tbecrazy)
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter4. Nosideeffects
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter4. Nosideeffects5. Avoidoutputarguments
Functions
1. Thesmaller,thebetter2. Thefunctionshalldoonlyonething3. Lessargumentsarebetter4. Nosideeffects5. Avoidoutputarguments6. Don’trepeatyourself
Commets
Commets
1. Don’tcommentbadcode,rewriteit
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments4. Warnofconsequencesincomments
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments4. Warnofconsequencesincomments5. Emphasizeimportantpointsincomments
Commets
1. Don’tcommentbadcode,rewriteit2. Ifcodeisreadableyoudon’tneedcomments3. Explainyourintentionincomments4. Warnofconsequencesincomments5. Emphasizeimportantpointsincomments6. Noisecommentsarebad
DEMOTIME!github.com/aganezov/python-samples
NextmeetingofJetBrains GWUMarch24th,2016
LehmanAuditorium(B1270)5:00– 7:00pm
“MasteringPython”
Facebookhttps://www.facebook.com/groups/jetbrains.gwu/