, ,

A Practical Introduction to TypeScript for PHP Developers


Experienced developers will have seen the rise and fall of a number of development trends and fads, so it would be easy to dismiss TypeScript, a JavaScript superset that compiles into plain Java. TypeScript, however, improves on a number of areas where naked JavaScript struggles, and already has substantial industry support. This article will outline why you should view TypeScript as more than a passing fad.

First, in addition to any benefits TypeScript brings to Java development, it has the backing of some industry giants. First appearing in 2012, and in spite of it being free and open source, TypeScript is developed and maintained by none other than Microsoft. More than that, the top Java Framework, Google-developed Angular JS, which powers over 4% of the top 10,000 web sites (almost four times as many as it’s closest competitor), has adopted TypeScript as its favourite language. With the functional backing of both Microsoft and Google, and integration with the market leading JavaScript framework, it is unlikely that TypeScript is going to go away any time soon.

Next, consider some of the benefits TypeScript brings to development. As a starting point, TypeScript is seamlessly compatible with JavaScript, and is, therefore, able to make use of existing code and libraries without issue.

TypeScript’s main selling point is the implementation of static typing, generics, and class-based object oriented programming into JavaScript. At a glance, these features, especially static typing, can appear to increase workload rather than reduce it. But this is only true in the short term, as strong typing leads to more errors being caught far earlier in the development cycle. An extra few minutes at the start of a project establishing strong typing can lead to dozens of hours of bug hunting saved down the line.

The main selling points lead on to the spin-off effects, which include improved quality of life and maintainability. Even apart from the readability benefits inherent to strongly typed code, TypeScript allows editors to provide contextual documentation, cutting down on development time and improving developer job satisfaction. Further, typescript implements static analysis error checking, leading to far fewer typographic and basic logic errors which could otherwise cause headaches down the line. Lastly, TypeScript enables editors to automatically refactor code, meaning changing a variable name in one spot can change it throughout the code automatically.

The fact of the matter is that TypeScript is not going away. It has been adopted by major players in the industry, and is, therefore, at a minimum, worth learning in order to include it on your CV. However, TypeScript also adds significant error checking features, meaning that the time spent learning the framework could easily be saved and surpassed over just a handful of projects. TypeScript is not a fad to be ignored, but an advance to be embraced


Written by Mathew Kimani – PHP Web Development Talent Sourcing

Twitter- @MattKimani

Linkedin- Mathew Kimani

, ,

Why is Laravel so popular?

Laravel is a very popular PHP framework, used by more than 30,000 developers around the world. One of the reasons it’s such a hit is that it allows web applications to be constructed quickly and makes them easy to maintain afterwards.

The source code for Laravel is hosted on GitHub and is distributed under an open source licence, so it’s available for anyone to use. It was first introduced in beta in 2011 and has since gone through several enhancements adding more features including database seeding, scheduling and more besides.

The third version of the platform saw the introduction of a command line interface called Artisan. This is mapped to sub-commands which simplifies the process of building and managing Laravel-based apps.

It works on a modular basis, with lots of pre-built functions available. This means that applications can be constructed quickly with no need for hours of work and lots of lines of code. Things like form validation and user authentication are built into Laravel which means they don’t need to be reinvented for each new task.

The code is designed to be simple, readable and elegant, making it easy for developers to understand what’s happening even if the code was created by someone else. Testing is integrated into the Laravel framework too, so the resource intensive business of writing test procedures for each new task is reduced too.

Recent additions to the platform include Laravel Scout which allows full text searches to be performed; Laravel Echo which allows for event broadcasting over the web; and Laravel Passport which is an OAuth2 ready server that makes API authentication simpler.

Another reason for the popularity of the platform is its thriving and helpful developer community. There’s a plethora of documentation available which means developers have plenty to guide them when it comes to applying best practices, making decisions on implementation, and maintaining code. There are also Laravel conferences known as ‘Laracon’ held in the US and Europe each year where developers can get together and discuss its use and related topics. There are plans for future Laracons to be held online to allow more people