Interfaces in TypeScript - with Taylor Swift

Interfaces in TypeScript - with Taylor Swift

I struggled this afternoon because a meeting was cancelled at short notice (or no notice) and that can throw me. So I am just trying to do what I set out to do - understand interfaces in TS. I am not meant to be doing TS stuff for now - if you know TS you know it gets complicated really fast and so I'm not trying to improve it for now - I am focusing on improving React. But I got told by someone I respect a lot to learn interfaces so I wanted to do this as a one off. But there are no good resources I can find 

I asked Chat GPT to teach me about TypeScript through my favourite Taylor Swift songs. TS... TypeScript... TS... Taylor Swift. lol 

An interface is the shape of an object. It's what it expects. Allow me to add this highly entertaining screenshot and sorry about the accessibility issues 

Chat GPT using Taylor Swift lyrics and themes to demonstrate interfaces


I don't know what the hell is going on here but this is the most fun I've ever had in my life 
Chat GPT using so it goes to describe interfaces describing vibes

What does it mean that public image here could be chaos OR mystery? hmm

AHHHH BRO THIS IS A UNION TYPE. This could be either 

So it has to be one of those two strings.
It CONTROLS THE NARRATIVE. Like Taylor Swift in Reputation
Using delicate to describe properties


And of course my all time favourite. A classic. Delicate

SHOWING HOW OPTIONAL PROPERTIES CAN BE ADDED TO AN INTERFACE

ZERO POINTS FOR ACCESSIBILITY OF COURSE 

SORRY 

I COULDN'T TYPE THIS ALL OUT

BRO

OPTIONAL PROPERTIES

So bro bro bro bro 
These properties are OPTIONAL. So like here the trustIssues are optional and they have a question mark
If only trust issues could always be optional
*mic drop*
"You did a number on me but honestly baby who's counting..."

Cardigan

This is getting trippy now BRO
using cardigan to describe interfaces and memory

got it got it got it. Interfaces control what shapes look like. They remember the type of things. It's kind of like defining a class in Python - right?

BRO THIS JUST GOT DARK

SEVEN AND STRUCTURE

There is an overarching message. TypeScript interfaces don't care where the content comes from or what it does. They don't care whether the information is true or false. They just care if something is there if that makes sense - thanks. Great 

Using the song seven to describe interfaces in TypeScript


Omg this is getting so cool beyond belief. 

Extending interfaces

BRO BRO NOW WE ARE INTO SOMETHING - BRO BRO BRO BRO. BRO

Now I am finally really learning something from this 

Explaining interfaces via hoax by taylor swift


Okay bro I do not get this bro

Lets talk about extending interfaces 

This is like python and extending classes. Okay bro
Bro. 

I need a bit more example on this. 

Okay okay more explanations needed please thanks:

Here are some more explanations in pictures, confirming everything that I thought I knew about extending interfaces 

Chat gpt explaining how to use extending interfaces

  • So indeed I suspected `HoaxLove` includes everything from `Love`
  • And then it adds some further requirements 

Comments

Popular posts from this blog

Hello World

“But yesterday, I heard God say, you were born to be the one…”

Yosemite