Why You Should Use TypeScript for Developing Web Applications

Defining TypeScript
TypeScript is an object-oriented programming language developed and maintained by the Microsoft Corporation. It is a superset of JavaScript and contains all of its elements.
TypeScript totally follows the OOPS concept and with the help of TSC (TypeScript Compiler), we can convert Typescript code (.ts file) to JavaScript (.js file)

Link: https://dzone.com/articles/what-is-typescript-and-why-use-it

Angular: A Developer’s First Choice

The job of a web developer is becoming more complex. With the number of browsers increasing at a rapid rate and developed web pages behaving differently in each one of them, cross-browser testing has emerged as a necessity to every web developer as the browser preferred by the end-user is unknown to them. However, there are many new frameworks that have made it easy for web developers to create browser compatible websites. The most famous framework is the one developed by Google, Angular. In this article, we shall discuss why Angular has become developers’ first choice and how its features are used by renowned web apps. Why Angular Is Popular Among Developers The main reason behind the popularity of Angular is its robustness, platform independence, and browser support. Currently, all major browsers are supporting Angular. The Angular team releases new updates at frequent intervals and new features are constantly added for enhanced user experience. Although certain custom elements are not natively supported by Firefox, but they are compatible with the upcoming release.

Link: https://dzone.com/articles/angularjs-a-developers-first-choice?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Reflecting on TypeScript, Lambdas, and, of Course, Testing

Yet another long-overdue post. The last couple of weeks (or perhaps Sprints) my team has dived into TypeScript for a new project. I like it, really like it. Maybe that’s just because for years I’ve feared JavaScript, haven’t understood enough about how to do unit testing, and found myself writing terrible code and just running it to find the bugs. This is not a very good development methodology.
TypeScript and IDEs
This time around I’m using a great IDE (Visual Studio Code, of course), have type packages for just about everything we are working with, and am writing unit tests. I have persisted for many years just using Vim (in the recent history, mostly for writing Go), and because my job has frequently been quite varied and I’m often too lazy to install plugins or custom editor scripts, it didn’t have anything really helping me with my coding. I think the only times in the last 8 or 9 years I’ve genuinely wanted, needed, and used an IDE has been for writing Flash ActionScript 3.0 and Java (IntelliJ IDEA in both cases). That’s not counting the dabbling in Unity/UnrealEngine where I’ve used MonoDevelop or Visual Studio.

Link: https://dzone.com/articles/reflecting-on-typescript-lambdas-and-of-course-tes

Freeze-Mutate: An Immutable Object Management Library for JS and TS

I was looking for a nice little module that would help me make my DTOs immutable. The libraries I found were either an overkill (immutable.js), lacking support for deep merging of objects during mutations, or they were making my code ugly with lots of function calls for each change. So that’s how freeze-mutate came to life: a Javascript/Typescript-based npm module that helps me keep things simple and neat.

Freeze any object and it becomes deeply-immutable: all its properties and child-objects are frozen in the process. This is done by recursively calling JavaScript’s native Object.freeze.
Mutate a frozen object with a change-set and you get a new frozen object that is a merge, or an overlay, of the change-set on top of the original object. Again, this is a deep-merge that also you to works with Arrays, Sets, Maps, and your own custom classes. For the brave: you can provide custom freeze and merge functions.
Using TypeScript you get all the goodies of generics, enforcing the validity of the change-set, Readonly returned types and interfaces for the custom functions.

Enough talking. Let’s dive in…

Link: https://dzone.com/articles/freeze-mutate-an-immutable-object-management-libra?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

The Possibilities of Web MIDI With TypeScript

If you’ve ever had any experience with music technology, or, more specifically, sequencers, keyboards or synthesisers, you will have come across MIDI (Musical Instrument Digital Interface). It’s used to send notes and controller messages from musical devices, such as keyboards or sequencers which are used to play and record music, and devices that produce sounds, such as samplers or synthesizers. It’s pure control information, for example, “play a c# in the 3rd octave with a velocity of 85," there’s no actual audio involved. It dates back to the early 1980s, when a group of musical instrument manufacturers such as Roland, Sequential Circuits, Oberheim, Yamaha, and Korg got together to define the standard. It soon lead to a huge boom in low cost music production and the genesis of new musical styles. It’s no accident that rap and electronic dance music date from the mid to late 80s.
Web MIDI is a new W3C specification for an API to allow browser applications to access MIDI input and output devices on the host machine. You can enumerate the devices, then choose to listen for MIDI messages, or format and send your own messages. It’s designed to allow applications to consume and emit MIDI information at the protocol level, so you receive and send the actual raw message bytes rather the than API providing the means to play MIDI files using General MIDI, for example. Don’t let this put you off though, the protocol is very simple to interpret as I’ll demonstrate later.

Link: https://dzone.com/articles/the-possibilities-of-web-midi-with-typescript

Understanding why Semantic HTML is important, as told by TypeScript

What a great technological analogy by Mandy Michael. A reminder that TypeScript…
makes use of static typing so, for example, you can give your variables a type when you write your code and then TypeScript checks the types at compile time and will throw an error if the variable is given a value of a different type.
In other words, you have a variable age that you declare to be a number, the value for age has to stay …
The post Understanding why Semantic HTML is important, as told by TypeScript appeared first on CSS-Tricks.

Link: https://medium.com/@mandy.michael/understanding-why-semantic-html-is-important-as-told-by-typescript-bd71ad41e6c4

Creating a Custom Element Decorator Using TypeScript

It’s a known fact that I’m betting on Web Components. The last time that I delivered a session about Web Components, someone in the audience asked me how he can remove some of the boilerplate he needs to write in order to create a custom element. I answered that you can probably use a compiler such as Stencil or a library such as Polymer or even write your own TypeScript decorator to do that.
So… a few days ago I had some spare time to sit and play with both Custom Elements and TypeScript decorators. As a result, I wrote a small code snippet that can help you to get started and build your own custom element decorator.

Link: https://dzone.com/articles/creating-a-custom-element-decorator-using-typescri?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Inherit a Class in TypeScript

Just like any other OOP supported language, TypeScript also allows you to inherit a base class. In the last article, we learned how to create a class in TypeScript. We have also learned how to create a constructor and how to instantiate a class object.
In this article of the TypeScript Tutorial for beginners series, we will learn how to inherit a TypeScript class.

Link: https://dzone.com/articles/how-to-inherit-a-class-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Define an Interface in TypeScript

An interface in TypeScript contains only the declaration of the methods and properties, but not the implementation. It is the responsibility of the class that implements the interface by providing the implementation for all the members of the interface.
Today, in this TypeScript tutorial, we will learn how to work with interfaces in TypeScript. Continue reading to learn more.

Link: https://dzone.com/articles/how-to-define-an-interface-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Define a Class in TypeScript

Earlier in this TypeScript tutorial series, we learned about the TypeScript configuration file, variable declaration, and basic data types. I hope I made it neat and clear to understand the very basics of TypeScript.
Today, in this article, we will learn how to define a class and instantiate a class object. Continue reading to learn more.

Link: https://dzone.com/articles/how-to-define-a-class-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev