DConf '23 Day 3 Keynote--You're Writing D Wrong--Átila Neves

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

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

  • @Kingdomprogrammer
    @Kingdomprogrammer Месяц назад +1

    one of the most exciting talk I've ever watched.

  • @DavidDavida
    @DavidDavida Год назад +2

    I love this .. a great talk Atila. This "rant" is very encouraging to me,

  • @EmilNicolaiePerhinschi
    @EmilNicolaiePerhinschi Год назад +1

    "what is the point of the thing you're testing"
    tests are for change management, if that private function depends on other private function or some other code I need to know I broke it when I make changes somewhere else

  • @Bolpat
    @Bolpat Год назад +3

    I really don’t get why one shouldn’t write unittests for private functions. Ideally, a function encapsulates behavior and that can be tested. If I have a function that computes a formula, why wouldn’t I write a little test that asserts a few relevant values are mapped to the right result? If I for some reason decides to change the implementation, the tests can tell me quickly that it is this function in particular that has been at fault and not some higher-level public function, which is apparently fine to write tests for.

    • @atilaneves76
      @atilaneves76 Год назад +2

      Tests aren't free, and so they need to have positive ROI. I'm arguing that tests for private functions have negative ROI, because that function is an implementation detail. If its functionality can't be tested "from the outside", i.e. from the public API, then it's unclear this function has any value.
      > If I for some reason decides to change the implementation
      Then you've probably deleted or bypassed that private function you wrote tests for, and the corresponding tests are now useless. This is the "not free" part.
      Does that make sense?

  • @i-am-the-slime
    @i-am-the-slime 8 месяцев назад

    Was considering using D, but I guess this talk shows that it doesn't seem to have sane defaults. Sad

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

      lol I mean, I'm using it for sideprojects. It's fun.
      I just don't have a good gui support with charts and graphs, but I guess I'll use raylib for that.