Skip to content

Why I switched over to full Typescript over JavaScript

Posted on:July 6, 2023 at 03:22 PM

I wrote my first library called rbapi over 4 years ago. (This library allows me to make calls to Robinhood to manage trades). I then wrote an application to automatically open and close an equity position based on some simple condition. As I was writing the auto trader, I realized that I had to constantly look over the rbapi documentation to determine how to setup the client call. I also had to constantly test the rbapi client call to capture and see what the response object was. All of this slowed down my development cycle. On top of that every update to rbapi required an extensive amount of manual testing and additional code comments for documentation. All of this was highly inefficient.

Hence, when I later wrote a td-ameritrade client, I decided to leave JavaScript behind and use Typescript. Typescript is a superset of JavaScript (it transpiles down to JavaScript). Typescript has typing annotations, allowing me to document the arguments and return type. This proved to be miles better for development as I can rely on my IDE to determine what the properties are.