際際滷

際際滷Share a Scribd company logo
Customer Story:
Next Level Coding
DEV 101
Next Level Coding
Presenter: Devin Olson
 azlighthouse works, llc
 Notes and Domino Developer since R3
 Also, Java, COBOL, Delphi, Pascal,
MASM, TASM, etc.
 Consultant, Educator, Mentor,
Curmudgeon
Presenter: Mike McGarel
 Senior Application Developer for Celina
Insurance Group
 Working with Notes/Domino since
version 4.6
 Working on the web since 1996
 CollabSphere site team member
What is
Next Level Coding?
Coding
as
Communication
What does my code
say to the person
reading it?
Machines are
just your
initial audience
Your
next level audience
is
other people
Who are these other people?
 Your team members
 Reviewers
 Testers
 Outside consultants
 Your supervisor
 Your future self
What is your audience looking for?
 Understandable
 Maintainable
 Modular
How you know
youre doing it wrong
WTF?
WTF?WTF?!!!
The Whys of Leveling Up
 Faster fixes and changes
 Smoother testing
 Less code that everyone is afraid
to touch
 Better relationships with co-workers
The Hows of Leveling Up
Format to Communicate
 First impressions
 Language standards
 Company standards
 White space between functions
 Indenting
 Consistency!
Examples of Formatting Standards
 Constants in ALL CAPS
 Constants at beginning of a class or
library
 Braces starting on same line or next line
 Tabs or spaces? (You have to pick one)
Variable and Parameter Names
 Clear
 Meaningful
 Internal consistency
Examples of Variable Names
 quoteSubmittedDate
 quoteApprovedDate
 policyStartDate
 policyEndDate
Another Variable Name Example
The variable result as an internal
return value of a function
String getSomeStringValue() {
String result = ;
// lots of way cool code here
return result;
}
Functions, Methods, and Subroutines
 Accurate, detailed and descriptive
names
 A function should either:
o One important thing
o Groups others together
Example of Function Naming
 Meh:
convertCity(city)
 Better:
convertCityName(city)
 Better Still:
convertCityNameToCityCode(cityName)
Example of Modular Functions
 getToNames()
 getCCNames()
 getBCCNames()
 getSubject()
Classes and Script Libraries
 Accurate and descriptive name
 Part of a consistent name pattern
 Related group of functions
 Small
 Single Responsibility Principle
 Tools in an organized toolbox
 Easy to describe (less than 3 lines)
Class Examples
InsurerPersonalInfoValidation
This class validates the insurers
personal information (name, address,
email, employer) etc. on the quote form.
InsurerVehicleInfoValidation
This class validates the insurers vehicle
information (make, model, VIN, etc.) for
each vehicle.
Error / Exception Handling
 Informative log messages with specific
error and source
(example: method and full path of class)
 Defensive coding
 Never pass nulls
 Tell the user what to do
Testing
 Modular code is easier to test
 Modular code is easier to troubleshoot
 Test Fail early
 Test often
Code Comments
 Goal is to make them unnecessary
Think and Plan
 Versioning
 Reducing Duplication
 Reduce dependencies on outside libraries
 List the dependencies you have up front
 Need balance between duplication and
dependencies.
Next Level Coding
Keep up with Modern Programming
 Time consuming but necessary
 Get familiar with design patterns
 Dont recreate code  use free libraries
 Java examples: StringUtils
 JavaScript: jQuery, React, Vue
 Standard practices
Keep up with Modern UI
 Time consuming but necessary
 Device independence and proliferation
 Responsive layout frameworks
 Bootstrap, Foundation
 Icon Libraries
 Font Awesome, Google Material Design
Costs of Leveling Up
 Takes longer initially
 Different way of thinking
Costs of Not Leveling Up
 Wading through code takes more time
for everyone
 Technical debt
Takeaways
 Communicate intent with every name
 Be consistent!
 Plan your codes structure
 Keep up with standards
 Long and Winding Road
References
 Clean Code by Robert C. Martin
 codinghorror.com (Jeff Atwood)
Thank You!

More Related Content

Next Level Coding

  • 1. Customer Story: Next Level Coding DEV 101
  • 3. Presenter: Devin Olson azlighthouse works, llc Notes and Domino Developer since R3 Also, Java, COBOL, Delphi, Pascal, MASM, TASM, etc. Consultant, Educator, Mentor, Curmudgeon
  • 4. Presenter: Mike McGarel Senior Application Developer for Celina Insurance Group Working with Notes/Domino since version 4.6 Working on the web since 1996 CollabSphere site team member
  • 7. What does my code say to the person reading it?
  • 10. Who are these other people? Your team members Reviewers Testers Outside consultants Your supervisor Your future self
  • 11. What is your audience looking for? Understandable Maintainable Modular
  • 12. How you know youre doing it wrong WTF? WTF?WTF?!!!
  • 13. The Whys of Leveling Up Faster fixes and changes Smoother testing Less code that everyone is afraid to touch Better relationships with co-workers
  • 14. The Hows of Leveling Up
  • 15. Format to Communicate First impressions Language standards Company standards White space between functions Indenting Consistency!
  • 16. Examples of Formatting Standards Constants in ALL CAPS Constants at beginning of a class or library Braces starting on same line or next line Tabs or spaces? (You have to pick one)
  • 17. Variable and Parameter Names Clear Meaningful Internal consistency
  • 18. Examples of Variable Names quoteSubmittedDate quoteApprovedDate policyStartDate policyEndDate
  • 19. Another Variable Name Example The variable result as an internal return value of a function String getSomeStringValue() { String result = ; // lots of way cool code here return result; }
  • 20. Functions, Methods, and Subroutines Accurate, detailed and descriptive names A function should either: o One important thing o Groups others together
  • 21. Example of Function Naming Meh: convertCity(city) Better: convertCityName(city) Better Still: convertCityNameToCityCode(cityName)
  • 22. Example of Modular Functions getToNames() getCCNames() getBCCNames() getSubject()
  • 23. Classes and Script Libraries Accurate and descriptive name Part of a consistent name pattern Related group of functions Small Single Responsibility Principle Tools in an organized toolbox Easy to describe (less than 3 lines)
  • 24. Class Examples InsurerPersonalInfoValidation This class validates the insurers personal information (name, address, email, employer) etc. on the quote form. InsurerVehicleInfoValidation This class validates the insurers vehicle information (make, model, VIN, etc.) for each vehicle.
  • 25. Error / Exception Handling Informative log messages with specific error and source (example: method and full path of class) Defensive coding Never pass nulls Tell the user what to do
  • 26. Testing Modular code is easier to test Modular code is easier to troubleshoot Test Fail early Test often
  • 27. Code Comments Goal is to make them unnecessary
  • 28. Think and Plan Versioning Reducing Duplication Reduce dependencies on outside libraries List the dependencies you have up front Need balance between duplication and dependencies.
  • 30. Keep up with Modern Programming Time consuming but necessary Get familiar with design patterns Dont recreate code use free libraries Java examples: StringUtils JavaScript: jQuery, React, Vue Standard practices
  • 31. Keep up with Modern UI Time consuming but necessary Device independence and proliferation Responsive layout frameworks Bootstrap, Foundation Icon Libraries Font Awesome, Google Material Design
  • 32. Costs of Leveling Up Takes longer initially Different way of thinking
  • 33. Costs of Not Leveling Up Wading through code takes more time for everyone Technical debt
  • 34. Takeaways Communicate intent with every name Be consistent! Plan your codes structure Keep up with standards Long and Winding Road
  • 35. References Clean Code by Robert C. Martin codinghorror.com (Jeff Atwood)