Generics in PHP

Поділитися
Вставка
  • Опубліковано 7 вер 2024

КОМЕНТАРІ • 34

  • @mreduar
    @mreduar 2 роки тому +8

    I loved the way you explained it, so clear and to the point and it didn't even take you 10 minutes. Wonderful

  • @Chemaclass
    @Chemaclass 2 роки тому +6

    I would really love seeing generics in PHP. Great explanation video!

  • @lostcarpark
    @lostcarpark 2 роки тому +2

    Totally agree this would be a game changer for PHP.

  • @georgeageorgopoulos
    @georgeageorgopoulos 2 роки тому +1

    Dude, thanks for supporting PHP with your videos

  • @MichaelPritchardRR3
    @MichaelPritchardRR3 2 роки тому +5

    One of the best things about PHP is you can start with echoing Hello world all the way through to building highly complex business apps, with coding standards, tests and static analysis . PHP is a fantastically flexible language! P.S. If you are interested in Static Anlysis there is a meetup called PHPMinds in Nottingham whao have talk on PHPStan by Ondřej Mirtes Thu, Mar 10 @ 6:30 PM GMT, "Tuning PHPStan to Maximum Strictness"

  • @JellyLancelot
    @JellyLancelot 2 роки тому +8

    One of the biggest features missing from PHP IMO, I love working with Generics in other langs and really miss them when coming to PHP. It could clean up quite a bit of class structure and code.

  • @jsomhorst
    @jsomhorst Рік тому

    Thanks for pointing out the dangers of type juggling and type hinting. A couple of weeks ago we had a situation where 'they know that we only pass strings' but in practice they also passed arrays. To bad we found out when we put things into production ( yes yes, old code, no unit tests etc )

  • @KeganVanSickle
    @KeganVanSickle 2 роки тому +3

    Great video Brent! Keep up the PHP evangelism!

  • @iamdew
    @iamdew 2 роки тому

    I like that you speaking about Generics with generic background music.

  • @CottonInDerTube
    @CottonInDerTube Рік тому +1

    Optional is important.
    Build up, not force up.

  • @TroyNiemeier
    @TroyNiemeier 2 роки тому

    "But, what if we need a turd implementation?" (4:22) haha
    Sorry to tease about your accent. (Your English is obviously very good, it's just too funny. My Norwegian friends do the same thing.)
    Thanks for the mini-series, as well! I appreciate the great PHP content! I love using PHP.

  • @AmitMerchant
    @AmitMerchant 2 роки тому +5

    Support for generics could easily put PHP on the level of other big boys!

    • @kevinflorenzdaus
      @kevinflorenzdaus 2 роки тому

      true..
      I love where PHP is going ..
      enterprise love it!

    • @atis737
      @atis737 2 роки тому

      its already above them all

  • @NathanBudd
    @NathanBudd Рік тому

    Watching this has made me suddenly understand at least what I'm looking at when I see code snippets in TypeScript now. I often wondered what the was,
    Cheers!

  • @toblamabor7072
    @toblamabor7072 2 роки тому

    Man you are great, thank you so much for these videos!

  • @oliverschmidt5787
    @oliverschmidt5787 Рік тому

    If we would get generics, i could finally throw all these type unsafe list wrapper objects away. What an awesome world that would be

  • @hugogoncalves77
    @hugogoncalves77 2 роки тому +1

    I would love to have generics in PHP, having a vast background on using them on C# and Java.

  • @Pekz00r
    @Pekz00r 2 роки тому +1

    I'm all for as well. As long as it is optional, I don't see any major drawbacks.

  • @comod
    @comod Рік тому

    Yes we want them! And i cant understand why we cant have them. Why not simply use type erasure under the hood only for the generic parts of the code? Better stable written and "weak" executet than bad written (mixed type), full of boiler-plates and workarounds...

  • @samansamany9339
    @samansamany9339 2 роки тому

    Great video

  • @bambamboole1
    @bambamboole1 2 роки тому

    very nice video! I am also all for generics

  • @amitavroydev
    @amitavroydev 2 роки тому

    awesome

  • @elliottmarshall1424
    @elliottmarshall1424 Рік тому

    I think this is missing because php doesn't have an object base type, that all classes extend off

  • @matte.309
    @matte.309 Рік тому

    I've always had a hard time wrapping my head around Generics, but it was always shown in C# or C++ which didn't help.

    • @phpannotated
      @phpannotated  Рік тому +1

      So, did this video help?

    • @matte.309
      @matte.309 Рік тому

      @@phpannotated yeah, sorry I dropped the first part of that sentence. This was really useful.

  • @ricko13
    @ricko13 Рік тому +1

    Basically you're talking about _Typescript_ for PHP

  • @this.channel
    @this.channel Рік тому

    I don't know what generics are and why should I care?

  • @dclindner
    @dclindner 2 роки тому

    Awesome timing. I'm pulling my hair out trying to figure out how to use Larastan / PHPStan with interfaces, inheritance and their use in relationships. Ugg...it doesn't make sense to me. lol.

  • @TrondHus
    @TrondHus 2 роки тому

    yes that would be nice. It is how it is done in c# ... how ever - I don't mind creating a UserCollection or similar to make sure I am dealing with a collection of type user...

    • @hugogoncalves77
      @hugogoncalves77 2 роки тому

      Yes, but its a pain when you need to create 50 collections classes when you could just have a generic collection class :)

  • @icemonkeyeffect
    @icemonkeyeffect 2 роки тому

    Reddit :)