Skip to content
DevMeme
3628 of 7590
Languages Post #3966 · source on Telegram

Explaining Swift Metatypes vs. Sane Conversation

Description

This is a five-panel meme using the 'Jesse what the fuck are you talking about?' format from the TV series Breaking Bad. In the first, third, and fourth panels, the character Jesse Pinkman is shown passionately explaining a concept, with superimposed text defining metatype types in Swift. The text reads: 'A metatype type refers to the type of any type, including class types, structure types, enumeration types, and protocol types. The metatype of a class, structure, or enumeration type is the name of that type followed by .Type. The metatype of a protocol type - not the concrete type that conforms to the protocol at runtime - is the name of that protocol followed by .Protocol.' In the second panel, the character Walter White looks back with a confused expression, saying, 'What?'. The final panel shows Walter's frustration culminating in the line, 'Jesse what the fuck are you talking about?'. The humor stems from using a dense, highly technical, and somewhat obscure programming concept (Swift's metatypes) as the subject of Jesse's monologue. It perfectly captures the feeling of being overwhelmed by jargon or an overly academic explanation, a scenario familiar to senior engineers when a colleague gets lost in the weeds of language-specific minutiae

Comments

15
Anonymous ★ Top Pick This is what happens when you let the intern who just finished a category theory course explain generics. You get the .Type, the whole .Type, and nothing but the .Type
  1. Anonymous ★ Top Pick

    This is what happens when you let the intern who just finished a category theory course explain generics. You get the .Type, the whole .Type, and nothing but the .Type

  2. Anonymous

    I use Swift metatypes as a circuit-breaker: the moment I mention that a protocol’s metatype is .Protocol, not .Type, every meeting trips and the bikeshedding load instantly drops to zero

  3. Anonymous

    The real metatype confusion happens when you realize Swift's .Protocol is basically explaining to the compiler 'No, I mean the existential type itself, not whatever concrete type will eventually show up at runtime' - which is exactly the kind of distinction that makes perfect sense after 15 years of wrestling with type erasure, but sounds like absolute gibberish to anyone who just wanted to know why their app crashed

  4. Anonymous

    When you try explaining Swift's metatype system to your tech lead who's been writing Objective-C since 2008, and they look at you like you just proposed rewriting the entire codebase in Haskell. 'Just use .self' they say, completely missing that you're trying to explain why `Encodable.Protocol` isn't the same as a concrete type conforming to `Encodable`. Sometimes the real type erasure is watching someone's understanding of your explanation disappear in real-time

  5. Anonymous

    Swift’s metatypes are where asking for P.Type means you actually wanted P.Protocol, a type-erased box, and a 400-line code review thread

  6. Anonymous

    Metaclasses: because classes alone couldn't spawn enough indirection to crash the architecture review

  7. Anonymous

    Swift onboarding speedrun: say 'Foo.self is Foo.Type, P.self is P.Protocol; instances are existential boxes' - if they’re still nodding, you just found your Staff iOS dev

  8. Deleted Account 4y

    Metaverse

  9. @Varty_G 4y

    Meth-atype

  10. @CVABIK 4y

    welcome in development for ios, we have Image, UIImage, CGImage, CIImage, also CAPreviewLayer, AVPreviewLayer, AVCaptureVideoPreviewLayer

    1. @sylfn 4y

      use english please

    2. @tedspikes 4y

      Honestly it's not that hard, once you get the hang of it. And AVFoundation can do a lot for you if you don't need to do something that's off the beaten path

  11. @Varty_G 4y

    Say what

  12. @sylfn 4y

    just rules. you can use russian, but there should be english text

    1. @CVABIK 4y

      ok, got it

Use J and K for navigation