vs single page app design with angularjs
TRANSCRIPT
SINGLE PAGE APP DESIGN WITH ANGULERJSTHE WORLD AIN’T WHAT IT USED TO BE…
Copyright © 2015, Stacey Vetzal
Copyright © 2015, Stacey Vetzal
STACEY VETZAL
• Founder of Mojility Inc.
• First computer, age 10
• hardware and software hacker for 35 years
• Frustrated and embarrassed with the state of software development in the industry
• I am platform, language, and technology agnostic
• I have strong opinions, but they are loosely held
Copyright © 2015, Stacey Vetzal
HACKER
IETF RFC 1392
hacker (n):
A person who delights in having an intimate understanding of the internal workings of a system, computers and computer networks in particular. The term is often misused in a pejorative context, where "cracker" would be the correct term.
Copyright © 2015, Stacey Vetzal
CRAFTSMANI owe much of who I am to my father. When I was a child, I would go to my father with simple projects, and I would watch him build them, usually of wood, but sometimes other materials. He is an incredible craftsman, brings beauty out of the mundane and gives it a purpose. I strive to honour that in my own craft, which is software development. It is a long road, but I believe worthwhile, as where wood used to touch every aspect of our lives in eras past, now there is software.
Copyright © 2015, Stacey Vetzal
TODAY
Today we are better than yesterday, but not as good as we will be tomorrow.
Today our tools are better than they were yesterday, but not as good as they will be tomorrow.
We build software today.
Copyright © 2015, Stacey Vetzal
THE WHITE BELT
• … You are walking comfortably on a plateau of competence. Your colleagues recognize your abilities and call on you to help them solve problems in your area of expertise. You have pride in your skills.
• … it seems somehow harder than it was before to acquire new skills… You fear that your personal development may have stalled.
Copyright © 2015, Stacey Vetzal
- Yoda, The Empire Strikes Back
“You must unlearn what you have learned.”
THE WHITE BELT
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN
• Tests pass
• Express Intent
• Don’t Repeat Yourself
• Small
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: TESTS PASS
“Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t
matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change
the behaviour of our code quickly and verifiably.”
- Michael C. Feathers, Working Effectively with Legacy Code
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: TESTS PASS
• What kinds of tests do you do?
• Exploratory?
• Story or script driven?
• Automated?
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: EXPRESSES INTENT
The Principle of Least Astonishment
“The result of performing some operation should be
obvious, consistent, and predictable, based upon the name of the operation and
other clues.”
-Ward Cunningham, from c2
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: EXPRESSES INTENT
• There are two hard things in computer science
• Cache invalidation
• Naming things
• Off-by-one errors
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: DON’T REPEAT YOURSELF
“…every piece of system knowledge should have one authoritative, unambiguous representation… A system’s
knowledge is far broader than just its code… database schemas, test
plans, the build system, even documentation.”
- Dave Thomas, co-author of The Pragmatic Programmer on Orthogonality and the DRY
Principle.
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: DON’T REPEAT YOURSELF
The Single Responsibility Principle
“A class should only have one reason to change.”
“Responsibilities have profound long-term effects on the
maintainability and flexibility of software.”
- Robert C. Martin, author Clean Code, Principles of Object
Oriented Design
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: SMALL
- Mark Twain
“I didn’t have time to write a
short letter, so I wrote a long one instead.”
Copyright © 2015, Stacey Vetzal
4 RULES OF SIMPLE DESIGN: SMALL
• What does SMALL mean?
• Lines of code?
• Classes?
• Functions?
• # of function call arguments?
• How do you MEASURE it?
Copyright © 2015, Stacey Vetzal
THE BIRTH AND DEATH OF JAVASCRIPT
• Gary Bernhardt, Destroy All Software
• https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript
• If you have any concerns about the legitimacy of JavaScript as a programming language
Copyright © 2015, Stacey Vetzal
THE BIRTH AND DEATH OF JAVASCRIPT
• JavaScript: The Good Parts by Douglas Crockford, 2008
• Generally considered the book that kicked off the JS legitimacy movement
• Node.JS, 2009
• Today a very strong foundation of intelligence and maturity working in communities using JavaScript
• JavaScript Jabber, DevChat.tv, excellent weekly podcast, currently at episode 154
Copyright © 2015, Stacey Vetzal
BREAKING APART WEB APPLICATIONS
• MVC? WTF?
• Most of what you’ve been told are MVC frameworks are considered Model2 frameworks
• Still stemming from classic JSP, ASP and PHP architectures
• MVC is really not that informative about good app architecture.
Copyright © 2015, Stacey Vetzal
WHY ANGULARJS?
• Why not?
• Tons of attention, and a tiny little backer called Google
• Provides good flexibility on how you assemble the browser-side of your apps
• Promotes modular design, and supports good testing practices
Copyright © 2015, Stacey Vetzal
TRY IT YOURSELF
• The free Google sponsored course on CodeSchool is a bit slow and corny for experienced developers, but gives you an effective and concise introduction to the core of the framework.
• http://campus.codeschool.com/courses/shaping-up-with-angular-js/intro