JS Debugging, Living with MediaQueries and Speed Up Thy Style
Posted on July 17th, 2014
7/16/2014 @ Condé Nast 4 Times Square, New York, NY
Three technical talks were presented on tools and methods to create better web pages more efficiently.
1.Speed up thy style by Shefali Pandey. Shefali talked about efficient ways to display graphics and speed up the CSS formatting of pages. She discussed five methods:
2.Inline CSS images – Instead of linking to a file containing an image, the image can coded as a string of characters within HTML. If the code is cached, this further increases the loading speed. This may not work in older browsers and the additional processing needed will more quickly drain a phone battery.
3.Progressive JPG – gives the illusion of faster loading, since one immediately sees a rough image. However, progressive JPG files may take up more space and the additional processing limits their use in mobile computing..
4.Optimizing CSS selectors – see Paul Irish blog – better to remove unused CSS instead.
5.CSS properties – CSS painting methods such as gradients, box-shadow … slows down rendering, but are still faster than retrieving image files.
Shefali also emphasized that browsers are evolving quickly and what works in 2014 may not be a best practice in the future.
2.Living with MediaQueries by Alex Lee. Media Queries are one of the key building blocks in responsive web design. However, when web pages have many components and require very different types of behavior for different devices, their use in a static CSS style sheet becomes ponderous and hard to maintain. Alex addressed this issue showing how Behance bundles media declarations and views into libraries that allow simple library calls to manage a wide variety of views and actions for each device.
He recommended Nbd.js as an open source toolkit when creating these structures.
Amjad argues that the closure of functions is good coding practice, but he finds it useful to look inside the class while debugging. He especially likes to use the console command line to test code prior to inserting it into his program. He then listed some debugging tips and tricks which include
- Have the program in a runnable state
- Split big changes into smaller steps
- Breadth first before depth
- To find out what happens when events or problematic actions happen, replace code with calls to the debugger. This is especially useful since it allows you to trace the call stack.
- And many more…
He closed by talking about the utility of the Debug(fn) and monitor(fn) console commands and the tool he has developed to write and execute code conveniently: facebook.github.com/fb-flo.