Skip to content

Instantly share code, notes, and snippets.

@CervAnn
Last active November 3, 2019 02:31
Show Gist options
  • Save CervAnn/e2627fac34b82a7236818e1de5877ea0 to your computer and use it in GitHub Desktop.
Save CervAnn/e2627fac34b82a7236818e1de5877ea0 to your computer and use it in GitHub Desktop.
Push Yourself Assignment: TypeScript - Ann Cerveny, 1904 FEE

Push Yourself: TypeScript

Ann Cerveny 1904 FEE

The first time I was introduced to TypeScript, my front-end programming class at the Turing School was reviewing the application of PropTypes to React components. Having only ever tested data types using Test-Driven Development (TDD), I was intrigued to learn that this sort of safeguard could be added directly to the structure of a component. Shortly thereafter, I was shadowing a pair of developers and learned that they used AngularJS and TypeScript for their front-end codebase. Given its dynamic application with multiple frameworks and the endless praise of its straightforwardness, I wanted to see for myself exactly what it is about TypeScript that has developers so excited about its potential.

My research began with reviewing Medium articles to understand the 'what' and 'why' behind TypeScript. What I learned is that TypeScript is considered a 'superset' of JavaScript, meaning that it uses all of the existing features of JavaScript and adds on some enhanced functionality. The main enhancement appears to be the compiler; by specifying the 'types' of data being used, returned, and defined, TypeScript allows teams to 1) increase developer empathy by writing straightforward, well-documented code, 2) decrease the number of bugs found in production by reducing unexpected type errors, and 3) allows for flexibility when deciding how granular said type verification should be applied.

After my preliminary research, I went to a trusted tutorial page - Scrimba.com - for an hour-long introduction to get started with TypeScript. It was interesting to work with JavaScript using an unfamiliar syntax, but applying the code felt intuitive. I was surprised to learn of the variety of 'types' that TypeScript uses; beyond primitive and complex types that are familiar to JavaScript developers, TypeScript employs 'Tuples', 'Intersection Types', 'Enums', 'Generics', and 'Interfaces', to name a few. Developing familiarity with the vocabulary felt like a steep learning curve, but it was helpful to put names to concepts I am familiar with but lacked terminology for.

Moving forward in my career as a developer, I think employing the use of TypeScript will be hugely advantageous. Working through the application of TypeScript on Scrimba.com reminded me of what I love about Test-Driven Development - by thinking intentionally and granularly about how I want to build and apply code, I am then able to make solid, efficient, and impactful functionality that will spare me the headache of simple mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment