Front-end Web Development/Notes: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Notes from previous [[Front-end Web Development]] classes.
Notes from previous [[Front-end Web Development]] classes.


==== Class for 2013-10-21: Preprocessors ====
==== Class for 2013-11-11: the basics ====
Frontend code can often get very repetitive and hard to maintain. We expanded upon last week's talk about the "view" layer by introducing preprocessors - languages which compile into HTML, CSS, or JS. We've taken a look at PHP and ERB, but we also walked through languages that look nothing like HTML (HAML), and languages that compile into CSS (Less, Sass + Compass) and JS (CoffeeScript). These languages can make your life much easier as they help keep you from repeating yourself (DRY!). We also introduced Middleman, one of many workflow systems that makes using these languages easy.
<span style="color:green">'''THIS is the class to attend if you are a complete beginner!'''</span> We are starting the curriculum of this class from square one. We'll cover the very basics:
 
* Explaining "front-end" vs. "back-end"
To prepare for this class, consider installing [https://rvm.io/ RVM] with the --ruby=2.0 flag if you're using OS X or Linux, or Ruby via [http://rubyinstaller.org/ RubyInstaller] for Windows. If you really want a head start, you can then install [http://middlemanapp.com/ Middleman].
 
'''[https://www.youtube.com/watch?v=snVPNYWmYZE Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series3/class22/lecture.zip Lecture materials]'''
 
==== Class for 2013-10-14: Backend web development ====
This class was all about the seedy underbelly of web development: the backend!
 
I know we already have a [[Backend_web_dev_in_Ruby_on_Rails|backend class here at Noisebridge]], but this one was tailored toward frontend developers wanting to get a taste of how things come together. We spent the first half talking about PHP, then moved onto a Rails, a more complex example.
 
Here are the steps used for class preparation:
 
----
 
===== THE EASY WAY: =====
If you would like to follow along, the easiest option is to run a virtual machine:
* Install [https://www.virtualbox.org/wiki/Downloads VirtualBox AND the Extension Pack]
* [http://jeffreyatw.com/static/frontend/series4/class21/Ubuntu.ova Download this preconfigured Ubuntu virtual machine (1.84GB)]
* Double-click the .ova file. You should check the "reinitialize the MAC address" step.
* Start the machine after installation and you're all set!
* System username and password are both "frontend". Feel free to change them if that's uncomfortable.
 
===== THE HARDER WAY: =====
If you don't want to use a virtual machine.
 
On Linux, you'll need to follow these steps:
* https://github.com/joshfng/railsready
** When installing, choose RVM.
** Also run <code>sudo apt-get install nodejs</code>
* https://help.ubuntu.com/community/ApacheMySQLPHP
 
On Windows or Mac OS X:
 
* Start with RailsInstaller: http://railsinstaller.org/
* And for PHP:
** Mac: http://www.mamp.info/en/index.html
** Windows: http://www.wampserver.com/en/
 
===== THE HARDEST WAY: =====
Install Apache, PHP, RVM, Ruby, and Rails individually. Good luck!
 
'''No video for this class. :('''
 
==== Class for 2013-10-07: Version control (Git) and the command line ====
This class was a general overview on version control and the command line. I've taught how to use an FTP client to upload files to the web, but the truth is that most developers don't do that anymore - rather, they collaborate with their peers by using version control systems, which allows them to keep track of their work in a reliable fashion and push it to the web.
 
Again, this class wasn't about web development per se - it was just an important introduction to using the command line to work with Git, one of the most popular version control systems. Everyone created their own fork of a repository and checked in their work.
 
We signed up for a free account at [https://github.com/ GitHub] and installed [http://git-scm.com/ Git]. Those on Windows installed [http://msysgit.github.com/ Git for Windows] (all default options are fine).
 
'''[http://www.youtube.com/watch?v=WYh4o3R_Hak Lecture video]'''<br>
'''[https://github.com/jeffreyatw/shakespeare The repository we worked on]'''
 
==== Class for 2013-09-30: Old vs. new: progressive enhancement and browser testing ====
We talked about progressive enhancement - a practice where websites are created in a layered way that makes them accessible and cross-browser friendly. We looked at [http://jeffreyatw.com/static/frontend/series3/class19/sites.zip two versions of an example site] and demonstrated how one is outdated, and the other adheres to progressive enhancement principles. We've touched on these concepts throughout the whole class, but in this class we focused on why they're important, and what could happen if you DON'T adhere to them.
 
This segued into a talk about browser testing - how to do it and what to look out for. We suggested using [http://modern.ie modern.IE] for virtualization tools.
 
We also mentioned [http://modernizr.com Modernizr], [http://necolas.github.io/normalize.css/ Normalize.css], and [http://html5boilerplate.com/ HTML5 Boilerplate].
 
'''[http://www.youtube.com/watch?v=p208hZ5Mg8M Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series3/class19/sites.zip Lecture materials]'''
 
==== Class for 2013-09-23: The mobile web ====
We took [http://jeffreyatw.com/static/frontend/series3/class17/blog.zip this blog] and turned it into a mobile-accessible website via the use of media queries. We also talked about the rest of the world of the mobile web: user agent strings, frameworks like jQuery Mobile and Sencha Touch, and the future of HTML5/CSS3 in mobile website and app development.
 
'''[http://www.youtube.com/watch?v=p208hZ5Mg8M Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class18/lecture.zip Lecture materials]'''
 
==== Class for 2013-09-16: CSS3 ====
We'd covered CSS3 before, but in the context of a mockup. We looked further into CSS3 with a demonstration of what the new technologies are, how to make the most of them, and how to make sites using them look good in less capable browsers.
 
'''[http://www.youtube.com/watch?v=Mv-bHgEPSVw Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class17/lecture.zip Lecture materials]'''
 
==== Class for 2013-09-09: HTML5 elements ====
We took an entertaining (in my opinion) look through [http://jeffreyatw.com/static/frontend/series4/class16/html.zip this page containing every currently valid HTML element]. Many of them are considered "HTML5" elements, but that's just because they're relatively new.
 
'''[http://www.youtube.com/watch?v=8-ZaoiEt2Qw Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class16/html.zip Lecture materials]'''
 
==== Class for 2013-08-26: ClassName Swap, Language Review, RTFM, by Garrett Smith ====
 
===== Lesson: CSS ClassName Swap =====
By changing an element's <code>className</code> multiple styles can be changed at one time.
 
Using the descendant selector, and changing the <code>className</code> of an ancestor element, multiple elements can be updated simultaneously, with a modicum of highly efficient code.
 
For Styles, replace a loop that applies styles to descendants by adding a class token to the nearest common ancestor ([http://jibbering.com/faq/notes/code-guidelines/descendant-sel.html example], [http://jibbering.com/faq/notes/code-guidelines/#design explanation]).
 
====== Calculating Selector's Specificity ([http://www.w3.org/TR/CSS2/cascade.html#specificity CSS 2.1]). ======
The classname swap example leverages the fact that class selectors (e.g. <code>.foo</code>) have higher specificity than element selectors (e.g. <code>tr</code>).
 
CSS Selector specificity is determined four numbers, a-b-c-d, in a number system with a large base.
<blockquote cite="http://www.w3.org/TR/CSS2/cascade.html#specificity">
    count 1 if the declaration is from is a 'style' attribute rather than a rule with a selector, 0 otherwise (= a) (In HTML, values of an element's "style" attribute are style sheet rules. These rules have no selectors, so a=1, b=0, c=0, and d=0.)
    count the number of ID attributes in the selector (= b)
    count the number of other attributes and pseudo-classes in the selector (= c)
    count the number of element names and pseudo-elements in the selector (= d)
</blockquote>
 
===== RTFM =====
Unschooling and autodidacticism; an Intro to [http://www.catb.org/jargon/html/R/RTFM.html RTFM], RTFFAQ, and SFTW.
 
Understanding defines the difference between the followers, who resort to mystical incantations or convoluted DOM libraries to do the work for them, and those who can implement project requirements, as specified, with [http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDMQtwIwAQ&url=http%3A%2F%2Fvimeo.com%2F13702091&ei=XN8eUtSTDuaaiQfo0oGwAw&usg=AFQjCNGkkzJmJXyBpBXpyVaHkpmsN1IUcQ&sig2=Ws2-2YmQJkgYwKCd7Bfx-Q&bvm=bv.51495398,d.aGc clean code (Vimeo)]. And not downloading free scripts off dynamic drive or [ jQuery], copying, or programming by observation.
 
When misunderstandings or debates arise, and that happens fairly often, it is important how to find the answer using STFW and RTFM,
and when that fails, how (and where ([https://groups.google.com/forum/#!forum/comp.infosystems.www.authoring.html CIWAS], [https://groups.google.com/forum/#!forum/jsmentors JSMentors], [https://groups.google.com/forum/#!forum/comp.lang.javascript c.l.js], [https://groups.google.com/forum/#!forum/comp.infosystems.www.authoring.html ciwah]) to ask a [http://www.catb.org/esr/faqs/smart-questions.html smart question].
 
===== JavaScript Review =====
====== Functions ======
* [http://kangax.github.io/nfe/ FunctionExpression vs FunctionDeclaration], [https://groups.google.com/forum/#!msg/comp.lang.javascript/tjVn1NjGDN8/QgOuxtAymqoJ MemberExpression], [http://www.ecma-international.org/ecma-262/5.1/#sec-11.2.1 PropertyAccessor] and [http://jibbering.com/faq/notes/square-brackets/ Square Brackets].
 
====== Specifications ======
* [http://www.ecma-international.org/publications/standards/Ecma-262-arch.htm ECMAScript 1.3] and [http://www.ecma-international.org/ecma-262/5.1/ ECMAScript 5.1]
Other versions of ECMAScript, including E4X and Compact, are out of scope for this class.
 
====== FAQ ======
[http://jibbering.com/faq/ FAQ], also hosted on [http://www.fortybelow.ca/hosted/comp-lang-javascript/faq/ Matt's site].
 
==== Class for 2013-08-12: More useful jQuery plugins ====
Our final jQuery-focused class touched on a number of other common plugins that are found in the wild. We took a closer look at Bootstrap and jQuery UI, and looked at plugins that make your page look super snazzy:
* [http://jqueryui.com/demos/datepicker/ Datepicker (jQuery UI)] - fancy datepickers appearing near your input fields
* [http://jqueryui.com/demos/accordion/ Accordion (jQuery UI)] - collapse and unfold lists of elements
* [http://getbootstrap.com/javascript/#scrollspy Scrollspy (Bootstrap)] - change navs to highlight where you are scrolled on a page
* [http://jquery.malsup.com/cycle2/ Cycle] - make easy slideshows
* [http://harvesthq.github.io/chosen/ Chosen] - style dropdowns
 
'''[https://www.youtube.com/watch?v=hRs9HOD0aMo Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class15/lecture.zip Lecture materials]'''
 
==== Class for 2013-08-05: Sign-up forms ====
We continued working on [http://jeffreyatw.com/static/frontend/series4/class13/lecture.zip our site] and added a sign-up form, with validation, inside the modal. We used the [http://jqueryvalidation.org/ jQuery Validation plugin]. Validation is a very common request from clients and it comes in handy to know all the tips and tricks of forms and validation, and what new HTML5 elements can provide.
 
'''[https://www.youtube.com/watch?v=DGJPBfWJWRc Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class14/lecture.zip Lecture materials]'''
 
==== Class for 2013-07-29: Modals and menus ====
We went back to the [http://jeffreyatw.com/static/frontend/series4/class6/noiseco.zip "professional" site we'd put together a number of weeks ago] and added more functionality to it with some jQuery plugins. We first made a dialog box - or a "modal" - pop up when you click the sign up buttons. We did this by introducing [http://jqueryui.com/ jQuery UI] to make common user controls easier to create. We also added some dropdown functionality to our menus using pure CSS, but explained that jQuery UI can help out with the subtle nuances of menus.
 
'''[http://www.youtube.com/watch?v=ge2ZECyRRf8 Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class13/lecture.zip Lecture materials]'''
 
==== Class for 2013-07-22: AJAX ====
We talked about Asynchronous JavaScript and XML, a technology that allows us to talk to a server without leaving the page. jQuery makes this extremely easy. We added AJAX functionality to [http://jeffreyatw.com/static/frontend/series4/class11/lecture.zip our app we've been building on]. We used this [http://jeffreyatw.com/static/frontend/series4/class12/tweet.php.zip PHP file] to test it out.
 
'''[https://www.youtube.com/watch?v=Hi1arhXXQsw Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class12/lecture.zip Lecture materials]'''
 
==== Class for 2013-07-15: jQuery, cont'd ====
We continued learning about jQuery by focusing on [http://jeffreyatw.com/static/frontend/series4/class10/lecture.zip the example we saw last week]. We added functionality to it that made it seem more like the real thing.
 
'''[http://www.youtube.com/watch?v=X6Bublxub3w Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class11/lecture.zip Lecture materials]'''
 
==== Class for 2013-07-08: jQuery ====
We introduced jQuery, a JavaScript library that makes web programming a whole lot easier. jQuery is the most popular of many libraries that allow us to interact with the document easily, while also providing us with a few tools that are missing from the base language.
 
To learn what jQuery can do, we added some scripting to [http://jeffreyatw.com/static/frontend/series4/class10/assets.zip this sample web app].
 
'''[http://www.youtube.com/watch?v=IP3MgfcStxg Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class10/lecture.zip Lecture materials]'''
 
==== Class for 2013-07-01: JavaScript, cont'd ====
We continued discussing JavaScript basics: arrays, objects, creating functions, and scopes.
 
'''[https://www.youtube.com/watch?v=u-Q5DhW8jpA Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class9/lecture.zip Lecture materials]'''
 
==== Class for 2013-06-24: JavaScript ====
We talked about JavaScript: making web pages interactive through client-side code. We used the console, which is part of the browser's developer tools, to demonstrate the basics of the language. This and next week's class can be treated as a general introduction to programming.
 
'''[https://www.youtube.com/watch?v=pfd78FpYPuI Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class8/lecture.zip Lecture materials]'''
 
==== Class for 2013-06-17: HTTP & SFTP ====
We talked about file transfer: HTTP, which is the method of getting and sending information in the web browser, and SFTP, which is a method of securely uploading files to a web host.
 
We set up free web hosting accounts at [https://www.nearlyfreespeech.net NearlyFreeSpeech.NET], and uploaded to them using [http://filezilla-project.org the FileZilla client].
 
'''[https://www.youtube.com/watch?v=pfJxBeNzbvQ Lecture video]'''
 
==== Class for 2013-06-03: Working from professional mockups, cont'd ====
We continued putting our professional-looking site together from [http://jeffreyatw.com/static/frontend/series4/class5/lecture.zip where we left off]. We focused on some fancy CSS3 techniques, and we saw how to make an interactive dropdown menu with no JavaScript.
 
We didn't exactly finish, but I went ahead and put on the finishing touches. [http://jeffreyatw.com/static/frontend/series4/class6/noiseco The final product can be found here] (but where we left off can be found in the [http://jeffreyatw.com/static/frontend/series4/class6/lecture.zip lecture materials]).
 
'''[http://www.youtube.com/watch?v=WMeTFrR1rtA Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class6/lecture.zip Lecture materials]'''
 
==== Class for 2013-05-20: Working from professional mockups ====
We took the knowledge we gained from looking at the CSS box model, floats, and positioning, and worked off of something given to us by a designer (me).
 
We worked off of [http://jeffreyatw.com/static/frontend/series2/class5/mockup.png this mockup] and its [http://jeffreyatw.com/static/frontend/series2/class5/mockup_annotations.png annotated version] to make a site that could pass as a professional design (but don't take my word for it). [http://jeffreyatw.com/static/frontend/series2/class5/assets.zip Image assets can be found here].
 
'''[https://www.youtube.com/watch?v=1Y6MxRAPfLs Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class5/lecture.zip Lecture materials]'''
 
==== Class for 2013-05-13: CSS positioning ====
In the last few classes, we focused on element measurements and floats. This time, we focused on positioning of elements: spacing them out from other elements using margins, and using absolute, relative, or fixed positioning to put the elements anywhere we want on the whole page.
 
'''[http://www.youtube.com/watch?v=IxROKEWIjB8 Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class4/lecture.zip Lecture materials]'''
 
==== Class for 2013-05-06: CSS floats ====
Floating is the secret sauce behind creating websites with multiple columns, navigation menus, and basically any block element that's aligned to the left or right. We learned about floats by taking a look at some examples, then took a [http://jeffreyatw.com/static/frontend/series2/class4/mockup.png mockup] and created a site from it.
 
'''[http://www.youtube.com/watch?v=5j6oA4sS99U Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class3/lecture.zip Lecture materials]'''
 
==== Class for 2013-04-22: CSS selectors and the box model ====
CSS selectors are probably the most complex part of the CSS language, so we looked at them further in-depth. We also talked about the box model, the display concept that makes words and containers on the web look like they do.
 
'''[http://www.youtube.com/watch?v=fqQph1vry7A Lecture video]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class2/lecture.zip Lecture materials]'''
 
==== Class for 2013-04-15: the basics ====
We covered the very basics:
* Explaining "frontend" vs. "backend"
* Discussing tools of the trade
* Discussing tools of the trade
* Explaining the separation between structure, presentation, and behavior
* Explaining the separation between structure, presentation, and behavior
* Writing a basic HTML page
* Writing a basic HTML page
* Styling the page with basic CSS
* Styling the page with basic CSS
* Explaining the role of frontend web development as a job and career
* Explaining the role of front-end web development as a job and career
 
No recap session for this class. Please show up '''promptly''' at or before 8pm, as physical space is limited. Bring a laptop!
 
P.S. This might be the last series I teach for a while. I might take a longer break after the end of the series (in about 6 months). We'll see. But if you've been meaning to attend, this is your chance!


'''[http://www.youtube.com/watch?v=TmDCjhCuNtU Lecture video]'''<br>
'''No video for this class. [http://www.youtube.com/watch?v=TmDCjhCuNtU Try last series's video.]'''<br>
'''[http://jeffreyatw.com/static/frontend/series4/class1/lecture.zip Lecture materials]'''
'''[http://jeffreyatw.com/static/frontend/series5/class1/lecture.zip Lecture materials]'''


----
----


[[Frontend_Web_Development/Notes/Archive|Notes archive]]
[[Frontend_Web_Development/Notes/Archive|Notes archive]]

Revision as of 18:48, 12 November 2013

Notes from previous Front-end Web Development classes.

Class for 2013-11-11: the basics

THIS is the class to attend if you are a complete beginner! We are starting the curriculum of this class from square one. We'll cover the very basics:

  • Explaining "front-end" vs. "back-end"
  • Discussing tools of the trade
  • Explaining the separation between structure, presentation, and behavior
  • Writing a basic HTML page
  • Styling the page with basic CSS
  • Explaining the role of front-end web development as a job and career

No recap session for this class. Please show up promptly at or before 8pm, as physical space is limited. Bring a laptop!

P.S. This might be the last series I teach for a while. I might take a longer break after the end of the series (in about 6 months). We'll see. But if you've been meaning to attend, this is your chance!

No video for this class. Try last series's video.
Lecture materials


Notes archive