SlideShare a Scribd company logo
1 of 67
Download to read offline
Huge Web Apps
daniel.steigerwald.cz
● independent software gardener
● web applications consultant and trainer
● Google Developer Expert
● libertarian svobodni.cz
About Me
What is a Huge App?
sooner or later
The Pain.
Symptoms
● fixing bugs creates new bugs
● rotten code
● developers paralyzed by fear
● technical debts
● reinventing the wheel
● perpetual rewriting
= stress driven development
Remedies
● optional static typing
● user interface frameworks
● clean code
● clean architecture
● good infrastructure
● unit tests
● senior developers :-)
Optional Static Typing
dynamic versus static
Keeping Your Code in Check!
Make it hard to do the wrong thing.
Makes code more readable.
function(duck) { // which duck?
duck.quack();
}
Makes code more robust.
function(duck) {
duck.quack(); // does quack?
}
No JavaScript?
The king is dead, long live the king!
Closure, Dart, TypeScript
Born to be wild tamed.
Google Closure
That's how Google build apps.
function fn(duck) {
duck.quack();
}
/**
* @param {Duck} duck
*/
function fn(duck) {
duck.quack();
}
Dart
That's how Google will build apps.
fn(duck) {
duck.quack();
}
fn(Duck duck) {
duck.quack();
}
TypeScript
Microsoft did the right thing.
function(duck) {
duck.quack();
}
function(duck: Duck) {
duck.quack();
}
github.com/borisyankov/DefinitelyTyped
fixing legacy code
Ace Cloud9 Editor AmCharts AngularJS Arbiter async Backbone.js Backbone Relational
Bootbox Bootstrap bootstrap-notify bootstrap.datepicker Box2DWeb Breeze Browser Harness
CasperJS Cheerio Chosen Chrome CodeMirror Commander d3.js docCookies domo dust
EaselJS ember.js EpicEditor expect.js Express Ext JS Fabric.js Fancybox File API: Directories
and System File API: Writer Finite State Machine Firebase Firefox FlexSlider Foundation
FPSMeter FullCalendar Gamepad glDatePicker GoJS GreenSock Animation Platform Grunt JS
Google API Client Google App Engine Channel API GoogleMaps Google Geolocation Google
Page Speed Online API Google Translate API Google Url Shortener Hammer.js Handlebars
Highcharts highlight.js History.js Humane.js i18next iCheck Impress.js Intl iScroll jake Jasmine
Jasmine-jQuery JointJS jQRangeSlider jQuery jQuery Mobile jQuery UI jQuery.Address jQuery.
areYouSure jQuery.autosize jQuery.BBQ jQuery.contextMenu jQuery.clientSideLogging jQuery.
Colorbox jQuery.Cookie jQuery.Cycle jQuery.dataTables jQuery.dynatree jQuery.Flot jQuery.
form jQuery.Globalize jQuery.gridster jQuery.jNotify jQuery.noty jQuery.pickadate jQuery.
payment jQuery.scrollTo jQuery.simplePagination jquery.superLink jQuery.timeago jQuery.
Timepicker jQuery.TinyCarousel jQuery.TinyScrollbar jQuery.Transit jQuery.Validation jQuery.
Watermark jScrollPane JSDeferred JSONEditorOnline jStorage JWPlayer KeyboardJS
Knockback Knockout.js Knockout.DeferredUpdates Knockout.ES5 Knockout.Mapping
Knockout.Postbox Knockout.Validation Knockout.Viewmodel ko.editables KoLite Leaflet
Libxmljs ladda Levelup linq.js Livestamp.js Logg Marked Meteor Modernizr Moment.js
MongoDB Mousetrap Mustache.js Node.js node_redis node-ffi node_zeromq node-sqlserver
Numeral.js Parallel.js PDF.js Persona PhantomJS PhoneGap PixiJS Platform PouchDB
PreloadJS QUnit Raven.js Rickshaw Restify Royalslider Rx.js Raphael Restangular require.js
Sammy.js Select2 Sencha Touch SharePoint SignalR Sinon SlickGrid socket.io SockJS
SoundJS Spin stripe Store.js Sugar Swiper SwipeView Tags Manager Teechart three.js Toastr
trunk8 TweenJS tween.js twitter-bootstrap-wizard Ubuntu Unity Web API Underscore.js
Underscore.js Underscore-ko.js UUID.js Viewporter Vimeo WebRTC WinJS WinRT YouTube
YouTube Analytics API YouTube Data API Zepto.js Zynga Scroller ZeroClipboard
User Interface
Beyond the jQuery Backbone.
Why Backbone is not enough?
It doesn’t aspire to be anything more than a
lightweight library for models and collections.
Why Backbone is not enough?
Default Backbone view is simply too simple.
todomvc.com
Handlebars, Mustache, Underscore templates, Dust,
Jade and many others...
HTML templates based only on
string concatenation are
obsolete.
Don't hold state in DOM.
Use DOM only as app state projection.
Partial DOM updates sucks.
this.$('#filters li a')
.removeClass('selected')
.filter('[href="#/' + (app.TodoFilter || '') + '"]')
.addClass('selected');
Say no to boilerplate code.
especially for view updates
Angular, Ember, React
view updates done well
/** @jsx React.DOM */
var HelloMessage = React.createClass({
render: function() {
return <div>{'Hello ' + this.props.name}</div>;
}
});
React.renderComponent(<HelloMessage name="John" />, el);
Facebook React
var Nav, Profile;
// Input (JSX):
var app =
<Nav color="blue">
<Profile>click</Profile>
</Nav>;
// Output (JS):
var app = Nav({color:"blue"}, Profile(null, "click"));
Facebook React
este.demos.react.todoApp = este.react.create
render: ->
@div [
este.demos.react.todoList 'items': @state['items']
if @state['items'].length
@p "#{@state['items'].length} items."
@form 'onSubmit': @onFormSubmit, [
@input
'onChange': @onChange
'value': @state['text']
@button "Add ##{@state['items'].length + 1}"
]
]
Facebook React in Este.js
Angular/Ember vs. React
<HTML> vs. code()
Angular/Ember vs. React
Declarative programming doesn't work. Sooner or
later, all declarative languages ended up Turing-
complete, even HTML+CSS.
Separating your markup and logic, that’s not real
separation of concerns. That’s separation of
technologies.
React Great Idea
Angular vs. React
server render ready*
SVG/VML/Canvas render ready
Wolfenstein render ready**
* no, Phantom.js is not a solution, it's hideous hack
** www.petehunt.net/wolfenstein3D-react/wlf3d.html
React/Angular + Backbone
separate model from view
Clean Code and Architecture
The Fewer Magic the Better
explicit code over clever code
How to Structure App?
By features. Always.
/controllers
/directives
/services
/filters
/views
/enumerations
/classes
/wtf's?
Wrong
/users
/products
/orders
/controller.js
/model.js
/collection.js
/process.js
/delegate.js
Good
Ensure you have a good style,
good source code style.
JSHint, Coffeelint,
Closure Lint (for code style nacist)
SOLID Homework
Single responsibility, Open-closed, Liskov substitution,
Interface segregation and Dependency inversion.
en.wikipedia.org/wiki/SOLID_(object-oriented_design)
cleancoders.com
MVC
man versus controller
Separated Model
Always.
Componentization
"The secret to building large apps is never build
large apps. Break your application into small pieces.
Then, assemble those testable, bite-sized pieces
into your big application." Justin Meyer
Components or Views?
Dependency Injection
or as it's also known, passing arguments
Service Locator
code coupling FML
How to test this?
function fire() {
Wolf.sound.play();
...
}
Is sound instance ready?
function fire() {
Wolf.sound.play();
...
}
Better.
function fire() {
this.sound.play();
...
}
Fine Service Locator
code coupling FTW!
// side effects free
Math.abs x
// intentionally coupled code
new Coordinate x, y
// constants
Math.PI
Fine Service Locators
Angular developers can check Facebook now.
App Logic and App Wiring
Separation
Good Infrastructure
package management, module loader, source code
linter, task runner
Require.js, Bower, Component.io, Grunt.js, Browserify,
ECMAScript 6 modules… etc.
Good Infrastructure
Unit Tests
Why and How.
Why to Write Unit Tests?
If you don't know why, don't write them!
How to Structure Unit Tests
Arrange, Act, Assert.
Human
sorry, no patterns for that
Except…
Don't cheat and have fun.
Thank you
daniel.steigerwald.cz

More Related Content

What's hot

Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOMDaiwei Lu
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshopStacy Goh
 
A Closer Look At React Native
A Closer Look At React NativeA Closer Look At React Native
A Closer Look At React NativeIan Wang
 
Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)ColdFusionConference
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereLaurence Svekis ✔
 
Building Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltBuilding Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltQuickBase, Inc.
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 
Building Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiBuilding Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiJared Faris
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in ReactTalentica Software
 
Custom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for AndroidCustom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for Androidmhant
 
Journey to JavaScript (from C#)
Journey to JavaScript (from C#)Journey to JavaScript (from C#)
Journey to JavaScript (from C#)Ed Charbeneau
 
Breaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and ReactBreaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and ReactDejan Glozic
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core ConceptsDivyang Bhambhani
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2Dhyego Fernando
 

What's hot (20)

Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
 
learning react
learning reactlearning react
learning react
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshop
 
Angular 2 - Better or worse
Angular 2 - Better or worseAngular 2 - Better or worse
Angular 2 - Better or worse
 
A Closer Look At React Native
A Closer Look At React NativeA Closer Look At React Native
A Closer Look At React Native
 
Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
 
Angular vs. React
Angular vs. ReactAngular vs. React
Angular vs. React
 
Rails + Webpack
Rails + WebpackRails + Webpack
Rails + Webpack
 
Building Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltBuilding Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan Diebolt
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
React js basics
React js basicsReact js basics
React js basics
 
Building Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiBuilding Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript Spaghetti
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in React
 
Custom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for AndroidCustom HTML5-Native Bridge for Android
Custom HTML5-Native Bridge for Android
 
Journey to JavaScript (from C#)
Journey to JavaScript (from C#)Journey to JavaScript (from C#)
Journey to JavaScript (from C#)
 
Breaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and ReactBreaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and React
 
Angular 2 vs React
Angular 2 vs ReactAngular 2 vs React
Angular 2 vs React
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
 

Viewers also liked

Tradesto Corporation Czech Presentation
Tradesto Corporation Czech PresentationTradesto Corporation Czech Presentation
Tradesto Corporation Czech PresentationAutoRebateForeX
 
Egon Bondy: Útěcha z ontologie 1
Egon Bondy: Útěcha z ontologie 1Egon Bondy: Útěcha z ontologie 1
Egon Bondy: Útěcha z ontologie 1Daniel Szabó
 
architekture.com, inc.
architekture.com, inc.architekture.com, inc.
architekture.com, inc.Videoguy
 
Proč by vaše značka měla mít mapu kontaktních bodů
Proč by vaše značka měla mít mapu kontaktních bodůProč by vaše značka měla mít mapu kontaktních bodů
Proč by vaše značka měla mít mapu kontaktních bodůJan Habich
 
Papier, etikety
Papier, etiketyPapier, etikety
Papier, etiketyterrySK
 

Viewers also liked (8)

Emailing - UNIFER
Emailing - UNIFEREmailing - UNIFER
Emailing - UNIFER
 
UNOR 2013
UNOR 2013UNOR 2013
UNOR 2013
 
Tradesto Corporation Czech Presentation
Tradesto Corporation Czech PresentationTradesto Corporation Czech Presentation
Tradesto Corporation Czech Presentation
 
Egon Bondy: Útěcha z ontologie 1
Egon Bondy: Útěcha z ontologie 1Egon Bondy: Útěcha z ontologie 1
Egon Bondy: Útěcha z ontologie 1
 
architekture.com, inc.
architekture.com, inc.architekture.com, inc.
architekture.com, inc.
 
Nevěra - Barcamp Praha 2013
Nevěra - Barcamp Praha 2013Nevěra - Barcamp Praha 2013
Nevěra - Barcamp Praha 2013
 
Proč by vaše značka měla mít mapu kontaktních bodů
Proč by vaše značka měla mít mapu kontaktních bodůProč by vaše značka měla mít mapu kontaktních bodů
Proč by vaše značka měla mít mapu kontaktních bodů
 
Papier, etikety
Papier, etiketyPapier, etikety
Papier, etikety
 

Similar to Huge web apps web expo 2013

Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Modular Web Applications With Netzke
Modular Web Applications With NetzkeModular Web Applications With Netzke
Modular Web Applications With Netzkenetzke
 
Web polyglot programming
Web polyglot programmingWeb polyglot programming
Web polyglot programmingDmitry Buzdin
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4alexsaves
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiJackson Tian
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.jsguileen
 
How to bake an app in Dart and Polymer
How to bake an app in Dart and PolymerHow to bake an app in Dart and Polymer
How to bake an app in Dart and PolymerJana Moudrá
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016Matt Raible
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSAlberto Paro
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsScala Italy
 
JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureSimon Willison
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016Matt Raible
 
"Frameworks in 2015" Андрей Листочкин
"Frameworks in 2015" Андрей Листочкин"Frameworks in 2015" Андрей Листочкин
"Frameworks in 2015" Андрей ЛисточкинFwdays
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistMark Fayngersh
 
JSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph PicklJSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph PicklChristoph Pickl
 

Similar to Huge web apps web expo 2013 (20)

Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Modular Web Applications With Netzke
Modular Web Applications With NetzkeModular Web Applications With Netzke
Modular Web Applications With Netzke
 
Web polyglot programming
Web polyglot programmingWeb polyglot programming
Web polyglot programming
 
jQuery
jQueryjQuery
jQuery
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
 
Mlocjs buzdin
Mlocjs buzdinMlocjs buzdin
Mlocjs buzdin
 
How to bake an app in Dart and Polymer
How to bake an app in Dart and PolymerHow to bake an app in Dart and Polymer
How to bake an app in Dart and Polymer
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJS
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.js
 
JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big Picture
 
Node.JS briefly introduced
Node.JS briefly introducedNode.JS briefly introduced
Node.JS briefly introduced
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
 
"Frameworks in 2015" Андрей Листочкин
"Frameworks in 2015" Андрей Листочкин"Frameworks in 2015" Андрей Листочкин
"Frameworks in 2015" Андрей Листочкин
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
 
JSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph PicklJSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph Pickl
 

Huge web apps web expo 2013