Infinite Scrolling, Pagination Or “Load More” Buttons? Usability Findings In eCommerce


  

What is the best UX pattern to display products on an e-commerce website: pagination, a “Load more” button or infinite scrolling? At Baymard Institute, we’ve conducted several year-long large-scale usability studies of more than 50+ leading e-commerce websites. We tested (among other things) these three design patterns for loading products, both on desktop and mobile.

Infitite Scrolling, Pagination and Load More Buttons

Pagination is still the most popular way to load new items on a website because it ships by default in almost every single e-commerce platform. However, our usability test sessions found “Load more” buttons combined with lazy-loading to be a superior implementation, resulting in a more seamless user experience. We found that infinite scrolling can be downright harmful to usability — in particular, for search results and on mobile. However, it’s not black and white, because the performance of each method varies according to the context of the page.

The post Infinite Scrolling, Pagination Or “Load More” Buttons? Usability Findings In eCommerce appeared first on Smashing Magazine.


Source: Smashing Magazine

What Entrepreneurs Can Learn from Blizzard Entertainment

This editorial was originally published in the SitePoint Entrepreneur newsletter. Sign up here to receive updates on our Entrepreneur coverage every two weeks.

Winston from Blizzard's Overwatch

In November of last year, Blizzard Entertainment announced that it’d no longer share World of Warcraft subscriber numbers in its quarterly earnings reports.

“There are other metrics that are better indicators of the overall Blizzard business performance,” the company said at the time.

World of Warcraft subscriber numbers had peaked in 2010 during its Wrath of the Lich King expansion, when it reached over 12 million subscribers. The next two expansions didn’t resonate with subscribers as well, and that number quickly dropped to 10.2 million in 2011, 9.1 million in 2012, and 8.2 million in 2013. 

But in a surprising turn events, that number shot back past 10 million in 2014 with the announcement of the Warlords of Draenor expansion. Players I’ve spoken with say that this expansion seemed to reinvigorate the interest of the playerbase by getting back to the core values of the game, and this seems to have held true — for a short time. The early play experience was highly engaging, but the expansion didn’t have much staying power, and only a couple of months post-launch, subscriptions were in freefall again.

As of the November earnings report, the last time for which we’ll have accurate data, the number stood at 5.5 million — the lowest it has been in nine years.

There was a lot of speculation about Blizzard’s reasons for pulling the plug on this reporting. Some thought that the negative press from the games and tech media and the hyperbolic “WoW is dead!”  rhetoric from players — something that has existed for most of the game’s life, regardless of the situation — were causing Blizzard PR problems when it came to buoying the subscription number. My interpretation differs.

Blizzard knew that while WoW was not dying, it had certainly already lived past expectations and was going to decline into a more niche product played by a few million dedicated fans, and it was going to do this faster and faster. It would still have a strong playerbase that could likely support several future expansion releases. It would still be able to cash in on short nostalgia-driven subscription spikes with new expansion releases, but it would not always remain the company-buoying revenue behemoth that it was. And it figured this out years ago.

The decline of World of Warcraft is not a problem in and of itself. It is more than ten years old; it’s amazing that it has lasted as long as it has, and it’s also fairly amazing that the team has managed to improve it over time as much as it has without starting from scratch. Most importantly, it has already made Blizzard more money than anyone ever imagined it would. What made it a problem is that when the subscription decline first began, while Blizzard had other big titles in Diablo and Starcraft and likely wouldn’t fold, it didn’t have anything in play that could keep the momentum and growth of the company from going in the reverse direction should Warcraft subscriptions really plummet.

As of 2016, it has fixed that problem, and it has done that by embracing values that anyone who has worked in startups would recognize.

Continue reading %What Entrepreneurs Can Learn from Blizzard Entertainment%


Source: Sitepoint

The Startup’s Guide to Podcast Advertising

Microphone in recording studio

Despite being about as hip as the average mother (that is, not very), my mom is definitely in the know when it comes to cool new startup products.

Harry’s Razors? She bought them for my dad. A Casper mattress? She’s never slept better. An Audible subscription? Listening to Gone Girl spiced up her commute to work.

If you listen to podcasts, you’ll know how my mom is learning about all these companies. Podcast advertising is taking off; so much so that in April of 2015, the Interactive Advertising Bureau published a 27-page “Digital Audio Buyer’s Guide”. In a single year, advertisers will spend $34 million on podcasts (and that’s a low estimate).

[author_more]

Of course, the rise in advertising is stemming from a rise in the podcasting industry itself. According to Edison Research, one-third of the U.S. population has listened to a podcast–a 300% increase since 2006.

So, if you’re looking for a great way to get the word out about your startup, you should definitely consider podcast sponsorships. 

Why Podcasting Is Such a Great Ad Medium

As you no doubt know, most people pay little attention to traditional ads–if they don’t ignore them completely. From banner ads on websites, which 99.8% of people don’t engage with, to TV ads, which 37% ignore, most mediums have low interaction rates.

The recent rise in ad-blocking makes advertisers even more nervous.

Podcasts are different. Not only do people listen to the ads, they actually enjoy them.

First, most people simply can’t ignore the ads. More than 25% of podcast consumers listen during their morning commute. Other popular podcasting activities include walking the dog, doing household chores, and working out. These activities don’t allow you to fast-forward through an ad, nor do they let you focus on something else until the ad finishes.

But the vast majority of people don’t want to. Podcast ads are considered fun and engaging. Many of them match the overall tone of the podcast; for example, PC’s ads for Reply All (a popular Internet-themed podcast), feature a charming exchange between the Reply All host and a young couple, who agree they’d rather save their laptops than their wedding pictures.

Most ads are read by the hosts themselves, which makes you feel as though you’re hearing about, say, Stamps.com from a friend rather than a self-interested stranger.

As Adam Sachs, CEO of ad network Midroll, told Fast Company, “That passive endorsement is really powerful.”

The Set-Up

Before you can make any decisions, it’s helpful to know the jargon.

Pre-roll: This 15-second spot opens the podcast. Usually, it has more of the traditional audio ad feel than the mid-roll, which can be more casual.

Mid-roll: These 30 to 60-second segments occur periodically throughout the episode. 

Offer code: Most podcast ads offer listeners a unique promo code, which allows sponsors to track how many conversions they’re getting.

Native ad: The standard podcast ad consists of the host(s) reading a script into the microphone. However, you’ll also hear the occasional agency-produced ad, with music, sound effects, interviewees, etc.

Outro: The final part of a podcast, during which the host can urge listeners once again to try out the company (“Don’t forget to use offer code Take30 to receive 20% off your first Wayne purchase”) or simply remind them of the sponsorship (“Thanks to Wayne for sponsoring this episode.”)

Direct response: Since most podcatchers offer linkable show notes or captions, you can now provide direct links to your site or product page.

Podcatcher: A podcast player. iTunes still reigns supreme, but apps like Stitcher, Overcast, and Castro are gaining ground.

Finding Podcasts

The beginning step in any marketing strategy is to find the appropriate outlets.

You can tackle this project in two ways.

The first way is to identify shows your target demographic is listening to, contact those shows, and ask to sponsor them. 

Let’s say your company provides millennials with simple, easy-to-use banking software. After some research, you decide to approach Night Vale and Rooster Teeth, two shows popular among millennials.

Pros: This approach is pretty low-budget. Also, it allows you to scout out niche podcasts that directly appeal to your core market–as opposed to hyper-popular shows like Serial that everyone listens to.

Cons: It’s a pretty unscientific and time-consuming approach.

The second option is to work with a podcast network, like Midroll or Archer Avenue. They act as the middleman, matching you with multiple shows within their roster.

Pros: Almost all of the heavy lifting is outsourced. Plus, you can gain access to top podcasters (who may ignore you if you reach out to them independently).

Cons: It’s more expensive.

While your decision will depend on how much you can afford to spend and the audience size you’re going after, in general, I’d recommend starting with the first approach, seeing how it goes, and iterating on your approach, then moving to the second.

Continue reading %The Startup’s Guide to Podcast Advertising%


Source: Sitepoint

Interactive JavaScript Charts Using Data from Google Sheets

Meet my friend Jenny. She recently started coding websites. She loved her job and was very happy until she met Steve, who has a reputation of being, let’s say, not a very easygoing client.

Steve had a lot of data in a spreadsheet and he wanted to display that on his website. Our friend (now Jenny is your friend too!) suggested that Steve make the charts in Excel and upload them as images to the website.

[author_more]

But Steve being Steve, he wanted the charts to be interactive. Not only that, he also wanted the charts to get updated whenever he made a change to the data in his spreadsheet .

Jenny didn’t know how to tackle this issue, so she came to me. And, being the good friend I am, I gave her this advice:

First ask your client to move his data to Google Sheets (because that’s what all the cool people are doing nowadays). Then we can easily implement the features that he needs — interactive JavaScript charts and dynamic updating.

Her client agreed (luckily!), and Jenny and I coded rest of the solution. But how? Well, that’s what this tutorial will teach you.

I have divided this tutorial into five easy-to-follow steps:

  1. Exporting data from Google Sheets
  2. Fetching JSON from Google Sheets via Ajax
  3. Restructuring the data
  4. Creating a chart with FusionCharts.
  5. Customizing the chart

So without further ado, let’s dive in!

Exporting Google Sheets Data as JSON

Before delving into how to export data, let’s first create a sheet. Assuming you’ve got a Google account, you can do this by going to the Google Sheets page and hitting the Start a new spreadsheet button. In the spreadsheet that opens, create two columns: Actor and Income. Then fill your newly created sheet with some data. I’ve taken mine from here: The World’s Highest-Paid Actors 2015.

As you can see, the left column contains labels for our chart, the right one values corresponding to those labels. For those of you following along at home, you can grab a copy of this sheet here (go to File > Make a copy).

The data available in Google Sheets can be exported to multiple formats like JSON, XML etc. And once exported to any of those formats, it can be easily accessed via the web.

To open your document to the web, you need to make the following changes to the document settings:

  • Set the sharing of the document to either Public on the web, or Anyone with the link. To achieve this, click the Share button in the top right-hand corner, then click the Advanced option that appears in the bottom right of the pop up.
  • Publish the document to the web. This option is available under File > Publish to the web

With these two changes made, the data in the document can be accessed in JSON format via: https://spreadsheets.google.com/feeds/list/SPREADSHEET/od6/public/basic?alt=json

You will need to replace SPREADSHEET with the ID of your Google Sheet, which in our case is 1Aoz_GcPYoEIMMNd1N_meYNOp8TJ0fCXpp1AoUhCpwZo. You can see the results here.

Using jQuery to Fetch JSON from Google Sheets

We will use jQuery’s get() method to fetch the data from Google Sheets. You can include jQuery from a CDN as shown:

Continue reading %Interactive JavaScript Charts Using Data from Google Sheets%


Source: Sitepoint

Is Your IT Career in Need of a Boost?

Is your IT career in need of a boost?

The answer is probably yes. Especially when it comes with more money and more job security. Get both with two certifications hiring managers love to see. We’ll help with the MCSA Windows Server 2012 & Cisco Network Associate Certification Training—it’s just $69.99 at SitePoint Shop.

You’ll save 94% off the regular price of $1,198 when you grab this two-course bundle from us. Consider it the first step toward a big leap. The bundle will prep you for the CCNA and MCSA certification exams with info-packed presentations, practice exams, and learning supplements, all of which you’ll have access to for a full year. Learn how to install, operate, and troubleshoot a network, pick up essential wireless networking concepts, and master server infrastructure, desktop infrastructure, messaging, communication, and SharePoint—everything you need to impress at a job interview or when asking for a promotion.

Save 94% on the MCSA Windows Server 2012 & Cisco Network Associate Certification Training—get it for $69.99 at SitePoint Shop!

Continue reading %Is Your IT Career in Need of a Boost?%


Source: Sitepoint

Ruby/Rails Code Smell Basics 02

file

This is part 2 of a small series about code smells and possible refactorings. The target audience I had in mind are newbies who heard about this topic and who maybe wanted to wait a bit before entering these advanced waters. The following article covers “Feature Envy”, “Shotgun Surgery” and “Divergent Change”.

Topics

  • Feature Envy
  • Shotgun Surgery
  • Divergent Change

What you’ll quickly realize with code smells is that some of them are very close cousins. Even their refactorings are sometimes related—for example, Inline Class and Extract Class are not that different.

With inlining a class, for example, you extract the whole class while you get rid of the original one. So kinda extract class with a little twist. The point I’m trying to make is that you shouldn’t feel overwhelmed by the number of smells and refactorings, and certainly shouldn’t get discouraged by their clever names. Things like Shotgun Surgery, Feature Envy and Divergent Change might sound fancy and intimidating to people who just got started. Maybe I’m wrong, of course.

If you dive a little into this whole topic and play with a couple of refactorings for code smells yourself, you’ll quickly see that they often end up in the same ballpark. A lot of refactorings are simply different strategies to get to a point where you have classes that are concise, well organized, and focused on a small amount of responsibilities. I think it’s fair to say that if you can achieve that, you’ll be ahead of the pack most of the time—not that being ahead of others is so important, but such class design is simply often missing in code from people before they’re considered “experts”.

So why not get into the game early and build a concrete foundation for designing your code. Don’t believe what may be your own narrative that this is an advanced topic that you should put off for a while until you’re ready. Even if you’re a newbie, if you take small steps you can wrap your head around smells and their refactorings a lot earlier than you might think.

Before we dive into the mechanics, I want to repeat an important point from the first article. Not every smell is inherently bad, and not every refactoring is always worth it. You have to decide on the spot—when you have all the relevant information at your disposal—if your code is more stable after a refactoring and if it’s worth your time to fix the smell.

Feature Envy

Let’s revisit an example from the previous article. We extracted a long list of parameters for #assign_new_mission into a parameter object via the Mission class. So far so cool.

M with feature envy

I briefly mentioned how we can simplify the M class even more by moving the method #assign_new_mission to the new class for the parameter object. What I didn’t address was the fact that M had an easily curable form of feature envy as well. M was way too nosy about attributes of Mission. Put differently, she asked way too many “questions” about the mission object. It’s not only a bad case of micromanagement but also a very common code smell.

Let me show you what I mean. In M#assign_new_mission, M is “envious” about the data in the new parameter object and wants to access it all over the place.

  • mission.mission_name
  • mission.agent_name
  • mission.objective
  • mission.licence_to_kill

In addition to that, you also have a parameter object Mission that is only responsible for data right now—which is another smell, a Data Class.

This whole situation tells you basically that #assign_new_mission wants to be somewhere else and M doesn’t need to know the details of how missions get assigned. After all, why wouldn’t it be a mission’s responsibility to assign new missions? Remember to always to put things together that also change together.

M without feature envy

As you can see, we simplified things quite a bit. The method slimmed down significantly and delegates the behaviour to the object in charge. M does not request mission data specifics anymore and certainly stays away from getting involved in how assignments get printed. Now she can focus on her real job and doesn’t need to be disturbed if any details of mission assignments change. More time for mind games and hunting down rogue agents. Win-win!

Feature envy breeds entanglement—by that I don’t mean the good kind, the one that lets information travel faster than light spookily—I’m talking about the one that over time might let your development momentum grind to an every more approaching halt. Not good! Why so? Ripple effects throughout your code will create resistance! A change in one place butterflies through all kinds of stuff and you end up as a kite in a hurricane. (Ok, a bit overly dramatic, but I give myself a B+ for the Bond reference in there.)

As a general antidote for feature envy, you want to aim for designing classes that are concerned mostly about their own stuff and have—if possible—single responsibilities. In short, classes should be something like friendly otakus. Socially that might not be the healthiest of behaviours, but for designing classes it often is a reasonable guideline to keep your momentum where it should be—moving forward!

Shotgun Surgery

The name is a little bit silly, isn’t? But at the same time it’s a pretty accurate description. Sounds like serious business, and it is! Luckily it’s not that hard to grasp, but nonetheless it’s one of the nastier code smells. Why? Because it breeds duplication like no other, and it’s easy to lose sight of all the changes you’d need to make to fix things. What happens during shotgun surgery is you make a change in one class/file and you also need to touch many other classes/files that need to be updated. Hope that doesn’t sound like a good time you’re in for.

For example, you may think you can get away with one little change in one place, and then realize that you have to wade through a whole bunch of files to make either the same change or fix something else that is broken because of it. Not good, not at all! That sounds more like a good reason why people start to hate the code they’re dealing with.

If you have a spectrum with DRY code on one side, then code that often needs shotgun surgery is pretty much on the opposite end. Don’t be lazy and let yourself enter that territory. I’m sure you’d rather open one file and apply your changes there and be done with it. That’s the kind of lazy you should strive for!

To avoid this smell, here’s a short list of symptoms you can look out for:

  • Feature Envy
  • Tight coupling
  • Long Parameter List
  • Any form of code duplication

What do we mean when we talk about code that is coupled? Let’s say we have objects A and B. If they are not coupled then you can change one of them without affecting the other. Otherwise you’ll more often than not also have to deal with the other object as well.

This is a problem, and shotgun surgery is a symptom for tight coupling as well. So always watch out for how easily you can change your code. If it’s relatively easy it means that your level of coupling is acceptably low. Having said that, I realize that your expectations would be unrealistic if you expect to be able to avoid coupling all the time at all costs. That’s not going to happen! You will find good reasons to decide against that urge—like replacing conditionals with Polymorphism. In such a case, a little bit of coupling, shotgun surgery and keeping the API of objects in sync is well worth getting rid of a ton of case statements via a Null Object (more on that in a later piece).

Most commonly you can apply one of the following refactorings to heal the wounds:

  • Move Field
  • Inline Class
  • Extract Class
  • Move Method

Let’s look at some code. This example is a slice of how a Spectre app handles payments between their contractors and evil clients. I simplified the payments a bit by having standard fees for both contractors and clients. So it doesn’t matter whether Spectre is tasked to kidnap a cat or extort a whole country: the fee stays the same. The same goes for what they pay their contractors. In the rare case an operation goes south and another Nr. 2 has to literally jump the shark, Spectre offers a full refund to keep evil clients happy. Spectre uses some proprietary payment gem that is basically a placeholder for any kind of payment processor.

In the first example below, it would be a pain if Spectre decided to use another library to handle payments. There would be more moving parts involved, but for demonstrating shotgun surgery this amount of complexity will do I think:

Example with shotgun surgery smell:

When you look at this code you should ask yourself: “Should the EvilClients class be really concerned about how the payment processor accepts new evil clients and how they are charged for operations?” Of course not! Is it a good idea to spread the various amounts to pay all over the place? Should the implementation details of the payments processor be showing up in any of these classes? Most definitely not!

Look at it from that way. If you want to change something about the way you handle payments, why would you need to open the EvilClient class? In other cases it could be a user or customer. If you think about it, it doesn’t make any sense to familiarize them with this process.

In this example, it should be easy to see that changes to the way you accept and transfer payments create ripple effects throughout your code. Also, if you wanted to change the amount you charge or transfer to your contractors, you’d need additional changes all over the place. Prime examples of shotgun surgery. And in this case we’re only dealing with three classes. Imagine your pain if a bit more realistic complexity is involved. Yep, that’s the stuff nightmares are made of. Let’s look at an example that is a bit more sane:

Example without shotgun surgery smell and extracted class:

What we did here is wrap the PaymentGem API in our own class. Now we have one central place where we apply our changes if we decide that, for example, a SpectrePaymentGem would work better for us. No more touching of multiple—to payments’ internals unrelated—files if we need to adapt to changes. In the classes that deal with payments, we simply instantiated the PaymentHandler and delegate the needed functionality. Easy, stable, and no reason to change.

And not only have we contained everything in a single file. Within the PaymentsHandler class, there is only one place we need to swap out and reference a possible new payment processor—in initialize. That is rad in my book. Sure, if the new payment service has a completely different API, you need to tweak the bodies of a couple of methods in PaymentHandler. It’s a tiny price to pay compared to full-on shotgun surgery—that’s more like surgery for a small splinter in your finger. Good deal!

If you’re not careful when you write tests for a payment processor like this—or any external service you need to rely on—you are possibly in for serious headaches when they change their API. They “suffer from change” as well, of course. And the question is not will they change their API, only when.

Through our encapsulation we’re in a much better position to stub our methods for the payment processor. Why? Because the methods we stub are our own and they only change when we want them to. That is a big win. If you’re new to testing and this is not completely clear to you, don’t worry about it. Take your time; this topic can be tricky at first. Because it’s such an advantage, I just wanted to mention it for the sake of completeness.

As you can see, I simplified payment processing quite a bit in this silly example. I could have cleaned the final result some more as well, but the point was to clearly demonstrate the smell and how you can get rid of it through abstraction.

If you’re not completely happy with this class and see opportunities for refactoring, I salute you—and am happy to take credit for it. I recommend you knock yourself out! A good start might be dealing with the way you find payments_ids. The class itself also got a bit crowded already…

Divergent Change

Divergent change is, in a way, the opposite of shotgun surgery—where you want to change one thing and need to blast that change through a bunch of different files. Here a single class is often changed for different reasons and in different ways. My recommendation is to identify parts that change together and extract them in a separate class that can focus on that single responsibility. These classes in turn should also have no more than one reason to change—if not, another divergent change smell is most likely waiting to bite you.

Classes that suffer from divergent change are ones that get changed a lot. With tools like Churn, you can measure how often particular parts of your code needed to change in the past. The more points you find on a class, the higher the probability that divergent change might be at work. I also wouldn’t be surprised if exactly these classes are the ones that cause the most bugs overall.

Don’t get me wrong: getting changed often is not directly the smell. It’s a useful symptom, though. Another very common and more explicit symptom is that this object needs to juggle more than one responsibility. The single responsibility principle SRP is an excellent guideline to prevent this code smell and to write more stable code in general. It can be tricky to follow, but nevertheless still worth the grind.

Let’s look at this nasty example below. I modified the shotgun surgery example a bit. Blofeld, head of Spectre, might be known to micromanage stuff, but I doubt he would be interested in half the stuff this class is involved with.

The Spectre class has way too many different things it is concerned about:

  • Assigning new operations
  • Charging for their dirty work
  • Printing mission assignments
  • Killing unsuccessful spectre agents
  • Dealing with the PaymentGem internals
  • Paying their Spectre agents/contractors
  • It also knows about the amounts of money for charging and payout

Seven different responsibilities on a single class. Not good! You need to change how agents are disposed of? One vector for changing the Spectre class. You want to handle payouts differently? Another vector. You get the drift.

Although this example is far from being realistic, it still tells the story of how easy it is to unnecessarily amass behaviour that needs to change frequently in a single place. We can do better!

Here we extracted a bunch of classes and gave them their own unique responsibilities—and therefore their own contained reason to change.

You want to handle payments differently? Now you won’t need to touch the Spectre class. You need to charge or pay out differently? Again, no need to open the file for Spectre. Printing operation assignments is now the business of operation—where it belongs. That’s it. Not too complicated, I think, but definitely one of the more common smells you should learn to handle early.

Final Thoughts

I hope you got to the point where you feel ready to try these refactorings in your own code and have an easier time identifying code smells around you. Beware that we just got started, but that you already tackled a couple of big ones. I bet it was not as tricky as you once might have thought!

Sure, real-world examples will be a lot more challenging, but if you have understood the mechanics and patterns to spot smells, you’ll surely be able to adapt quickly to realistic complexities.


Source: Nettuts Web Development

Desktop Wallpaper Calendars: March 2016


  

Inspiration lies everywhere: in a conversation, a walk through a foreign city, or, in other people’s works. To fuel your ideas, we celebrate the beginning of each month with what we found to be the best source for daily inspiration: desktop wallpapers that are a bit more distinctive than the usual crowd. This creativity mission has been going on for almost eight years now, and we are very thankful to all designers who have contributed and are still diligently contributing each month.

Desktop Wallpaper Calendars: March 2016

This post features their artwork for March 2016. Each wallpaper comes in two versions — with and without a calendar — and can be downloaded for free. It’s time to freshen up your desktop!

The post Desktop Wallpaper Calendars: March 2016 appeared first on Smashing Magazine.


Source: Smashing Magazine

How Big Does Your Startup Really Need to Be?

This editorial was originally published in the SitePoint Entrepreneur newsletter. Sign up here to receive updates on our Entrepreneur coverage every two weeks.

Growth

How quickly should a startup grow? How soon should you shift your focus from sheer growth to making a buck?

The downsides to high valuations are currently on prominent display.

Yahoo! is a company that has undergone a well-documented struggle for relevance over the years, and its assets cannot easily be absorbed by companies with more forward momentum because it is too expensive.

Twitter is an example of a company that went public amidst outsized expectations around its future and has struggled to live up to the hype. Bad leadership since the ouster of Dick Costolo hasn’t helped, and political meddling and general disdain for the wants and needs of its userbase have made things worse. But primarily, it is being held back by the expectations set with its $32 billion IPO.

It has little room to truly maneuver into a pace of operation that will serve it best, which, it is increasingly suggested, is probably at the size of its current userbase.

Grow quickly and worry about revenue later has been the mantra of the Silicon Valley startup scene for years, but if you’ve been paying any attention lately, you’ll know that sentiment is starting to change.

Continue reading %How Big Does Your Startup Really Need to Be?%


Source: Sitepoint

API Building and Testing Made Easier with Postman

Postman logo

An API (application programming interface) is a medium of interaction between applications. APIs that use HTTP or HTTPS are called Web APIs.

If you look around on the Internet, a large number of services use APIs. Anything with a social login uses an API; the mobile application of an ecommerce site uses an API; even the ads that you see on the Internet use APIs!

By creating an API for your service, you enable third-party developers to create applications based on your service. For instance, the social newspaper Frrole uses the Twitter API to generate contextual insights by analyzing a large volume of tweets.

Assuming you have assessed the pros and cons of creating an API, let’s talk briefly about the process of creating and testing APIs.

Creating APIs

Although there are many ways of creating an API, a Web API is created using the REST (Representational State Transfer) framework. The REST framework states a set of guidelines that one must follow while creating an API. With the large number of APIs being created daily, it serves as a standard for Web-based APIs.

The four most common actions performed through APIs are view, create, edit and delete objects. The REST framework maps four HTTP verbs to these actions: GET, POST, PUT and DELETE. There are many verbs that have been added to this list like PURGE and PATCH, but in this article, we’ll talk about only the four basic ones. This article on the best practices for a pragmatic RESTful API, by Vinay Sahni, founder at Enchant.com, may be useful for a first-time developer.

Nowadays, there are many frameworks that provide wrappers over the basic HTTP layers, thus making your life as a developer easier. All you need to do is invoke the required commands or functions and focus on the functionality. Popular examples include Slim and Toro, two PHP-based micro frameworks that help you create REST APIs quickly.

Testing APIs through the CLI

The prime motive of creating an API is to enable other applications (which may be yours or developed by third parties) to use the services. Therefore, at every stage of the API development process, a critical part is testing the API for functionality, exception handling and security.

Using an API involves a request to the required resource (usually a URL) using one of the verbs (or methods). You may have to add headers depending on the requirements of the API you’re using. One way to request such a resource is through the command line.

In this post, we’ll concentrate on four parts of an API call – the URL, the HTTP verb, the headers and parameters. We’ll use the cURL library to send requests to the API resources through the CLI. cURL is a command line tool that helps in transferring data with URL syntax – supporting FTP, FTPS, HTTP, HTTPS.

Let’s look at the following command:

curl -i -X POST -H "Content-Type:application/json" http://www.my-api-example.com:port/ -d '{"Name":"Something"}'

The -i command stands for include, which tells the command that headers are present in the request. The -X option is immediately followed by the HTTP verb or method. -H specifies custom headers that are added to the request. Finally, the -d option specifies custom form data to be passed along with the request.

The result of an API call is an HTTP response, usually encoded in the JSON format. The response is coupled with an HTTP response code, which gives information about the status of the request (like 200 for OK, 404 if the resource does not exist, 500 if there’s a server error and 403 if the resource is forbidden). For instance, the following response could be sent as a result of the earlier request, along with a 200 status code:

[code language=”javascript”]{“message”:”success”,”id”:”4″}[/code]

Testing such responses within the command line poses a challenge too, especially if the responses have a large number of options.

A list of CLI options while testing APIs are listed in this detailed guide by Codingpedia.

Continue reading %API Building and Testing Made Easier with Postman%


Source: Sitepoint

Build Cross-Platform Android and iOS UIs with Xamarin Forms

Xamarin aims to provide a solution to allow companies and developers develop natively and cross-platform. Using Xamarin, developers can target Android, iOS and Windows (Mobile) 10, using a single industry standard language, C#. Certain aspects of the code base are platform specific, for example the UI layer, forcing programmers to develop them repeatedly for each platform.

In 2014, Xamarin introduced Xamarin Forms (XF). XF introduces an abstraction layer which allows developers to declare the UI using XAML (Extensible Application Markup Language) declarations and/or code.

Xamarin vs Xamarin Forms

Using XF, programmers are now able to define and create mobile applications targeting multiple platforms with the same code and definitions. XF renders those instructions into platform-specific code and user experiences. Using this approach, applications get a native user experience, controls and patterns familiar to their users.

Example of the same UI rendered on different platforms

XAML makes the creation of the UI declarative and succinct in comparison to creating the UI by code, but it’s not required to get started. Developers with a background in XAML related technologies, such as WPF (used to develop Windows desktop applications) or Windows Phone / Windows Store applications, will feel at home, since many of the concepts are similar.

Continue reading %Build Cross-Platform Android and iOS UIs with Xamarin Forms%


Source: Sitepoint