VGTech is a blog where the developers and devops of Norways most visited website share code and tricks of the trade… Read more



Are you brilliant? We're hiring. Read more

Async programming patterns in different languages

Android

During the 10 years I’ve been into professional programming, the largest paradigm shift I’ve witnessed is the one from sequential to asynchronous programming. Not that it is a new concept – asynchronousity has been has been present in programming since the dawn of time, but what’s new is the tight integration in programming languages and the prevalence of it. From events and callbacks in C# to async-await. From callbacks in Javascript to Promises. In Java we got Futures in Java 7, CompletableFuture, lambdas and streams in Java 8. On top of all these language features you have a vast array of libraries that help you implement common async patterns – ReactiveX for instance exists for all the three languages mentioned, and a lot more.

(more…)


VG increases advertisement viewability to 74%

Advertisers don’t want to pay for advertisement placements that people don’t see. An ad loaded doesn’t necessarily equal an ad viewed, the publishers and advertisers have caught on to this and are naturally shifting towards valuing ‘viewable’ ads rather than served impressions. VG has been working on improving the percentage of ads viewable on our website, we are now guaranteeing a minimum of 70% viewability of ads on vg.no.

(more…)


Roc  —  One solution to JavaScript Fatigue

Frontend

1-XjYBdRCaxe_11pd9275vlw

An open source toolkit for JavaScript development

There has been a lot of talk recently about how hard it is to do web development in this day and age. People are describing the current state of web development as depressing and frustrating, referring to it as JavaScript Fatigue. If you haven’t I would recommend you to go and read this excellent article by Eric Clemmons on the topic: Javascript Fatigue.

We need to do something about this and we need to do it now. Web development should not be frustrating. In fact I believe that it has never been as exciting and fun as it is now.

As mentioned in the article above several people are trying to find a solution to this symptom, all with different goals and ambitions. I would like to go ahead and present one such solution, one that I have personally been involved with, Roc.

(more…)


Rethinking modern JavaScript development

Frontend

Tiny libraries. Doing one thing well. A blessing and a curse?

This article presents the reasoning behind the creation of Roc, a modern JavaScript toolkit. If you are not interested in the background you can get started here instantly.


The modern days of JavaScript has us shifting away from the more traditional and rigid frameworks. Instead we are now in a fast-moving trend of using a large number of micro-libraries from npm that are combined within our own projects.

npm

This approach yields great flexibility and freedom of choice for us as JavaScript developers. We get to pick the exact building blocks that we would like to use in order to build our apps and components. With tools like Babel and Webpack one really can use the latest technology to get things done. Adding libraries to our project with npm is easy and almost instant. Yeah!

(more…)


Data insight at the heart of VG+ success

Data Science

VG’s premium digital product, VG+ recently celebrated its fifth anniversary with over 70 000 paying subscribers. VG+ is a five year old publication published by a tabloid newspaper with no history of subscriptions.
VG+ is now the fourth largest newspaper in Norway with ambitions to surpass the 100,000 subscriber milestone in 2016. In a country with a population of just over 5 million people the subscription numbers are starting to be substantial.  

ThirdEditorailProduct

(more…)


VG Hack Day 2015

Design

hackday_4312

On a cold Thursday in December, we held our annual Hack Day on the top floor of the VG building in Oslo. 30+ eager developers, designers and product people huddled together in front of the fireplace, to experiment, create and have fun with VG’s products and technology.

Surrounded by soda cans and bags of snacks, and entangled in wires of all kinds, we sat for 18 hours, churning out lines of magical code and golden pixels. Continue reading to see some of the things we did.
(more…)


Be environment aware!

Frontend

Every once in a while, I see or hear someone complaining that a basic React application ran through Webpack ends up being 700 kB or more. I think it’s important to take a look at why this is happening – cause it’s usually all about the environment.

When you’re in development, what you want is:

  • Quick builds
  • Being able to trace an error back to the correct line number
  • Warnings if you’re doing something wrong

When you’re in production, what you want is:

  • Smallest bundle size
  • Fastest execution

(more…)


Content in the right context is king

In the media industry content is no longer king, content delivered in the right context is now king. We need to deliver the right content at the right time to the right person. The dialog between a newspaper and their readers has to change from a blanket broadcast to the masses to a tailored conversation with the individual.

How can we create content and products that replicate natural conversation, if journalists had the ability to sit down and have a conversation with each of their readers, how would they adapt the conversation so as to best challenge, entertain and enlighten each reader based on their level of knowledge on different subjects.

Personalisation is all about improving the users experience of the product by adapting the product based on what we know about the user.

(more…)


How App linking in Android M and iOS9 will help to increase app engagement

Android

New functionality available in the next version of both Apple and Googles mobile operating systems (iOS9 and Android M) will have dramatic consequences for publishers trying to get users to use their apps instead of the mobile web browser. The next version of the iOS and Android operating systems will take deep linking to a new level.

Both Apple and Google have worked simultaneously on improving app linking, and essentially blurring the lines between content displayed in an app and content in a mobile website.
(more…)


Android Databinding: Goodbye Presenter, hello ViewModel!

Android

The Model-View-Presenter-pattern (MVP) has been the dominating trend lately when it comes the UI-layer architecture of Android applications. Frameworks like Ted Mosby, Nucleus and Mortar have all talked about Presenters to help you achieving a clean architecture of your app. They also (to a varying degree) help you with the infamous issues of device rotation and state persistence on the Android platform. This isn’t directly related to the concept of MVP, but the pattern helps you isolate the boiler plate code.
(more…)