Комментарии •

  • @igor19781978
    @igor19781978 3 года назад +15

    Keep them coming, love the short and interactive format

  • @tcopling
    @tcopling 3 года назад +1

    I enjoy the simplistic way records is explained and the style of these videos. Awesome.

  • @OeHomestead
    @OeHomestead 3 года назад +3

    Using records when ever I can in my projects and they're definitely making things a lot easier :-) DebuggerDisplay straight outta the box, support for attributes, init-setters, etc.

  • @calvinwilson3617
    @calvinwilson3617 3 года назад

    Something else that may deserve its own highlight is the record "with" keyword to copy and override specific properies. That was a gamechanger when i started working with state management in blazor, especially with the init setter

  • @jshawmain3337
    @jshawmain3337 3 года назад +4

    Thank the gods for representation. I have always been the only black dev my entire career. U 2 are awesome!

  • @fallonmassey4714
    @fallonmassey4714 3 года назад +1

    How do you use this in a web world where converting to json, etc. is required?

  • @josda1000
    @josda1000 3 года назад

    Cant wait to use this at work. We are still working on c# 7.3 which isnt bad but again, i cant wait

  • @chefbennyj
    @chefbennyj 3 года назад

    This is interesting. I didn't see the examples print to console in the video. Hey, what do records look like when you serialize them to json?

    • @TheMannihilator
      @TheMannihilator 3 года назад +1

      records are just compiler generated classes

    • @chefbennyj
      @chefbennyj 3 года назад

      @@TheMannihilator cool, that's what I figured. Many thanks.

  • @Dazza_Doo
    @Dazza_Doo 2 года назад

    2:40 "I've made IceCream abstract" - how? Line 16 says otherwise, since you called it directly? Clarification needed, ta
    Understand the Other Records are inheriting from (base) IceCream
    internal record IceCream(string Flavour, string Colour) - would make this abstract? or does it need to be Protected? or am I off Base here?

  • @rubickon
    @rubickon 2 месяца назад

    really great

  • @danielvelkov116
    @danielvelkov116 3 года назад

    So basically you define the the props, class name and default constructor all in 1 line!? Cool

  • @KibbleWhite
    @KibbleWhite 3 года назад

    Yay Ice Cream! Also thanks for the video :)

  • @intcoder
    @intcoder 3 года назад

    Great Stuff!!

  • @tea_otomo
    @tea_otomo 3 года назад +2

    I don't see the point. Yes, there are classes that only are used for data, but this can change very quickly and you add some methods, logic, and so on to them. Even when they are mostly used for Data, there are often just master classes that are used in every "data class".

    • @cadikaorade828
      @cadikaorade828 3 года назад +2

      AFAIK at compile time the record is converted into a class so you can consider it a syntactic sugar designed to reduce boilerplate the dev has to type out. If you don't need all the features of a class you define a record as a one-liner instead. If you're content typing out a whole class definition with a ToString override that properly serializes, you can still do that.

    • @magic4218
      @magic4218 3 года назад

      IMO, classes just used for data should not contain any logic inside them.

    • @michahoffmann8992
      @michahoffmann8992 3 года назад

      If I'm not wrong the record is immutable, while the class is not.

    • @calvinwilson3617
      @calvinwilson3617 3 года назад +1

      Think of records as just classes which the compiler performs additional things automatically. The compiler creates the automatic tostring method and compares values. The real power is that you dont need to write the comparrison logic yourself, just use the record keyword and c# generates that code for you. You can now pass that value to a logger and it will automatically convert to json in the .tostring. i hqve also found the with keyword to copy a record but override specific properies in a single concise statement. Ex var email2 = email1 with { subject = "copy: " + email1.subject }; it reduces your code by a significant amount

  • @vindjedouatchomba7742
    @vindjedouatchomba7742 3 года назад

    Nice!

  • @jkone27
    @jkone27 3 года назад

    One on F# :) pls

  • @angel_machariel
    @angel_machariel Год назад

    Irrelevant code at the end.
    var c = NuttyIceCream has nothing to do with the subject!
    You should have displayed that in the case of class references, their address differ! That's why the two objects are different. As opposed to "records", where the addresses of two objects, but with same data, remains the same.
    In other words, it was relevant to actually display the addresses of both dictionary objects (holding same data), and both the class objects (holding same data).

  • @Virus00000000000001
    @Virus00000000000001 15 дней назад

    ayayaya

  • @Edvard-Aliev
    @Edvard-Aliev 3 года назад +3

    Первый! Спасибо за видео!

  • @kosteash
    @kosteash 3 года назад

    what for plagin in vs has Kendra ?

  • @cleancoder3838
    @cleancoder3838 3 года назад +1

    you're not telling me that one is saying "I don't remember how class comparison works" and surprise, there is a prepared example to show... that "I don't remember how it works" looks pretty much staged, isn't it? besides that, good demo.

    • @karimmohamed8001
      @karimmohamed8001 2 года назад

      Bro, of course it is. They did it in case someone (probably newbie/beginner) gets confused or forgets how it was with "class". Cuz one can confuse and say "Wait, how is that any different with the class?". Reminder only.