SlideShare a Scribd company logo
FROM THEORY
TO PRACTICE
unspoken truth of starting web project
brought to you
by Sergey Bolshchikov
WHAT'S YOUR NAME, U SAID?
Front end Developer @ New ProImage
Co-organizer @ Ember-IL Meetup
Graduate Student @ Technion, IM&E
Web: http://bolshchikov.net
Blog: http://blog.bolshchikov.net
Github: https://github.com/bolshchikov
OUTLINE
1. Understand the destiny
2. Organize your life
3. Choose your comrades
4. Lay out your way
5. Add the make up
6. Bring some action
7. Coding
UNDERSTANDING THE DESTINY
DESTINY
DESTINY :: GOAL
The goal should formulate the main purpose or idea of future
project. It can be describe by one sentence or two sentences,
e.g.
“Create user-friendly web store for
selling fruits and vegetables”
DESTINY :: FUNCTIONALITY
● Login
● Display a list of available items with prices
● Display detailed information per item
● Be able to add the item to the basket
● Calculate the overall sum
● Send the order
DESTINY :: STRUCTURE
ORGANIZE YOUR LIFE
ORGANIZATION
Division by type
Separation of concerns
Complex
HTML5BOILERPLATE
Project started by Paul Irish (Google) for keepin'
best techniques for web project
http://html5boilerplate.com/
● Code structure
● File template (html, css, js)
● Comes with libraries: jQuery, Modernizr
● and other
CHOOSE YOUR COMRADES
COMRADES
How? Checklist:
○ Amount of watchers in Github (big)
○ Amount of forks on Github (medium)
○ Amount of issues on Github (small)
○ Amount of results on Stackoverflow
○ Amount of votes on Stackoverflow
COMRADES :: DOM
Why? Cross browser API is not the same
What? Relieves you from pain developments
Who? jQuery, Zepto, MooTools
Save yourself some time
DO NOT WRITE YOUR OWN
COMRADES :: UI & WIDGETS
What?
● Splitter
● Tree
● Accordion
● Context menu
● Dropdown
● Charts
● Calendar
● Grids
● Dialogs
Who?
● Twitter Bootstrap
● jQueryUI
● KendoUI
● Wijmo Components
● jqWidgets
● Dojo
COMRADES :: JS FRAMEWORKS
Why? JS mess, spaghetti code
What? Clean separation of concerns
Who? EmberJS, Backbone, Angular, etc.
How? Write test programs in each of them
http://todomvc.com/
LAYOUT YOUR WAY
WRITING APPROACH
LAYOUT :: LAYOUT 1 :: HTML
<header></header>
<div id="main"></div>
<footer></footer>
http://jsbin.com/anafap/9/edit
LAYOUT :: LAYOUT 2 :: HTML
<div id="left"></div>
<div id="center"></div>
<div id="right"></div>
http://jsbin.com/asehas/7/edit
LAYOUT :: LAYOUT 3 :: HTML
<header></header>
<div id="container">
<div id="left"></div>
<div id="right"></div>
</div>
<footer></footer>
http://jsbin.com/uvafam/6/edit
ADD THE MAKE UP
CSS
CSS is a super power
CSS :: SELECTORS
Selector Description Example
*
Matches any element.
E Matches any E element (i.e., an
element of type E).
a
E F Matches any F element that is a
descendant of an E element.
div a
E > F Matches any F element that is a
child of an element E.
div > a
E:first-child Matches element E when E is the
first child of its parent.
li:first-child
E:link
E:visited
Matches element E if E is the source
anchor of a hyperlink of which the
target is not yet visited (:link) or
already visited (:visited).
a:link
a:visited
CSS :: SELECTORS (cont.)
Selector Description Example
E:active
E:hover
E:focus
Matches E during certain user
actions.
a:active
a:hover
a:focus
E + F Matches any F element immediately
preceded by a sibling element E.
div + div
E[foo] Matches any E element with the
"foo" attribute set (whatever the
value).
div[data-id]
E[foo="warning"] Matches any E element whose "foo"
attribute value is exactly equal to
"warning".
input[type=”text”]
DIV.warning Language specific. (In HTML, the
same as DIV[class~="warning"].)
div.navigation
E#myid Matches any E element with ID equal
to "myid".
div#main
CSS :: BOX MODEL
CSS :: MORE
● display: [none, block, inline, table, inline-
block...],
● position: [absolute, fixed, relative],
● top: [number],
● left: [number],
● float: [left, right, none]
LAYOUT :: LAYOUT 1 :: HTML + CSS
HTML
<header></header>
<div id="main"></div>
<footer></footer>
CSS
header, footer {
border: 1px solid red;
height : 55px;
background-color: grey;
border-radius: 7px;
}
#main {
border-radius: 7px;
border: 1px solid red;
background-color: grey;
height: 90px;
margin: 10px 0 10px 0;
}
http://jsbin.com/anafap/7/edit
LAYOUT :: LAYOUT 2 :: HTML + CSS
HTML
<div id="left"></div>
<div id="center"></div>
<div id="right"></div>
CSS
div {
background-color: grey;
border-radius: 7px;
border: 1px solid red;
float: left;
margin: 0 5px 0 5px;
}
#left, #right {
width: 150px;
height: 250px;
}
#center {
width: 275px;
height: 750px; }http://jsbin.com/asehas/6/edit
LAYOUT :: LAYOUT 3 :: HTML + CSS
HTML
<header></header>
<div id="container">
<div id="left"></div>
<div id="right"></div>
</div>
<footer></footer>
CSS
#left {
width: 28%;
background-color: grey;
border: 1px solid red;
border-radius: 7px;
margin-right: 2%;
float: left;
}
#right {
width: 70%;
background-color: grey;
border: 1px solid red;
border-radius: 7px;
margin-left: 30%
}
http://jsbin.com/uvafam/6/edit
TIME TO CODE
JAVASCRIPT
"JavaScript is the Assembly language of WEB"
- Erik Meijer, Dutch computer scientist
JQUERY :: SELECTORS
$(selector).method()
For example, $(‘#list’) will return the elements which has the attribute id=”list”.
For more, see http://api.jquery.com/category/selectors/.
JQUERY :: DOM MANIPULATIONS
● $(selector).html()
● $(selector).append(html)
● $(selector).remove()
● $(selector).attr('myAttr', 'value')
● $(selector).removeAttr('myAttr')
● $(selector).css('width', 40)
● $(selector).addClass('my-class')
● $(selector).removeClass('my-class')
● $(selector).text()
● $(selector).val()
JQUERY :: AJAX
$.ajax({
url: ‘/api/posts’
type: ‘POST’,
data: {},
success: function () {},
error: function () {}
});
JQUERY :: EVENTS
● $(selector).click(function () {})
● $(selector).dblclick(function () {})
● $(selector).mousedown(function () {})
● $(selector).mouseup(function () {})
● $(selector).mouseover(function () {})
● $(selector).mouseenter(function () {})
● $(selector).mouseleave(function () {})
● $(selector).on(eventName,
function () {})
● $(selector).off(eventName,
function () {})
JAVASCRIPT :: GUIDELINES
Do not populate global space
Use namespaces: create one global variable, e.g. name of your app, and store
everything there.
window.YUI = {};
YUI.version = ‘0.3’,
YUI.start = function () {};
JAVASCRIPT :: GUIDELINES
Write JavaScript only in js file
Do NOT write it in HTML:
<a class=”add” onclick=”function () {}”>Add</a>
Instead use jQuery and register the click handler:
$(‘.add’).on(‘click’, function () {});
JAVASCRIPT :: GUIDELINES
Write small functions
JAVASCRIPT :: GUIDELINES
Write comments
QUESTIONS?

More Related Content

What's hot (20)

PDF
Introduction to web components
Marc Bächinger
 
PPT
PHP 5 Sucks. PHP 5 Rocks.
Adam Trachtenberg
 
PDF
High-Quality JavaScript
Marc Bächinger
 
PDF
Rails 3: Dashing to the Finish
Yehuda Katz
 
PPT
jQuery For Developers Stack Overflow Dev Days Toronto
Ralph Whitbeck
 
PDF
Netvibes UWA workshop at ParisWeb 2007
Netvibes
 
PDF
Introduction to Using PHP & MVC Frameworks
Gerald Krishnan
 
PDF
Developing large scale JavaScript applications
Milan Korsos
 
PPTX
JavaScript Performance Patterns
Stoyan Stefanov
 
PDF
More Secrets of JavaScript Libraries
jeresig
 
PPTX
Intro to jQuery
Eric Steinborn
 
KEY
Plone Interactivity
Eric Steele
 
PDF
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Matthew Davis
 
PPT
KMUTNB - Internet Programming 4/7
phuphax
 
PPTX
Untangling8
Derek Jacoby
 
PDF
&lt;img src="../i/r_14.png" />
tutorialsruby
 
PDF
BDD - Writing better scenario
Arnauld Loyer
 
PPT
WordPress and Ajax
Ronald Huereca
 
PDF
lect9
tutorialsruby
 
PDF
tut0000021-hevery
tutorialsruby
 
Introduction to web components
Marc Bächinger
 
PHP 5 Sucks. PHP 5 Rocks.
Adam Trachtenberg
 
High-Quality JavaScript
Marc Bächinger
 
Rails 3: Dashing to the Finish
Yehuda Katz
 
jQuery For Developers Stack Overflow Dev Days Toronto
Ralph Whitbeck
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes
 
Introduction to Using PHP & MVC Frameworks
Gerald Krishnan
 
Developing large scale JavaScript applications
Milan Korsos
 
JavaScript Performance Patterns
Stoyan Stefanov
 
More Secrets of JavaScript Libraries
jeresig
 
Intro to jQuery
Eric Steinborn
 
Plone Interactivity
Eric Steele
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Matthew Davis
 
KMUTNB - Internet Programming 4/7
phuphax
 
Untangling8
Derek Jacoby
 
&lt;img src="../i/r_14.png" />
tutorialsruby
 
BDD - Writing better scenario
Arnauld Loyer
 
WordPress and Ajax
Ronald Huereca
 
tut0000021-hevery
tutorialsruby
 

Similar to Web Projects: From Theory To Practice (20)

PDF
Build an App with JavaScript & jQuery
Aaron Lamphere
 
PDF
Intro to mobile web application development
zonathen
 
PDF
bawawjspdx082117
Thinkful
 
PDF
Web app-la-jan-2
Thinkful
 
PDF
Baawjsajq109
Thinkful
 
PDF
jQuery (MeshU)
jeresig
 
PPT
Intro to-html-backbone
zonathen
 
PDF
Front-End Frameworks: a quick overview
Diacode
 
PDF
Get Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Int...
rugumazaj88
 
PDF
Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Interac...
mouhlirusake
 
PDF
Deck 6-456 (1)
Justin Ezor
 
PDF
jQuery for beginners
Siva Arunachalam
 
PDF
Build an App with JavaScript and jQuery - LA - July 18
Thinkful
 
PPTX
jQuery Conference Austin Sept 2013
dmethvin
 
KEY
User Interface Development with jQuery
colinbdclark
 
PPTX
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Shane Church
 
PDF
fuser interface-development-using-jquery
Kostas Mavridis
 
PDF
Write Less Do More
Remy Sharp
 
PPTX
025444215.pptx
RiyaJenner1
 
PDF
Architektura html, css i javascript - Jan Kraus
Women in Technology Poland
 
Build an App with JavaScript & jQuery
Aaron Lamphere
 
Intro to mobile web application development
zonathen
 
bawawjspdx082117
Thinkful
 
Web app-la-jan-2
Thinkful
 
Baawjsajq109
Thinkful
 
jQuery (MeshU)
jeresig
 
Intro to-html-backbone
zonathen
 
Front-End Frameworks: a quick overview
Diacode
 
Get Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Int...
rugumazaj88
 
Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Interac...
mouhlirusake
 
Deck 6-456 (1)
Justin Ezor
 
jQuery for beginners
Siva Arunachalam
 
Build an App with JavaScript and jQuery - LA - July 18
Thinkful
 
jQuery Conference Austin Sept 2013
dmethvin
 
User Interface Development with jQuery
colinbdclark
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Shane Church
 
fuser interface-development-using-jquery
Kostas Mavridis
 
Write Less Do More
Remy Sharp
 
025444215.pptx
RiyaJenner1
 
Architektura html, css i javascript - Jan Kraus
Women in Technology Poland
 
Ad

More from Sergey Bolshchikov (13)

PDF
Onboarding for Software Engineers Done Right
Sergey Bolshchikov
 
PDF
Pragmatic React Workshop
Sergey Bolshchikov
 
PDF
Microservices on the client side
Sergey Bolshchikov
 
PDF
ES2015 Quiz
Sergey Bolshchikov
 
PDF
Talking code: How To
Sergey Bolshchikov
 
PPTX
Values & Culture of Continuous Deliver
Sergey Bolshchikov
 
PDF
Protractor: Tips & Tricks
Sergey Bolshchikov
 
PDF
Continuous Delivery for Front-End Engineers
Sergey Bolshchikov
 
PDF
Зачем нужен EmberJS, если мне хвататет jQuery
Sergey Bolshchikov
 
PDF
Ember Reusable Components and Widgets
Sergey Bolshchikov
 
PDF
AngularJS Basics with Example
Sergey Bolshchikov
 
PDF
Backbone Basics with Examples
Sergey Bolshchikov
 
PDF
JS Single-Page Web App Essentials
Sergey Bolshchikov
 
Onboarding for Software Engineers Done Right
Sergey Bolshchikov
 
Pragmatic React Workshop
Sergey Bolshchikov
 
Microservices on the client side
Sergey Bolshchikov
 
ES2015 Quiz
Sergey Bolshchikov
 
Talking code: How To
Sergey Bolshchikov
 
Values & Culture of Continuous Deliver
Sergey Bolshchikov
 
Protractor: Tips & Tricks
Sergey Bolshchikov
 
Continuous Delivery for Front-End Engineers
Sergey Bolshchikov
 
Зачем нужен EmberJS, если мне хвататет jQuery
Sergey Bolshchikov
 
Ember Reusable Components and Widgets
Sergey Bolshchikov
 
AngularJS Basics with Example
Sergey Bolshchikov
 
Backbone Basics with Examples
Sergey Bolshchikov
 
JS Single-Page Web App Essentials
Sergey Bolshchikov
 
Ad

Recently uploaded (8)

PPTX
Free Preparation and Survival Apps that can save your life
Bob Mayer
 
PPTX
Positive Role Modeling for Personal Growth.pptx
StrengthsTheatre
 
PDF
UCSP-Quarter1_M5.pdf POLITICS AND POLITICL
jaredcagampan86
 
PPTX
AAM - NQAS Orientation CHALLANGES & SOLUTION 24 & 25 FEB24.pptx
minikashyap9528
 
PPTX
Impact_of_Power_Outages_Presentation.pptx
mansisingh27077
 
PPTX
UP SDRF History English.pptxdownload it is easy to understand
aanyatiwari1015
 
PPTX
LESSON 1 IN PHILOSOPHY- INTRODUCTION TO PHILOSOPHY
MaimaiAlleraAcpal
 
PPTX
Presentatiof local anaesthesiaonon1.pptx
harmanjotsingh483731
 
Free Preparation and Survival Apps that can save your life
Bob Mayer
 
Positive Role Modeling for Personal Growth.pptx
StrengthsTheatre
 
UCSP-Quarter1_M5.pdf POLITICS AND POLITICL
jaredcagampan86
 
AAM - NQAS Orientation CHALLANGES & SOLUTION 24 & 25 FEB24.pptx
minikashyap9528
 
Impact_of_Power_Outages_Presentation.pptx
mansisingh27077
 
UP SDRF History English.pptxdownload it is easy to understand
aanyatiwari1015
 
LESSON 1 IN PHILOSOPHY- INTRODUCTION TO PHILOSOPHY
MaimaiAlleraAcpal
 
Presentatiof local anaesthesiaonon1.pptx
harmanjotsingh483731
 

Web Projects: From Theory To Practice

  • 1. FROM THEORY TO PRACTICE unspoken truth of starting web project brought to you by Sergey Bolshchikov
  • 2. WHAT'S YOUR NAME, U SAID? Front end Developer @ New ProImage Co-organizer @ Ember-IL Meetup Graduate Student @ Technion, IM&E Web: http://bolshchikov.net Blog: http://blog.bolshchikov.net Github: https://github.com/bolshchikov
  • 3. OUTLINE 1. Understand the destiny 2. Organize your life 3. Choose your comrades 4. Lay out your way 5. Add the make up 6. Bring some action 7. Coding
  • 6. DESTINY :: GOAL The goal should formulate the main purpose or idea of future project. It can be describe by one sentence or two sentences, e.g. “Create user-friendly web store for selling fruits and vegetables”
  • 7. DESTINY :: FUNCTIONALITY ● Login ● Display a list of available items with prices ● Display detailed information per item ● Be able to add the item to the basket ● Calculate the overall sum ● Send the order
  • 11. HTML5BOILERPLATE Project started by Paul Irish (Google) for keepin' best techniques for web project http://html5boilerplate.com/ ● Code structure ● File template (html, css, js) ● Comes with libraries: jQuery, Modernizr ● and other
  • 13. COMRADES How? Checklist: ○ Amount of watchers in Github (big) ○ Amount of forks on Github (medium) ○ Amount of issues on Github (small) ○ Amount of results on Stackoverflow ○ Amount of votes on Stackoverflow
  • 14. COMRADES :: DOM Why? Cross browser API is not the same What? Relieves you from pain developments Who? jQuery, Zepto, MooTools Save yourself some time DO NOT WRITE YOUR OWN
  • 15. COMRADES :: UI & WIDGETS What? ● Splitter ● Tree ● Accordion ● Context menu ● Dropdown ● Charts ● Calendar ● Grids ● Dialogs Who? ● Twitter Bootstrap ● jQueryUI ● KendoUI ● Wijmo Components ● jqWidgets ● Dojo
  • 16. COMRADES :: JS FRAMEWORKS Why? JS mess, spaghetti code What? Clean separation of concerns Who? EmberJS, Backbone, Angular, etc. How? Write test programs in each of them http://todomvc.com/
  • 19. LAYOUT :: LAYOUT 1 :: HTML <header></header> <div id="main"></div> <footer></footer> http://jsbin.com/anafap/9/edit
  • 20. LAYOUT :: LAYOUT 2 :: HTML <div id="left"></div> <div id="center"></div> <div id="right"></div> http://jsbin.com/asehas/7/edit
  • 21. LAYOUT :: LAYOUT 3 :: HTML <header></header> <div id="container"> <div id="left"></div> <div id="right"></div> </div> <footer></footer> http://jsbin.com/uvafam/6/edit
  • 23. CSS CSS is a super power
  • 24. CSS :: SELECTORS Selector Description Example * Matches any element. E Matches any E element (i.e., an element of type E). a E F Matches any F element that is a descendant of an E element. div a E > F Matches any F element that is a child of an element E. div > a E:first-child Matches element E when E is the first child of its parent. li:first-child E:link E:visited Matches element E if E is the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited). a:link a:visited
  • 25. CSS :: SELECTORS (cont.) Selector Description Example E:active E:hover E:focus Matches E during certain user actions. a:active a:hover a:focus E + F Matches any F element immediately preceded by a sibling element E. div + div E[foo] Matches any E element with the "foo" attribute set (whatever the value). div[data-id] E[foo="warning"] Matches any E element whose "foo" attribute value is exactly equal to "warning". input[type=”text”] DIV.warning Language specific. (In HTML, the same as DIV[class~="warning"].) div.navigation E#myid Matches any E element with ID equal to "myid". div#main
  • 26. CSS :: BOX MODEL
  • 27. CSS :: MORE ● display: [none, block, inline, table, inline- block...], ● position: [absolute, fixed, relative], ● top: [number], ● left: [number], ● float: [left, right, none]
  • 28. LAYOUT :: LAYOUT 1 :: HTML + CSS HTML <header></header> <div id="main"></div> <footer></footer> CSS header, footer { border: 1px solid red; height : 55px; background-color: grey; border-radius: 7px; } #main { border-radius: 7px; border: 1px solid red; background-color: grey; height: 90px; margin: 10px 0 10px 0; } http://jsbin.com/anafap/7/edit
  • 29. LAYOUT :: LAYOUT 2 :: HTML + CSS HTML <div id="left"></div> <div id="center"></div> <div id="right"></div> CSS div { background-color: grey; border-radius: 7px; border: 1px solid red; float: left; margin: 0 5px 0 5px; } #left, #right { width: 150px; height: 250px; } #center { width: 275px; height: 750px; }http://jsbin.com/asehas/6/edit
  • 30. LAYOUT :: LAYOUT 3 :: HTML + CSS HTML <header></header> <div id="container"> <div id="left"></div> <div id="right"></div> </div> <footer></footer> CSS #left { width: 28%; background-color: grey; border: 1px solid red; border-radius: 7px; margin-right: 2%; float: left; } #right { width: 70%; background-color: grey; border: 1px solid red; border-radius: 7px; margin-left: 30% } http://jsbin.com/uvafam/6/edit
  • 32. JAVASCRIPT "JavaScript is the Assembly language of WEB" - Erik Meijer, Dutch computer scientist
  • 33. JQUERY :: SELECTORS $(selector).method() For example, $(‘#list’) will return the elements which has the attribute id=”list”. For more, see http://api.jquery.com/category/selectors/.
  • 34. JQUERY :: DOM MANIPULATIONS ● $(selector).html() ● $(selector).append(html) ● $(selector).remove() ● $(selector).attr('myAttr', 'value') ● $(selector).removeAttr('myAttr') ● $(selector).css('width', 40) ● $(selector).addClass('my-class') ● $(selector).removeClass('my-class') ● $(selector).text() ● $(selector).val()
  • 35. JQUERY :: AJAX $.ajax({ url: ‘/api/posts’ type: ‘POST’, data: {}, success: function () {}, error: function () {} });
  • 36. JQUERY :: EVENTS ● $(selector).click(function () {}) ● $(selector).dblclick(function () {}) ● $(selector).mousedown(function () {}) ● $(selector).mouseup(function () {}) ● $(selector).mouseover(function () {}) ● $(selector).mouseenter(function () {}) ● $(selector).mouseleave(function () {}) ● $(selector).on(eventName, function () {}) ● $(selector).off(eventName, function () {})
  • 37. JAVASCRIPT :: GUIDELINES Do not populate global space Use namespaces: create one global variable, e.g. name of your app, and store everything there. window.YUI = {}; YUI.version = ‘0.3’, YUI.start = function () {};
  • 38. JAVASCRIPT :: GUIDELINES Write JavaScript only in js file Do NOT write it in HTML: <a class=”add” onclick=”function () {}”>Add</a> Instead use jQuery and register the click handler: $(‘.add’).on(‘click’, function () {});