Usernames, passwords, command line commands, procedure steps… As developers, we have to remember a lot of crap. So how do you remember it all? I’m with this article: I don’t. Nearly everything that I have to do that isn’t just dead-easy (and even most stuff that is), is documented in a text file that is synced between two computers via Dropbox. What’s your strategy?
I get what the author of Stop Gratuitous UI Animation is getting at, but in the end, all their alterations did was change the loader to a different loader, and change the animation to a different animation. The point that some animation is useless is still valid, however.
I would love to work at a place someday that plans this much. And before anyone says “Well why don’t you just do it?”, because one person doesn’t just do something like this; it takes planning, and buy-in, and commitment, from all parties concerned. But when you’re done, what you have is a brilliantly simplistic way for new-comers to get started, and contribute more quickly, and all employees to work together more harmoniously.
In my day-to-day work, I use a Windows PC (that’s what they offer). I also use the command line for several operations, like running local servers (Jetty for one project, Tomcat for another), using Grunt to monitor my Less files and update my local CSS files (one project uses Grunt directly, another uses Maven to run Grunt), and both of those projects use Git as a repo and to trigger continuous integration and deployment. Yes, all of that, every day.
So, with all of the above happening at the same time, I typically have at least six Windows command line windows open. And bouncing between them just gets annoying. So, a couple times before I have tried looking for some way to unify all those individual command line windows into a single, tabbed application, but had not found anything that I loved. Until now.
One of my biggest gripes with what I tried before was that all the tabs had the exact same, nondescript name, usually something like “Cmd”… Of course, if I open them all in the same order every day, it wouldn’t be that hard to memorize which was which, but its the fact that bothers me…
So today I installed Console2 (I’m not sure why searches for Console2 list this product page, which says just Console, but the Download button URL links to Console2, and that’s what the product downloads as… whatever.).
Initially I had the same tab-name problem: all tabs got the same name (I think it was “Console”)… But then I dug into the Settings panel a little (Edit > Settings, or Ctrl+S)…
Not only can you customize the name of each tab, but you can create a list of tabs, each with their own custom name, directory to automatically open that tab to, Shell script to run as soon as that tab opens, icon to use for that tab, and more! You can even customize the keyboard shortcuts to match what you are likely already used to (like changing Open New Tab to Ctrl+T, etc.).
Hopefully this helps someone that has been having the same problem, and I would love to hear from anyone that uses either of these, especially what they like and dislike after using for some time; alternative options are also always nice to hear about… :-)
jQuery has released two new Alpha versions: 3.0 (for IE9+) and 3.0 Compat (for IE<9). There are several updates that could break existing code, but as usual, they are well documented, and jQuery Migrate should help you find any potential stress points.
Styling SVG<use> Content with CSS, by who else but SaraSoueidan, is much more than the title indicates, getting into how you should structure your code, how the browser creates the Shadow DOM, dealing with cascades and overrides, using tricks like all and currentColor, and even getting into what’s coming down the pipe, like CSS variables… Oh yeah, Sara also talks about styling SVG <use> content with CSS… :-)
The Front-End Developer’s Dilemma by GeoffGraham is very dear to my heart. I used to just tell people I do “computer crap” and would then expand on that incrementally until I felt they realized enough about technology that I could really explain what I do without making their eyes roll into the back of their heads: “I do web stuff.” “I’m a web developer.” “I do front-end development.” “I specialize in HTML, CSS, and JS, but work with WP and even SVG a good bit too, but I also think about and push-back a lot when it comes to UI and UX.” Having to explain the difference between web design and web development always surprises me, but I am the first to admit that I am not, and correct others when they wrongly label me as, a programmer; I know dudes that are computer programmers, and that is not me… :-)
And finally, JoshWorth‘s “Tediously Accurate Map of the Solar System is mind-bogglingly, brain-numbingly, cortex-meltingly amazing… I admit I did not make it all the way to Pluto… After an insane amount of scrolling, I had passed Saturn (no, I did not make it to Uranus, snarf! ;-), yet my horizontal scroll bar said I was still only halfway… I got new respect for you, New Horizons…
As fairly-new web technologies, Service Workers, Web Workers and WebSockets all started, stalled, and then sort of made a resurgence. And so I find myself somewhat confused by exactly what each does, what the differences between them are, and what purpose each ideally serves.
I tried searching for some comparison articles, but was surprised by the lack of search results comparing all three of these technologies. I found two that come close…
…but neither compares the three I was curious about… So I decided to get to know them all a little better and document my findings here (so I could come back and remind myself again later…).
Background service that handles network requests. Ideal for dealing with offline situations and background syncs or push notifications. Cannot directly interact with the DOM. Communication must go through the Service Worker’s postMessage method.
Mimics multithreading, allowing intensive scripts to be run in the background so they do not block other scripts from running. Ideal for keeping your UI responsive while also performing processor-intensive functions. Cannot directly interact with the DOM. Communication must go through the Web Worker’s postMessage method.
Creates an open connection between a client and a server, allowing persistent two-way communication over a single connection. Ideal for any situation where you currently use long-polling such as chat apps, online games, or sports tickers. Can directly interact with the DOM. Communication is handled through the WebSocket’s send method.
Service worker is a programmable network proxy, allowing you to control how network requests from your page are handled.
Service Workers are pretty perfect for creating offline-first web apps. They let you interact with the server when you can (to fetch new data from the server, or push updated info back to the server), so your app can work regardless of your user’s connectivity.
For example, an email client could fetch emails when the app loads, then, if the user loses connectivity for a brief period, the app could still continue to register read/unread and deleted states and store new emails to send until connectivity is restored, then send those updates back to the server via a Service Worker. To the user, all the time they were offline, the app continued to work, so they “got stuff done”, and your app just did its job, by collecting changes and updating the server as soon as it could.
While Service Workers cannot directly interact with the DOM, your main JS code can do that based on the messages you receive back from a Service Worker. Service workers also stop when not being used and restart when needed, so there is no persistent “state”; you would need to rely on some form of local storage (localStorage, IndexedDB, etc.) for such persistence. It is important to remember that a Service Worker’s life cycle is completely separate from your webpage.
Workers utilize thread-like message passing to achieve parallelism.
Web Workers are pretty perfect for any web app that has intense functions to perform. They let you push the intense functions into a background thread so your main JS can keep on rocking, like maybe setting up event listeners and other UI interactions. Then, when the intense functions are done, they report back with their results, letting the main JS update the web app.
For example, a site that fetches and displays data in a series of dynamic charts could have each chart fetch its own data via a separate Web Worker. While the Web Workers are fetching, processing, and calculating their data, the main JS could be setting up menus, event listeners, initializing date pickers and custom UI elements, etc. And when each Web Worker is done with its process, it can report back to the main JS with its resulting data to be used to create its respective chart.
While Web Workers cannot directly interact with the DOM, your main JS code can do that based on the messages you receive back from a Web Worker. And as they are completely separate threads, Web Worker code must exist in a separate file and does not have access to your main JS. Workers can also spawn subworkers, to create additional background threads.
There is an [sic] persistent connection between the client and the server and both parties can start sending data at any time.
WebSockets are pretty perfect for any web app that needs to communicate frequently with a server, and could benefit from the server being able to communicate directly with the client.
For example, a chat app could create a WebSocket connection so that as each person types, their message is pushed to the server and the server can then send that message directly to the other person(s) in that chat. The previous methods for doing this would be using setTimeout, setInterval and Ajax requests. But these approaches created intensive loops that have to keep asking the server: “Do you have anything yet?” No. “Do you have anything yet?” No. “Do you have anything yet?” No…
So, with WebSockets we finally can directly affect the DOM and, as they are part of the main thread, WebSockets do have access to your main JS.
So, while WebSockets and Service Workers kind of overlap, both being used for client-server communications, WebSockets would be used more for continuous communication so both the client and the server can send messages to each other without having to create new connections, and Service Workers would be used more for one-off client-server communications like syncing an app and the database after the app was offline for some time, like a burst that can then be dropped when the sync is completed.
And Web Workers are something completely different, allowing processor-intensive functions to run in a separate, background thread, while allowing the main JS to run and the UI to setup and operate more smoothly while those intensive functions are still running in the background.
Well, I hope this quick look at Service Workers, Web Workers and WebSockets helped clear up the similarities, differences, and purposes of these great new web technologies for you, as much as it did for me! As always, please feel free to drop any questions/thoughts into the comments below; discussion is always fun. :-)