Nearly two months to the day since my last post on this series, I'm finally starting it up again. I'll blame my new job for making me forget this for a while, but hopefully I can pick up steam again and finish all these darn questions.
This post is part of a series I’m writing where I attempt to answer, to the best of my ability, a set of Front-End developer questions. I expect/hope my readers will disagree, augment, and generally hash out my answers in the comments below.
Name 3 ways to decrease page load (perceived or actual load time).
Minimize images. I use this grunt plugin before to automate it and it worked great.
Minimize, combine, and "prune" CSS files. By prune I mean find unused styles and remove them. Addy Omsani has a good blog post on removing unused CSS and you can definitely automate this as well.
If you jumped on a project and they used tabs and you used spaces, what would you do?I'd follow the project norm. I personally prefer tabs, but when working on a project, I'm going to follow the standards/guidelines/etc that everyone is following. If it was for something important and not cosmetic, I'd bring it up for discussion of course.
Describe how you would create a simple slideshow page.Ok, two answers here. If jQuery was already being used, I'd probably find a good plugin. I feel kinda lame saying that - but - honestly - a client wants me to get the best tool for the job and would probably not want to pay me to rebuild something that has been done a thousand times over.
What tools do you use to test your code's performance?Primarily just the Network tools in my browser dev tools. I'm not making use of profiling yet so I don't have a good grasp on testing the performance of my JS in terms of how it acts on the page once it is loading. I guess you can say I've maybe got half the picture (getting crap to the browser), but need to get better and understanding the rest (how crap runs in the browser).
I can share a story though about how I learned about network performance. Like most things learnt - it was by screwing up. I had an existing "Web 1.0" app (I don't really like that term but I think it makes sense to most of us) that I decided to update and make everything loaded via Ajax. This worked wonderfully until the content became so large that every page load was taking 4-5 seconds because of the size of the XML packets (yes, I used XML, I was still learning) going back and forth. It made me realize that just switching to Ajax doesn't suddenly make your network any less of a concern.