
TypeScript Academy: An Expert Crowd-learning Practical Course
My experience with collaborative learning in TypeScript Academy and the benefits of crowd-learning for professional growth.
Originally published on Ackee Blog on August 10, 2022
We spent over five months sharpening our TypeScript-fu in a crowd-learning program to go above and beyond your regular coding needs. Learn more about our journey and what we have learned.
Motivation
I’ve had a whale 🐳 of a time attending our crowd learning Go and Flutter program and ABCH’s SSoS and so I tried refreshing the concept with a subject dear to me: TypeScript. Let’s see how it went, what we did well, and what could be improved.
Why TypeScript?
When we started adapting TypeScript about 4 years ago, I was actually one of the few who objected. At that time, Flow was still a popular choice and there were many other projects adding typing to JavaScript, like ReasonML, PureScript, etc. At that time it was not obvious that TypeScript would be the one to take off, but luckily I was wrong and people were right not to listen to me and keep on moving our stack to TypeScript.
In a few months, we all were quite happy with the transition and kept our love for all projects ever since. After a while, our frontend team began the adoption as well. So having two developer teams actually working with TypeScript, learning it could prove much more influential than trying out new technologies, like in the previous examples.
Why Academy?
The Go and Flutter schools were both “true” crowd-learning experiences: several people without any formal knowledge of the topic and very light management would teach themselves. All of us made a great leap, but being all beginners, we could hardly get to any advanced topics.
With TypeScript Academy I wanted to take an alternative route: Being fairly proficient in TypeScript I felt confident to organize an advanced education project, hence the cocky name: TypeScript Academy. To clarify the goals, I wanted to bring people from ”I can write TypeScript code” to ”I can write good TypeScript code” and ”I can mentor TypeScript to others”. The target audience was fairly experienced developers writing TS on a daily basis (mostly from our backend team). And we wanted to get to the advanced topics!
Format
Based on the feedback from the previous school, we kept the online format and focused more on active participation. To keep up interest throughout the academy, we alternated between two types of sessions:
Theory sessions: These are closer to the typical “school” format: slides, some code snippets and explanations. Active discussion was encouraged. These sessions were organized into tracks and in every session we progressed in the tracks, so if you missed a session from one track, you could not understand the following session in the track.
Challenge sessions: These work rather like a Code Review session. We organized a coding challenge and then went through individual solutions. Unlike in the real Code Review, the solutions were usually varied and very interesting. Different approaches and alternative solutions were discussed and typically people would come up with ideas that I had not even considered before preparing the challenge.
Topics covered
We spent a total of 18 sessions, distributed as follows:
Utility types track
- Base types (unknown, never, void, object)
- Conditional types
- Mapped types
- Template literal types
- Recursive types
Meta-programming and meta-typing track
- Compile-time vs. runtime operations
- Advanced generics and inference
- Higher-order types
Challenge sessions
- Validators and parsers
- State machines
- API design challenges
- Type-level algorithms
The utility types track started fairly easy (refreshing base types), but in the end we were doing recursive types and I challenged people to sort a tuple at type-level, using famous sorting algorithms! In the meta-programming track, we mostly talked about compile-time vs. runtime operations, which is a HUGE topic in TypeScript and source of many confusions.
Selection sort inspired
- Find minimum using accumulator and recursive walk-through tuple
- Append minimum to the resulting tuple
- If the input tuple is empty, return accumulator (from 2), otherwise, remove the first occurrence of the element found in (1) and call recursively with the updated input tuple.
Counting-sort inspired
- Enhance each element with an accumulator tuple of length equal to the element (for “3” add a tuple with 3 elements)
- Append all elements with an empty accumulator to the result tuple
- Pop one last element from all remaining accumulators
- If the array is not empty, repeat from (2)
You can try these algorithms yourself in the TypeScript Playground or check out the type-challenges repository for more advanced type-level programming exercises.
I bet you would not use any of the algorithms in the language of your choice, right?
TypeScript Academy: Summary
The whole academy was an awesome experience for me (though a challenging one!). We all made some sacrifices in our free time to make it work and I feel it was worth it. It was a wonderful journey and I am extremely grateful for all the good people who joined and helped us create this collaborative learning experience together.
Would you be interested in doing a similar project in your team and need help? Let me know. If you have any troubles doing complex types in TypeScript, we now have a squad of people willing to help you out, so feel free to reach out to us.