You may have heard of The Grid, a new crowdfunding campaign that would revolutionize website design by incorporating Artificial Intelligence as a design tool. The service is similar to SquareSpace or WIX but include algorithms that essentially analyze a user’s content and imagery to calculate the ideal website design based on a set criterion. Any new content that gets added will result in the entire site reorganizing itself on the fly. Sound too good to be true? Perhaps. But interactive designers and developers have been worried about pre-made templates and DIY client services for years. Some of us fear being replaced. Some of us welcome our new robot overlords. Some of us, myself included, see these new services as a chance to evangelize that there are extremely deep, unique User Experience challenges that a web template (created by a bot or not) just can’t solve. In the Beginning Human-Robot Interaction has been a topic of both fascination and fear since the time of antiquity. Homer’s Iliad described the creation of automatons by the Greek god Hephaestus, who built consciousness into golden statues. Aristotle proposed that human thought and logic could be mechanized. Nineteenth century inventors and artists perfected self-operating toys and machines. These concepts would be lifted to a new plane with the invention of the programmable digital computer in the 1940s and subsequent founding of the field of AI research at Dartmouth College in 1958. Our relationship with AI has always been pretty tenuous. As in all instances of paradigm shifts and technological revolutions, we’re at odds with making our lives easier while feeling a dull sense of displacement or irrelevance. Harkening back to Isaac Asimov’s Three Laws of Robotics, we’ve attempted to safeguard ourselves from AI completely replacing or harming us. But replace may not be the right sentiment as it relates to the Web. We’ve seen design trends, languages and methodologies come and go. Most often they’re superseded by far more efficient ways of doing things and conveying information. Could the introduction of Web AI fall into the same path of progress or are we entering a new era of design? Not for Everybody The Grid promises to free us from the shackles of design and code. It promises that all of our problems are to be solved via a set of constraints and templates, whether they’re conceived from an algorithm or otherwise. While I think AI and template sites will benefit from small businesses and casual users who are on a tight budget, they completely ignore all of the work that User Experience designers and information architects have done in solving problems from an empathetic, strategic and tailored point of view. When we talk about web design, we’re talking about something much more far-reaching than what the end-user sees. Since the design is freed from static, printed paper, the screen is able to contextually change what is displayed based on environment and feedback. How we get to that point of context is the task of a UX designer. Defining who the user is and his or her goals, and what a client’s business goals are, helps inform the final design. It’s beyond the ability of an algorithm to figure that out. We just aren’t there yet. We haven’t successfully taught machines how to think and behave like real human beings, so until we can do that, we have to do the dirty work ourselves. And web designers love those really tough problems. All of the nuances, the complexity, and the compromise. Another issue with an AI-based website is how much control we really have over its output. You essentially abdicate the big decisions for the system to make, resulting in a site based on its own assumptions and programming limitations. (Side note: the code the AI spits out is so poor that you’re likely going to be dinged on SEO crawls!) I don’t think we’re ready to hand over our thought processes as they relate to defining a unique face and voice online either. Although interface conventions are becoming more homogenized, the need to outline a brand’s differentiators in the interactive space are at an all time high.
HN user
mintlysocial
Whistleblowing is when an employee, contractor or supplier goes outside the normal management channels to report suspected wrongdoing at work, i.e. speaking out in a confidential manner. This can be done via internal processes set up by the organisation (internal whistleblowing) or to an external body such as a regulator (external whistleblowing). While public disclosure to the media can also be perceived as whistleblowing the IIA report focuses on formally prescribed channels.
Microservices and Front-End
Microservices are becoming more and more popular and many are choosing to transition away from monolithic architecture. However, this approach was mostly limited to back-end services. While it made a lot of sense to split them into smaller independent pieces that can be accessed only through their APIs, same did not apply to front-end. Why is that? I think that the answer lies in technologies we’re using. The way we are developing front-end is not designed to be split into smaller pieces.
Server-side rendering is becoming history. While enterprise might not agree with that statement and continues pushing for server-side frameworks that “magically” transform, for example, Java objects to HTML and JavaScript, client frameworks will continue to increase in popularity slowly sending server-side page rendering into oblivion. That leaves us with client-side frameworks. Single-Page Applications are what we tend to use today. AngularJS, React, ExtJS, ember.js and others proved to be a next step in evolution of front-end development. However, Single-Page Applications or not, most of them are promoting monolithic approach to front-end architecture.
With back-end being split into microservices and front-end being monolithic, services we are building do not truly adhere to the idea that each should provide a full functionality. We are supposed to apply vertical decomposition and build small loosely coupled applications. However, in most cases we’re missing visual aspect inside those services. All front-end functionalities (authentication, inventory, shopping cart, etc) are part of a single application and communicate with back-end (most of the time through HTTP) that is split into microservices. This approach is a big advancement when compared with a single monolithic application. By keeping back-end services small, loosely coupled, designed for single purpose and easy to scale, some of the problems we had with monoliths become mitigated. While nothing is ideal and microservices have their own set of problems, finding production bugs, testing, understanding the code, changing framework or even language, isolation, responsibility and other things became easier to handle. The price we had to pay was deployment but that as well was greatly improved with containers (Docker and Rocket) and the concept of immutable servers.
If we see the benefits microservices are providing with back-end, wouldn’t it be a step forward if we could apply those benefits to front-end as well and design microservices to be complete with not only back-end logic but also visual parts of our applications? Wouldn’t it be beneficial if a developer or a team could fully develop a feature and let someone else just import it to the application? If we could do business in that way, front-end (SPA or not) would be reduced to a scaffold that is in charge only of routing and deciding which services to import.
I’m not trying to say that no one is developing microservices in such a way that both front-end and back-end are part of it. I know that there are projects that do just that. However, I was not convinced that benefits of splitting front-end into parts and packing them together with back-end outweights downsides of such an approach. That is, until I discovered web components.
Web Components
Web components are a group of standards proposed as a W3C specification. They allow creation of reusable components that can be imported into Web applications. They are like widgets that can be imported into any Web page.
They are currently supported in browsers based on WebKit; Chrome, Opera and FireFox (with manual configuration change). As usual, Microsoft Internet Explorer is falling behind and does not have them implemented. In cases where browser does not support web components nativelly, compatibility is accomplished using JavaScript Polyfills.
web components consist of 4 main elements which can be used separately or all together:
Custom Elements Shadow DOM HTML Imports HTML Templates Custom Elements
With Custom Elements we can create our own custom HTML tags and elements. Each element can have its own scripts and CSS styles. The question that might arise is why do we need Custom Elements when the ability to create custom tags already exists? For a long time now we can create our own tags, apply CSS styles and add behaviors through scripts. If, for example, we would like to create a list of books, both with Custom Elements and custom tags we would end up with something like following.
1 <books-list></books-list> What web components bring to the table are, among other things, lifecycle callbacks. They allow us to define behaviors specific to the component we’re developing.
We can use the following lifecycle callbacks with Custom Elements:
createdCallback defines behavior that occurs when the component is registered. attachedCallback defines behavior that occurs when the component is inserted into the DOM. detachedCallback defines behavior that occurs when the element is removed from the DOM. attributeChangedCallback defines behavior that occurs when an attribute of the element is added, changed, or removed Shadow DOM
Shadow DOM allows us to encapsulate JavaScript, CSS and HTML inside a Web Component. When inside a component, those things are separated from the DOM of the main document. In a way, this separation is similar to the one we’re using when building API services. Consumer of an API service does not know nor cares of its internals. The only thing that matters for a consumer are the API requests it can make. Such a service does not have access to the “outside world” except to make requests to APIs of other services. Similar features can be observed in web components. Their internal behavior cannot be accessed from outside (except when allowed by design) nor can they affect the DOM document they reside in. Main way of communication between web components is by firing events.
HTML Imports
HTML Imports are the packaging mechanism for web components. They are the way to tell DOM the location of a Web Component. In context of microservices, import can be a remote location of a service that contains the component we want to use.
1 <link rel="import" href="/services/books/books-list.html"> HTML Templates
The HTML template element can be used to hold client-side content that will not be rendered when a page is loaded. It can be, however, instantiated through JavaScript. It is a fragment of code that can be used in the document.
Microservices With Front-End
Web components provide a very elegant way to create pieces of front-end that can be imported into Web applications. Those pieces can be packaged into microservices together with back-end. That way, services we are building can be complete with both logic and visual representation packed together. If this approach is taken, front-end applications can be reduced to routing, making decisions which set of components to display and orchestration of events between different web components.
Now that we are equipped with (very) basic information about web components and desire to try a new approach to develop microservices, we can start building a microservice with both front-end and back-end included.
In the Developing Front-End Microservices With Polymer Web Components And Test-Driven Development series we’ll explore one of the ways to put discussion from this article into practice. We’ll use Polymer, Google library for creating web components, Docker, Docker Compose and few more tools and libraries. Development will be done using test-driven development (TDD) approach.
OS X/Darwin follows the design philosophy of it's cousin FreeBSD. The base system is only upgraded when a new OS version is released. Upgrades may or may not be the latest version of a software package. If the tool does it job and does it well then it may not be upgraded. The idea is " the lastest version may not equate to a better version" or "if it ain't broke, then don't fix it". So, the base system on your version of OS X will only be patched when there is a security concern or severe bug.
Using the Vim editor
Two modes
The vi editor is a very powerful tool and has a very extensive built-in manual, which you can activate using the :help command when the program is started (instead of using man or info, which don't contain nearly as much information). We will only discuss the very basics here to get you started.
What makes vi confusing to the beginner is that it can operate in two modes: command mode and insert mode. The editor always starts in command mode. Commands move you through the text, search, replace, mark blocks and perform other editing tasks, and some of them switch the editor to insert mode.
This means that each key has not one, but likely two meanings: it can either represent a command for the editor when in command mode, or a character that you want in a text when in insert mode.
Note Pronunciation
It's pronounced "vee-eye".
Basic commands
Moving through the text
Moving through the text is usually possible with the arrow keys. If not, try:
h to move the cursor to the left
l to move it to the right
k to move up
j to move down
SHIFT-G will put the prompt at the end of the document.
Basic operations
These are some popular vi commands:
n dd will delete n lines starting from the current cursor position.
n dw will delete n words at the right side of the cursor.
x will delete the character on which the cursor is positioned
:n moves to line n of the file.
:w will save (write) the file
:q will exit the editor.
:q! forces the exit when you want to quit a file containing unsaved changes.
:wq will save and exit
:w newfile will save the text to newfile.
:wq! overrides read-only permission (if you have the permission to override permissions, for instance when you are using the root account.
/astring will search the string in the file and position the cursor on the first match below its position.
/ will perform the same search again, moving the cursor to the next match.
:1, $s/word/anotherword/g will replace word with anotherword throughout the file.
yy will copy a block of text.
n p will paste it n times.
:recover will recover a file after an unexpected interruption.
Commands that switch the editor to insert mode
a will append: it moves the cursor one position to the right before switching to insert mode
i will insert
o will insert a blank line under the current cursor position and move the cursor to that line.
Pressing the Esc key switches back to command mode. If you're not sure what mode you're in because you use a really old version of vi that doesn't display an "INSERT" message, type Esc and you'll be sure to return to command mode. It is possible that the system gives a little alert when you are already in command mode when hitting Esc, by beeping or giving a visual bell (a flash on the screen). This is normal behavior.
The easy way
Instead of reading the text, which is quite boring, you can use the vimtutor to learn you first Vim commands. This is a thirty minute tutorial that teaches the most basic Vim functionality in eight easy exercises. While you can't learn everything about vim in just half an hour, the tutor is designed to describe enough of the commands that you will be able to easily use Vim as an all-purpose editor.
In UNIX and MS Windows, if Vim has been properly installed, you can start this program from the shell or command line, entering the vimtutor command. This will make a copy of the tutor file, so that you can edit it without the risk of damaging the original. There are a few translated versions of the tutor. To find out if yours is available, use the two-letter language code. For French this would be vimtutor fr (if installed on the system).