DISCOVERY

January 19th, 2019

React Lifecycles

React

Angular

+3 More

In a previous article I looked at lifecycles in the Angular framework. This post looks at lifecycles in React, a front-end library first released in 2013 by Facebook (after AngularJS and before Angular). If you want to learn more about React, I've written multiple posts about it in the past (including an introduction to the basics).

I enjoy working in React more than Angular nowadays. React feels simpler for developing website components. As this post reveals, the lifecycles of React components are equally simple.

DISCOVERY

January 7th, 2019

Decoding WebAssembly

WebAssembly

JavaScript

Low-level languages such as C, C++, and Assembly have always interested me. However, the lack of use cases for these languages in my personal projects causes them to be left to the side. I do believe proficiency in these languages helps developers write better high-level code, so I occasionally work with them in my free time. This article introduces a new low-level language called WebAssembly.

Ever since I first heard about WebAssembly, I've wanted to play around with it. WebAssembly was released as a minimum viable product (MVP) in March 20171. It's designed to work in the web alongside JavaScript. WebAssembly allows programming languages other than JavaScript to run in the browser. Despite its name, WebAssembly is not an assembly language since its not hardware specific2. Instead, WebAssembly runs in the same browser virtual machine that executes JavaScript3. In the past this VM was only able to run JavaScript, however as of November 2017 it can also execute WebAssembly across all major browsers4.

DISCOVERY

January 3rd, 2019

C++ First Impressions

C++

C

+2 More

C++ is a language I've always wanted to learn. So many modern languages are influenced by C++ and their designs are often predicated upon the strengths and weaknesses of C++. For example, I recently wrote about how interfaces and the lack of multiple inheritance in Java is due to C++.

C++ is a low level language closely related to the C programming language. Originally called "C with Classes," C++ added object oriented concepts on top of C1. In most cases C++ is still a true superset of C. One of the main design philosophies of C++ was to make it so low level that no language would be needed below it2. Because of this philosophy, C++ is commonly used for low-level tasks such as system programming. However, being low-level causes C++ to contain some complexities.

DISCOVERY

January 2nd, 2019

C# First Impressions

C#

Object Oriented Programming

I was recently told that my next project at work would be a .NET application using C# in the backend. C# has been on my radar for a while now, since it supports wide ranging applications such as .NET apps and Xamarin. While C# supports multiple programming paradigms, its mostly used for object oriented programming. C# is commonly referred to as a descendant of Java and C++1, which is great for me since Java is my strongest language and I'm learning C++ in parallel with C#.

C# is statically typed with strict type rules (type coercion is rare)2. Programs in C# consist of executable and library files (with the .exe and .dll file extensions, respectively). C# is a compiled language, just like its ancestors C++ and Java.

DISCOVERY

January 1st, 2019

Haskell Part V: Classes

Haskell

Functional Programming

Object Oriented Programming

In this article, I'm exploring classes in Haskell. Coming from object oriented languages, the concept of Haskell classes was a bit confusing for me. Haskell is a functional programming language, so its class functionality doesn't match classes in object oriented languages such as Java or Python. The closest comparison for Haskell classes in the object oriented world is Java interfaces with default methods1. This article clears the confusion of Haskell classes.

Type Classes

DISCOVERY

December 22nd, 2018

How Languages Enforce Multiple Inheritance

Inheritance

Object Oriented Programming

+7 More

I recently read a book discussing multiple inheritance in Python. Python is one of the few object oriented languages that permits multiple inheritance of classes. Many other languages include workarounds for multiple inheritance. For example, Java allows for classes to implement multiple interfaces. On the other hand, PHP allows for classes to use multiple traits. This article looks at programming languages I use and how they enforce multiple inheritance or available workarounds.

What is Multiple Inheritance?

DISCOVERY

December 15th, 2018

From Protocols to ABCs in Python

Python

Protocols

+2 More

Python provides many different techniques for declaring interfaces. Some are informal such as protocols, while some are strict such as ABCs. The lack of an interface keyword makes learning all the different techniques a bit more difficult. This discovery post explores different options for creating interfaces in Python.

Protocols & Duck Typing

DISCOVERY

December 14th, 2018

Features of Python Classes

Python

Object Oriented Programming

In this discovery post, I'm exploring some interesting features of Python classes. Python fully supports the object oriented paradigm, and I wrote about object oriented features such as the data model in past articles. Learning all the object oriented features of a language assists in creating APIs. Hopefully this knowledge helps me create better Python objects.

Investigating Python Methods

DISCOVERY

November 24th, 2018

Angular Lifecycles

Angular

TypeScript

DOM

When I learned AngularJS on my first software development team (June 2017), the biggest adjustment from JQuery was the addition of lifecycles for webpages. With modern front-end libraries and frameworks such as React and Angular, lifecycles are commonplace. Although late to the party, in June 2017 they were brand new to me. This post looks at the lifecycles introduced in the Angular framework. In a future post I will look at lifecycles in React, drawing comparisons between the two front-end approaches.

Angular at a High Level

DISCOVERY

November 17th, 2018

Haskell Part IV: Types

Haskell

Haskell provides multiple ways to declare types. Some types are simply aliases for existing types, while some are completely new. This post explains the differences between the three mechanisms for creating types in Haskell.

The first keyword for declaring types in Haskell is type. type creates an alias for an existing type (also commonly called a type synonym)1. For example, the following code creates a type Song which is an alias for a tuple containing a string and a list of strings.

DISCOVERY

November 10th, 2018

Using D3 in React Part II - D3 Data Visualization

React

D3

+3 More

My previous post explored integrating D3 with a React.js project. This post focuses on the D3 portion of the codebase, specifically how D3 builds a bar graph and updates it on data changes.

D3 is a data visualization library built in JavaScript. It binds text data to elements in the DOM1. D3 provides methods that are easily chained to bind data to elements in the browser.

DISCOVERY

November 7th, 2018

Using D3 in React Part I - Project Integration

React

D3

+2 More

D3 (Data Driven Documents) is a JavaScript library for creating data visualizations on the web. One of the challenges with D3 is integrating it with React.js, a front-end JavaScript library written by Facebook. Complications occur because both React and D3 work by manipulating the DOM, and React manipulates the DOM through a layer of abstraction called the Virtual DOM. Projects containing two libraries that manipulate the DOM through different philosophies can lead to conflicts1.

Luckily I'm not the first person to encounter the issue of integrating React and D3. There are many solutions, and I chose to use a library called react-faux-dom. React-faux-dom creates a "fake" DOM implementation, tricking D3 into thinking its working with the real DOM2. In reality its delegating work to the Virtual DOM and React!