Before I begin, let me just preface this by saying that this post is not really meant to be educational, nor is it meant to serve as some manifesto where I declare TypeScript to be the absolute best programming language on planet Earth. Instead, this article will serve more as a place where I can catalog my own personal feelings on the programming languages that I have experience with, including what I think about the language itself, its ecosystem, its community, and so on.
Again, everything in this article is my own personal viewpoint, I do not want anybody to take this as me saying “X Language is better than Y Language” in all cases. That said, be warned that there are some languages (cough F# cough) that I have largely negative feelings about — this does not mean that you should never use that language or that it has no redeeming qualities. For the final time, this is all my own personal thoughts on why I like or dislike a language.
TypeScript
- Let’s get this out of the way first: my absolute favorite programming language right now is TypeScript. It feels like a mix between a strongly-typed, object-oriented programming language like C#, and a functional, union-types-and-pattern-matching language like F#. It has a massive package ecosystem (inb4 leftpad) and incredible tooling. I can write both my server and my frontend code in TypeScript and share types/functions between them without needing additional tools like Reinforced.Typings to compile one language to interfaces/contracts in another. I can easily “drop down” to untyped JavaScript if it’s absolutely necessary, or I can write my own typings for an existing JavaScript package.
- I choose TypeScript in almost every new project, and the times that I regret using TypeScript in a project have become increasingly rare over the last few years.
- I love that I can parse a JSON string to an object and say “this object is of this type” without the runtime trying validating that strings are strings and ints are ints. This sounds silly, but the most annoying exceptions I get in C# are the ones where a JSON parse fails because “oops this value is null but you said it would be an int”.
- I love that I can get what is essentially discriminated unions — the same that can be found in other functional languages like F# and Reason - using TypeScript’s type system. The type inference and branching means
type Person = | { type: "student"; name: string } | { type: "teacher" }is essentially the same astype Person = | Student of string | Teacherin F# ortype person = | Student(string) | Teacherin Reason. While TypeScript and JavaScript do not have exhaustive pattern matching by default like those other two languages, you can get it to work pretty easily using thenevertype.
- One of the only things that I dislike about TypeScript is the ecosystem. I’m not talking “lol leftpad”, but rather the sometimes bizarre and wacky things that some packages do to make certain things work. For instance, there was a server side framework that I had been looking into using, and I was close to committing to it, until I got to the part in the docs where they explain how to register routes; instead of passing in an array of route handlers or what have you, they want you to pass in a folder path where your route source files can be found. This rubs me the wrong way and I ended up passing on the framework. Yes the module system is a first class citizen in Node, but I don’t want my packages loading my code for me. I want to load my code and explicitly pass it to my packages.
F#
- One thing I don’t like about F# is it’s fear of curly braces. Yes, it helps you write simple and clean code, but it also makes complicated code that much harder to understand. Sometimes you have to write complicated code and there’s only so much you can do to simplify it.
- Something I realized after looking through a lot of F# projects on GitHub is that the type inference system is a double-edged sword. It’s really neat that you don’t have to specify types in a lot of places, and F# can just figure out what type a variable should have based on the way you use it; but it also makes it extremely hard to read through F# code unless you fire up an IDE so you can get intellisense on the types.
- This community is so bad, it’s almost toxic at some times. Every single thing Microsoft does gets pooped on by the big names in the F# community.
- The tooling is also bad. Ionide is garbage on Windows, and if you ask if anyone else has the same problem on Reddit, the maintainer will subtweet you with a screenshot of the extension’s ratings on the extension marketplace, snidely implying that you’re just making things up to trash the extension because reasons — there’s no way your complaints could be valid, have you seen the ratings?!
- And no, I’m not salty because he subtweeted me or ignored some complaint of mine — I’ve never complained about it on Reddit or Twitter, only observed this dude’s toxic behavior as a passive onlooker. In fact, his behavior is the reason I’ve never filed an issue on GitHub.
- All of these negative thoughts aside, the language has a lot going for it. This sounds silly, but I live the pipe and absolutely cannot wait until JavaScript/TypeScript get pipes too. It’s so much nicer to do
getNumber() |> add 5 |> subtract 1 |> multiply 10than it is to domultiply(10, subtract(1, add(5, getNumber())). The language makes it easy to write extremely concise and easy to understand code.
ReasonML
- This is nearly the perfect language, it gets so, so much right. Tooling is excellent, immutable values, currying, functional language with syntax that is better than F# (sorry F#, some people like curly braces, mindblowing I know),
- Has too much focus on JavaScript I think, and they give you rope to hang yourself with by making JavaScript interop as easy as
[%bs.raw "some invalid javascript here"]. - Obviously JS interop is what it was built for, but with such a nice language I’d love to write server side code in it that compiled down to native. Yes, I can write Node apps using Reason, but as far as I can tell there isn’t a great community “types” repository like there is with TypeScript, so using frameworks like Express means you lose a lot of the type safety you get from Reason.
Dart
- I have a strange attraction to Dart and like this language a lot. Despite writing a post on why I won’t use Dart in production, I still keep coming back to it for fun little side projects.
C#
- Truly an excellent language
- It’s just so darn verbose it’s ridiculous
- If it had exhaustive pattern matching I would be 100% in though.
Kotlin
- Want to love it
- I can’t get the VS Code tooling to work and refuse to use other IDEs
Learn how to build rock solid Shopify apps with C# and ASP.NET!
Did you enjoy this article? I wrote a premium course for C# and ASP.NET developers, and it's all about building rock-solid Shopify apps from day one.
Enter your email here and I'll send you a free sample from The Shopify Development Handbook. It'll help you get started with integrating your users' Shopify stores and charging them with the Shopify billing API.