Javascript News

Syndicate content
Pipes Output
Updated: 17 hours 39 min ago

What Does Pebble Time Mean For Developers?

Di, 2015-03-03 18:00

Pebble’s first smartwatch crowd funding campaign in 2012 raised over 10 million dollars through pledges, with over a million of their smart watches sold.

The Pebble team recently announced their latest upcoming smartwatch - the Pebble Time. The Pebble Time is a color e-paper smartwatch with a new chronologically focused timeline interface, an animated UI, microphone, a smart accessory port and more. A new generation of Pebble Smartwatch brings with it an updated API and lots of exciting potential.

Continue reading %What Does Pebble Time Mean For Developers?%

5 Golden Rules For Mobile Email Design

Di, 2015-03-03 16:00

As I mentioned in my previous article, mobile email design is not only a content choreography issue, but involves many design elements. We should never consider the design for mobile devices a simple matter of catering to "screen size". Instead we need to have a comprehensive approach that takes into account the very different ways […]

Continue reading %5 Golden Rules For Mobile Email Design%

Sass Basics: Operators

Di, 2015-03-03 15:00

Sass is quite popular and tends to be an essential tool for every front-end developer. Sitepoint has already published some introductory articles about this CSS preprocessor language.

In this article, we'll continue exploring Sass by diving into its operations.

Note: The examples will be based on Ruby Sass. I also suggest you to have a look at Hugo's article, which discusses Sass-Compatibility.

Assignment Operator

Sass uses the colon (:) operator to define a variable. For instance:

$main-color: lightgray;

Arithmetic Operators

Arithmetic operators are used to perform the standard arithmetic operations.

Here are the arithmetic operators that Sass supports:

Operator Description + Addition - Subtraction * Multiplication / Division % Remainder

As we'll see in an upcoming section, the addition operator (+) can also be used to concatenate strings.

Note that the operators above work only for numbers with compatible units:

Continue reading %Sass Basics: Operators%

What’s New in AngularJS 2.0

Mo, 2015-03-02 21:00

AngularJS has become one of the most popular open source JavaScript frameworks in the world of web application development. Since its inception, it has witnessed phenomenal growth in terms of adoption and community support—both from individual developers and corporations.

From humble beginnings, Angular has matured into a client-side MVW framework (that’s Model-View-Whatever) for the building of complex single-page applications. It places equal importance on application testing and application writing, while simplifying the development process.

The current version of Angular is 1.3. This version is both stable and performant and is used by Google (the framework’s maintainers) to power a great many of their applications (it’s estimated that that there are over 1600 apps inside of Google running on Angular 1.2 or 1.3).

Angular 2.0 was officially announced at the ng-conference in October, 2014. This version won’t be a complex major update, rather a rewrite of the entire framework and will include breaking changes!

Why Angular 2.0?

Before getting into further discussion about Angular 2.0 (which has an estimated release date of the end of 2015), let’s briefly consider the philosophy behind the new version. Angular 2.0 development was started to address the following concerns:

Mobile

The new Angular version will be focused on the development of mobile apps. The rationale is that it’s easier to handle the desktop aspect of things, once the challenges related to mobile (performance, load time, etc.) have been addressed.

Modular

Various modules will be removed from Angular’s core, resulting in better performance. These will find their way into Angular’s ever-growing ecosystem of modules, meaning you’ll be able to pick and choose the parts you need.

Modern

Angular 2.0 will target ES6 and “evergreen” modern browsers (those automatically updated to the latest version). Building for these browsers means that various hacks and workarounds that make Angular harder to develop can be eliminated allowing developers to focus on the code related to their business domain.

What’s the Controversy?

During the ng-conference there was no mention of a migration path to version 2.0. It was also pointed out that the jump to 2.0 version will lead to broken Angular 1.3 apps, as there won’t be any backwards compatibility. Since then, the developer community has been abuzz with uncertainty and speculation, with some developers questioning if it’s even worth starting a new Angular 1.3 project.

What Are the Changes? AtScript

AtScript is a superset of ES6 and it’s being used to develop Angular 2.0. It’s processed by the Traceur compiler (along with ES6) to produce ES5 code and uses TypeScript’s type syntax to generate runtime type assertions instead of compile time checks. However, AtScript isn’t compulsory—you will still be able to use plain JavaScript/ES5 code instead of AtScript to write Angular apps.

Improved Dependency Injection (DI)

Dependency injection (a software design pattern in which an object is passed its dependencies, rather than creating them itself) was one of the factors that initially differentiated Angular from its competitors. It is particularly beneficial in terms of modular development and component isolation, yet its implementation was plagued with problems in Angular 1.x. Angular 2.0 will will address these issues, as well as adding missing features such as child injectors and lifetime/scope control.

Annotations

AtScript provides tools for associating metadata with functions. This facilitates the construction of object instances by providing the required information to the DI library (which will check for associated metadata when calling a function or creating an instance of a class). It will be also easy to override parameter data by supplying an Inject annotation.

Child Injectors

A child injector inherits all the services of its parent with the capability of overriding them at the child level. According to requirement, different types of objects can be called out and automatically overridden in various scopes.

Instance Scope

The improved DI library will feature instance scope control, which will become even more powerful when used with child injectors and your own scope identifiers.

Continue reading %What’s New in AngularJS 2.0%

Building Your Own Social Sharing Plugin for WordPress

Mo, 2015-03-02 18:00

A social sharing plugin allows your website visitors to share your website content easily on social media sites. This helps to increase the overall awareness of your website.

There are already dozens of existing social sharing plugins that you can just install and be done with it, but where's the fun in that?

In this tutorial, I'll show you how to build your very own social sharing plugin for WordPress from scratch, which can add social sharing buttons below every post. Users can share the post simply by clicking on the desired social media site button.

Why Do You Need Social Media Share Buttons?

It's often reported that more than 80% of users consider reading content based on their friends’ recommendations. With social sharing, you give users the ability to share your content with their own networks of friends.

More than 40 billion shares are clicked each day on the web, therefore adding social sharing buttons on your WordPress website is first step to helping to market your site.

Continue reading %Building Your Own Social Sharing Plugin for WordPress%

Building APIs You Won’t Hate: Review

Mo, 2015-03-02 17:00

This is a review of Phil Sturgeon’s book Build APIs You Won’t Hate.

Build APIs You Won’t Hate

A bit of an edgy title, isn’t it? It makes sense, though. The potential of a developer hating anything he built given enough time to work on it is enormous. It’s an inverse parabola of sorts - your enthusiasm will grow for a given amount of time, and then proportionally drop until you sink below the starting point of pleasure. If you push through this depression, learn new techniques, and then apply them to your work you get a kind of sine wave in which your enthusiasm again rises until it starts dropping, and so on and so forth.

Continue reading %Building APIs You Won’t Hate: Review%

Ruby on Medicine: Handling Large Files

Mo, 2015-03-02 15:00

There I was, visiting the Sequence and Annotation Downloads page on the UCSC Genome Bioinformatics website. That page contains links to sequences and annotation data downloads for the genome assemblies that are featured in the UCSC Genome Browser. There were so many files to choose from, but I was interested in downloading the following file in the assembly of the human genome data set:

hg38.fa.gz - "Soft-masked" assembly sequence in one file. Repeats from RepeatMasker and Tandem Repeats Finder (with period of 12 or less) are shown in lower case; non-repeating sequence is shown in upper case.

Guess what? That file is greater than 3GB in size! No worries, you may say. Text editors today can handle massive files, right?? I am using Windows, so we're talking about Notepad, WordPad, and Microsoft Office Word, just to name a few.

Well, it seems we have overestimated the abilities of these editors. When I tried the text editors mentioned above, they screamed in agony. Check it out:

Notepad

WordPad

Microsoft Office Word

Yikes.

Continue reading %Ruby on Medicine: Handling Large Files%

Understanding Baidu — The Chinese Google

Sa, 2015-02-28 17:00

Although China represents a huge chunk of netizens (over 600 million users), the Chinese government is very strict when it comes to what content is shown to its people. They have stringent regulations and their ruthlessness is shown in partially or fully blocking popular websites like Google and Facebook in the past.

In spite of the absence of these American giants in the Chinese world, local websites have emerged, which perform the tasks of their American counterparts quite well. In this post, we look at the progress of one such website — Baidu.

Although the primary product of Baidu is the search engine, it also has services like Baidu Yun (cloud services), Baidu News, Baidu Dictionary and many more. Baidu’s advertisements are also similar to Google’s Adwords and AdSense. In this article, let’s focus on the search engine and how to give your site the best chance of appearing in Chinese search results.

Why Care about Baidu? [caption id="attachment_100345" align="aligncenter" width="735"] Source: NetMarketShare[/caption]

To understand the importance of Baidu, you should consider the market share of different search engines. As the January 2015 search engine market share results show, Google accounts for over two thirds of searches, but Baidu comes in second with 18.7%. Bing currently has 8.7% and Yahoo is close behind with 7.8%

Baidu boasts more than 60% of Chinese search traffic but it is also known to refer over a quarter of its traffic to its own properties.

Getting Ready for Baidu

If the primary audience of your website is English speaking then it’s not necessary or wise to implement any of the tips that I provide here. However, if you run a product line or service with a large portion of your audience being Chinese-speaking, you can’t ignore this huge potential market. Let’s have a look at what you can do to help your website attract more Baidu users.

Continue reading %Understanding Baidu — The Chinese Google%

Introduction to Object.observe

Fr, 2015-02-27 19:00

Two-way data binding is now one of the crucial features of client-side applications. Without data binding, a developer has to deal with a lot of logic to manually bind data to the view, whenever there is a change in the model. JavaScript libraries like Knockout, AngularJS, and Ember have support for two-way binding but these libraries use different techniques to to detect changes.

Knockout and Ember use observables. Observables are functions wrapped around the properties of the model objects. These functions are invoked whenever there is a change of the value of the corresponding object or property. Although this approach works well, and detects and notifies all the changes, it takes away the freedom of working with plain JavaScript objects as now we have to deal with functions.

Angular uses dirty checking to detect changes. This approach doesn't pollute the model object. It registers watchers for every object added to the model. All of these watchers are executed whenever Angular’s digest cycle kicks in and if there are any changes to the data. Those changes are processed by the corresponding watchers. The model still remains a plain object, as no wrappers are created around it. But, this technique causes performance degradation as the number of watchers grows.

What is Object.observe?

Object.observe, a.k.a. O.o, is a feature to be added to JavaScript as part of ECMAScript 7 to support object change detection natively in the browser. Although ES7 is not completed yet, this feature is already supported in Blink-based browsers (Chrome and Opera).

BecauseObject.observe will be supported by the browsers natively and it works directly on the object without creating any wrappers around it, the API is both easy to use and a win for performance. If Object.observe is supported by a browser, you can implement two-way binding without the need of an external library. It doesn't mean that all of the existing two-way binding libraries will be of no use once O.o is implemented. We still need them to update UIs efficiently after detecting the changes using O.o. Besides, libraries would internally polyfill the logic of change detection if not all targeted browsers support O.o.

Observing Properties of an Object

Now that you have an idea of what O.o is good for, let’s see it in action.

The observe() method is an asynchronous static method defined on Object. It can be used to look for changes of an object and it accepts three parameters:

  • an object to be observed
  • a callback function to be called when a change is detected
  • an optional array containing types of changes to be watched for

Let’s see an example of using the method. Consider the following snippet:

[js] var person = { name: 'Ravi', country: 'India', gender: 'Male' }; function observeCallback(changes){ console.log(changes); }; Object.observe(person, observeCallback); person.name = 'Rama'; // Updating value person.occupation = 'writer'; // Adding a new property delete person.gender; // Deleting a property [/js]

Continue reading %Introduction to Object.observe%

On Our Radar: Closures, Copyright and the Best Apps of 2014

Fr, 2015-02-27 18:00

Hello and welcome to On Our Radar This Week, where we keep you up to date with the most interesting conversations that are taking place on the SitePoint forums. It's been a busy week, and we've had plenty of great threads covering demystifying closures, details on using photos from other sites, a renewed discussion about whether dependency injection breaks encapsulation, and your best apps of 2014. Demystifying closures In JavaScript, closure is a very handy technique that allows a function to retain a reference to variables from its parent scope. It can be confusing though as to how this is achieved, and how to make the best use of it. The discussion on demystifying JavaScript Closures, Callbacks, and IIFE's had a lot of valuable comments, and demonstrated that the manner in which we talk about closures can be confusing. Click through to join the discussion. Using photos from other sites Web development can be an image-heavy process, so the discussion around using photos from other sites has really taken off and helped people to understand issues around copyright. There are lots of stock photo sites that allow you to buy the rights to use certain images, and a Google Image Search even has a usage-rights selection so that you can search for images that you're allowed to use. One of the fundamental ideas that came up in the thread is that you're free to use photos that you've taken yourself, but when it comes to photos that other people have taken, you need to discover the license that's on the photo. Once you've done that and the license allows you to use it, or you've paid for the right to use the photo, it's all on from there. Click through to join the discussion. Click here to check out the discussion and join in yourself. Dependency injection breaks encapsulation A long-running and at times controversial discussion on dependency injection has renewed, with the aim of having a civilized discussion about whether dependency injection breaks encapsulation, and if there are times that dependency injection (DI) may not be useful.

Continue reading %On Our Radar: Closures, Copyright and the Best Apps of 2014%

Best PHP Framework 2015 Survey

Fr, 2015-02-27 17:00

Almost a year and a half ago we published the results of a framework survey on the PHP channel. The survey, while producing fewer entries than our IDE survey still provided us with valuable insight into our audience and the state of individual vs. team developers out there.

With Laravel 5 fresh out of the oven, Phalcon being kickstarted into full-time development, and others reaching a much anticipated maturity, it’s only natural we’re curious about your preferences - have they changed? Do they remain unbudged? Do you wish you could switch so hard you can taste it, but aren’t allowed to by your company? We’re interested in all these points and much more.

Continue reading %Best PHP Framework 2015 Survey%

Automotive Trends for App Developers

Fr, 2015-02-27 16:00

As cars continue to become more advanced, software developers are going to play a larger role in automotive technology than in prior years. Like shifts in wearable technology software is now used to expand the capabilities of cars beyond the basics.

At the recent International Consumer Electronics (CES) one of the primary themes of the event was the future of car manufacturing. Companies such as Toyota announced the first commercially available hydrogen powered vehicle and Mercedes Benz announced a luxury self-driving vehicle, there was still plenty of discussion on the finer details of automotive technology.

Continue reading %Automotive Trends for App Developers%

Image Tricks to Make Users Feel Rather Than Think

Fr, 2015-02-27 15:00

A picture is worth a thousand words.

We've all heard that old chestnut a thousand times before, right? In web design images are as important if not more than your actual copy.

While there's no doubting the precision that clear writing can bring to an idea, images have the ability to bypass the high-level, analytical brain and speak straight to us on an emotional level. Do we need another goofy cat Youtube video to prove that imagery can turn normal, intelligent discerning humans into giggling, retweeting fools?

There are three types of readers your site encounters. You have:

  • The Reader : an individual that reads every line
  • The Scanner : an individual who “scans” or “skims” through your content to find the interesting bits
  • The Bottom Feeder : an individual who reads the first few sentences and then cuts to the summary paragraphs

Do bear in mind, the same user could take on any of these roles, possibly even within the same browsing session.

The majority of readers fall under the scanner category, which makes it even more important to make emotionally impactful choices in regards to your visual content. Regardless of what type of readers you encounter there is one thing that you must always remember, you’re dealing with humans and humans are influenced by emotional triggers.

Film Cues

I find that the easiest way to explain and illustrate examples and techniques is to use common links. In this article I'm going to be borrowing from the world of film.

Most of us have films we relate to. We laughed or cried, we cheered for a hero, and we feared for a character's safety. Each film used a clever combination of image and sound to manipulate the way we felt. And we probably loved it.

Aside from entertaining us and creating a visual masterpiece with a strong story, directors aim to trigger some form of emotional reaction -- and if you reacted, even for a second, then they did their job.

This should be the way your approach your website imagery choices. Trigger an emotion and capture your audience.

Logic Doesn’t Dictate

Let's take a photo of a smiling face and animated body language. There's every chance that your three year old niece could tell you that the smiling person is happy.

While our logical brain can justify why the image might communicate happiness, it isn't part of the process that evokes the emotion for the viewer. Often our 'gut' reaction to an image comes first, and our logical brain is given the task of explaining our reasoning later.

Of the following two images, the left image may be more scientifically useful in understanding precisely what a frog is. But it's probably the right image that we engage with.

Two frog images -- which one engages you?

This is why, as designers, we should always favour emphasizing “feelings over logic”. It's more impactful and will do a better job making your visitors 'connect'.

To help this, we can employ some subtle techniques of adjusting the frame, manipulating the color and focal points we can craft the emotional message, in the same way we might craft written copy.

Key Techniques

While there are numerous ways to generate and evoke emotion the easiest and quickest results come from appropriate framing and lighting. These two methods help create atmosphere.

Consider the hard hitting moments in film. The parts where you are really made to feel. These are crafted thanks to the work of the cinematographer.

Below I’ll show you examples of how both framing and lighting choices can motivate the emotions needed for your site. Note that each image has gone undergone a very quick 5 minute edit to work as examples.

Framing

Framing is an important aspect whether you’re making movies or shooting photos. The proper angle and distance from the lens are just those small little changes that can create a “wow” effect for your viewers.

Let’s look at the two examples below to see how a good crop or tighter frame can change the overall mood of an image.

Example 1 (credit source) https://www.flickr.com/photos/coffeemakesitbetter/4866329711/in/photostream/

At first glance this image is of a good quality and has captured emotion. Upon second glance and if you are looking to place this on your website, say for the header/slider the image is fairly neutral.

Yes, the people appear happy but that’s because logic is telling you “smiling means happy”. Crowd shots are tricky when eliciting emotions.

Continue reading %Image Tricks to Make Users Feel Rather Than Think%

Share Images with a Pinterest Call-to-action

Do, 2015-02-26 21:00

In this article, I’ll demonstrate how to add a Pinterest call-to-action on top of an image when a user is actively interacting with it.

Firstly, let’s look at why you would even want to do that.

Sharing Is Caring

What constitutes good content often depends a lot on the particular needs and interests of end users. Good content might be attractive, effective, simple, functional, informative, inspiring … and so on.

We are used to adding social network buttons or links to share a page (ideally via fat-free buttons). Facebook, Twitter and Google+ are often the primary must-haves.

We may also want users to be able to share parts of our page. Page content is often made of chunks, and each of these chunks can be provided with its own preferred social network sharing feature.

For instance, a quote can be targeted to fit Twitter’s 140-character limit, and a picture can be aimed for Pinterest.

Let’s look at how you set up your images to be shared on Pinterest.

Anatomy of a Pin URL

A Pinterest Pin URL is made of four components:

  • the Pinterest part of the URL: https://www.pinterest.com/pin/create/button/
  • the url parameter: the address of the page to link to, URL-encoded
  • the media parameter: the address of the picture to share, URL-encoded
  • the description parameter: the descriptive text shown on Pinterest, URL-encoded, 500 characters max, but 200 characters seems to be the best choice.

Some HTML data elements can be added if you add Pinterest’s own JavaScript, especially data-pin-do and data-pin-config, but it won’t be needed in this case, as this is a fat-free approach where we rely on the strict minimum amount of code.

The Hard-coded Way

The code we want to get looks like this:

[html] [/html]

Each sharaeble picture (marked with the data-pin attribute pinIt) is prefixed with an anchor to the Pinterest sharing page with the right attributes in its URL, embedding a div to display the logo.

Three CSS classes are used here: pinterest-anchor, which absolutely sets the Pinterest logo position on the top-left corner of the picture; pinterest-hidden, which sets the visibility status of the logo, and pinterest-logo, the logo itself, 40x40 pixels, encoded in base64 in the CSS.

[html].pinterest-anchor { margin-left:10px; margin-top:10px; position:absolute; z-index:42; width:40px; height:40px; } .pinterest-hidden { display:none; } .pinterest-anchor:hover { display:block !important; } .pinterest-logo { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAL7UlEQVR42mK8mhDJwMjMzPDn21duBoZ/Ln8/f2xhZvqnxMTMyMZAR/Dv7/9ff/8x3WPm5atlYGDezcLF/fX/378MAAHEwsjIxPDv31/hfz++LGD8/sGHW1qWgUlIjIGJjYWBrg789Yfl37tXOt+fPlr/n1Nwyz8OjgQmRqa3AAHE8vf3b/7fn94uZfzxwZ3P3JKBQ1GV4d/P30D8g64OZGLnYGDS1GRguX+H4ePJYz7A4FzKyiccDhBALP9+/bBn/PrOnU/fmIGJh4/hy6VzYMf9//ePrg5kZGICO5JNUpqBT8eQ4dPFM+7/OLjsAQKI5eeHN62cAgIMDOxsDD/u3wWGNdBhjGBEXwC099+3b2A3sAoKM7AICDJ8//C2FSCAWJgY/yn9YwJmkq+fgaH2hwHstP9E+hrsEUY4DdEGIRnBXvzP8B/I/QeliXPoH7BbQG4CuQ0gAONkkgIACMPAgEvBg///qAerqLEI3sQHhEzpxDMZSXbeegueYNsZUvUxUVRRqqI1emtaHECOz3mHJIIsAYGFg5Q/nOa/XTTjEkAs/4Cu+g/igPE/okLt5+8/DG+//WD4AiwGGJjZGLgVlBgE5BQZOIVFGJhYQf79y/Dry2eGr8+eMry9fY3h9duPDNxAx4pyczCwshBROvxnBCGwhwECiAWUGcAZAoZx5TKgy34DHfTm4yeGj6wcDIKaegz6Tu4MkiaWDKxc3ECHM+KIsT8MLy+cYbi7ZR3Dw6sXGIT+/2EQ4uMDexRntDOCXQcOOIAAYvn3F+iov6CEAsVYADNQw3dgVD79AAwJIwsGy+BIBjFgrieq+ACGmKSJBRg/O3mU4dry+QzP7t5gkBIWxu1Ixv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wsN7j4eauZWFl3c3Ozv4V5HCAAAMAlTuh/0H0Uz0AAAAASUVORK5CYII=") no-repeat center center; background-size: 40px 40px; height: 100%; width: 100%; }[/html]

The animating part – showing and hiding the logo on hovering the picture – is handled in JavaScript, using jQuery notation:

[html]$("img[data-pin='pinIt']").each(function() { $(this).hover(function() { $(this).prev().css("display", "block") }, function() { $(this).prev().css("display", "none") }); });[/html]

Continue reading %Share Images with a Pinterest Call-to-action%

Using Font Awesome with WordPress

Do, 2015-02-26 18:00

Web Icons

Users today are focused just as much on the visual design of a website as they are about the content they need from it.

Traditionally designers and developers have used individual images/sprite-sheets for their icons; these graphics were a series of pixel perfect images that would be used in specific parts of the site (such as the search bar, navigational elements, loading icons and other elements).

Displaying icons with images/sprites worked well for a long time (and many websites will still use them). However, with the focus on responsive design more important than ever, the challenge has been providing stunning iconography that looks great regardless of your device.

What Are Font Icons?

Font icons are a way in which we can display fully responsive, customizable icons on our website without the use of additional images or sprite-sheets.

Font Icons are exactly what they sound like, a font made of icons.

Continue reading %Using Font Awesome with WordPress%

Do You Really Need an App for That?

Do, 2015-02-26 17:00

First everybody wanted a website. Then along came Flash and so people wanted a Flash site. Then there was Facebook and that became the must-have thing to be a part of. Now everybody wants a mobile app. But do they really need one?

After all, creating a mobile app is not without its challenges.

I delve deeper into this topic in a Learnable screencast at the end of this article by taking a look at case studies where the decision to go native perhaps wasn't the best.

The Problems with Going Native [caption id="attachment_100007" align="alignright" width="241"] With so many apps in the app store,
exposure is no reason to build an app.[/caption]

When smartphone app stores first launched there was a land rush to fulfill consumer demand for native applications. In those early days there were some incredible opportunities. But those days are gone.

With well over 1 million apps in both the iTunes and Android stores, supply has exceeded demand.

Worse still, getting found is difficult in stores lacking sophisticated search functionality. Where once being on the App Store provided unprecedented exposure, and there are still some ways to improve your app marketplace ranking, today it is likely your app will be rarely seen.

Even if a user does see your app and downloads it, that does not guarantee they will keep it. With limited storage space users only keep so many apps on their device. They’re ruthless when it comes to deleting apps. Users tend to only keep apps that they are using on a regular basis.

The biggest problem with native applications is their cost. Unlike learning HTML and CSS, there is a high barrier to entry when it comes to developing native mobile apps. This means that hiring application developers is expensive compared to their web counterparts.

But the real cost comes in supporting many platforms and devices. Unlike the web you cannot build once and be sure that it will work everywhere. You cannot even use the same language to code across more than one platform.

It is not only expensive to build your application in the first place but also to maintain it over time. Every new device released could force you to update your app. Changes in the screen size, resolution and OS can lead to alterations in your application.

Despite that, there are occasions when the costs are worth it because the use case justifies it.

Continue reading %Do You Really Need an App for That?%

Loading Code with Ruby

Do, 2015-02-26 15:30

Robert Qualls dives into the Ruby load path, including how ‘require’ works, how ‘load’ works, and how to make sure your code always gets loaded. Mastering the idiom of the load path is a core to become a solid Rubyist, so this video about ‘require’ is definitely ‘required’ viewing.

Continue reading %Loading Code with Ruby%

Understanding Sass Units

Do, 2015-02-26 15:00

Understanding Sass Units

I have written about units in Sass in the past for my own blog, and not so long ago as a CSS-Tricks Sass snippet, but given how often I notice confusion and misconception about the way units work in our beloved preprocessor, I thought a full length article would not be such a bad idea after all.

After two years of writing and reading Sass code every day, I must say that snippets, articles and library code misusing Sass units are beyond counting. I have been guilty of this myself in the past, and I have witnessed Sass core designers trying to teach developers to properly use Sass units more than once.

This battle is obviously not over so let's hope this article will be the coup de grace, in some way.

Units in real life

Before considering code, I think it is important to understand how numbers and units behave in real life. You may not have noticed this yet, but there are very few numbers we use in our daily life that do not have a unit. When we say "speed limit is 50", we implicitly mean "50 kilometers per hour"; in this case the unit is km/h. When we say "look, eggs! I'll have a dozen of those", the unit is eggs: a dozen of eggs. There are exceptions of course but most usages of numbers in our daily routine usually involve a unit.

Along the same lines, running mathematical operations on numbers with units follow some rules. For instance, there are reasons why an area of 5 meters per 5 meters gives 25 square meters (m²). Same for a cube of 1 meter side: it has a volume of 1m3 because 1 meter per 1 meter per 1 meter doesn't give 3 meters, but 1 cubic meter.

I like how Chris Eppstein puts it:

Continue reading %Understanding Sass Units%

What’s New in Firefox 36: Android Debugging, HTTP/2 Support and More!

Mi, 2015-02-25 23:00

Another six weeks after the release of Firefox 35, users can get their hands on the new 36 update, promising some new additions and fixes. You can upgrade to Firefox 36 by either waiting for the auto-update, either by choosing About Firefox from the menu or downloading the new installer manually from Firefox.com. I tried […]

Continue reading %What’s New in Firefox 36: Android Debugging, HTTP/2 Support and More!%

Isomorphic JavaScript Applications — the Future of the Web?

Mi, 2015-02-25 21:00

One of the best known mottos around the web is Java’s Write once, run everywhere. But does this motto apply to Java only? Can we use it to describe JavaScript too? The answer is Yes.

In this article, I’ll introduce you to the concept of isomorphic JavaScript applications, describing what they are and pointing to resources that help you develop this kind of application.

How We Arrived Here

Many years ago, the web was a bunch of static pages made with HTML and CSS without much interactivity. Each user action required the server to create and serve a complete page. Thanks to JavaScript, developers started to create nice effects, but it was with the advent of Ajax that a revolution started. Web developers began to write code that could communicate with the server to send and receive data without the need to reload the page.

As the years have passed, the responsibilities of the client-side code have grown a lot, resulting in a new type of application known as the single-page application (SPA). In an SPA, all the necessary assets are retrieved with a single page load, or dynamically loaded and added to the page as necessary. Some examples of SPAs are Gmail and the StackeStackEditdit editor.

SPAs allow for better interactivity, because almost all their operations are executed on the client, keeping communications with the server to a bare minimum. Unfortunately, they also have some major problems. Let’s discuss some of them.

Continue reading %Isomorphic JavaScript Applications — the Future of the Web?%