The symptoms of bad code - Robert C. Martin (Uncle Bob)

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

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

  • @MichałT-e3r
    @MichałT-e3r Месяц назад +81

    Seems you do not have rights to the original videos as the voice is modulated and video is interrupted with some random code images...

  • @margue27
    @margue27 Месяц назад +33

    So you took content that doesn't belong to you, distorted the audio, and added noisy background music, unrelated screenshots of code, and super annoying subscribe animations?

    • @i-am-the-slime
      @i-am-the-slime Месяц назад +1

      It's uncle Bob so it's only fitting

    • @divinecomedian2
      @divinecomedian2 16 дней назад +2

      It's fine. I wouldn't have watched this video otherwise.

  • @GordonRoland
    @GordonRoland Месяц назад +6

    Classes should be thought of as "types" not "containers." Define a new "type" (if you need it). Don't try to "bundle" code.

  • @dk6024
    @dk6024 Месяц назад +37

    Ditch the music.

    • @mikef17
      @mikef17 Месяц назад +3

      this is how they steal the original video. The YT algorithm won't be able to match it with the original material

    • @incursion45
      @incursion45 Месяц назад

      Haters music is fine

  • @stolenlaptop
    @stolenlaptop Месяц назад

    You have to out of your way to make code that dependant on itself. I can unstand changing a structure or class causing some issues as the functions using them are dependent on their structure but still.

  • @olejemedickson
    @olejemedickson Месяц назад

    I love this video! 😂 learning with humour

  • @ygstuff4898
    @ygstuff4898 Месяц назад +2

    The curse of highly-coupled code, inter-connected code, or highly-dependent code.
    When I first learned coding (on my own?) in highschool, there was a lot of "spaghetti" and cowboy coding (if it works, good enough).
    It took my instructors my first year of programming courses in university to get that out of my system, and teach me how to design code properly. They focused on code design, and not specifically specific languages.
    So now I'm amazed when I see my old, terrible techniques being used by my peers, or "examples" they find on the internet, and wonder if they ever took a programming course that taught code design.

  • @juanherbst9259
    @juanherbst9259 17 дней назад

    I was waiting for the immobility and viscosity discussion…

  • @programata666
    @programata666 Месяц назад +7

    Bad code is code that is hard to modify, it's that simple.

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

      If the bad code is the only code you can have in the current circumstances, it is not a bad code, it's the only code you can have. Simply, stop touching it.

  • @Waldemar_la_Tendresse
    @Waldemar_la_Tendresse Месяц назад

    You can very simply avoid all of that using a fine grained suite of tests before you even start to write a single line of code. But of course, this will take time, so people will rather not do it. At least not until their first spaghetti code project goes live. Some wi learn from the latter experience some won't.

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

      I think this is flirting with overengineering 😅 I love writing tests as I go too, but trying to write them all up front sounds like a return to Waterfall.

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

      @pdgiddie
      It may seem that way at first, if you don't want to think about it any further. But no, that is by no means what it means. It means moving into a digital world in which people are not held back by bugs purely for cost reasons. Because every bug means a thousandfold loss of human working time and, above all, life time. Every bug means pointless patches, pointless pondering about why it doesn't actually work now, and, as already mentioned, thousands of times over (if that number isn't far too low). Is the developer world already so indoctrinated by spreadsheets that it no longer wants to perceive the true effects of its actions?

    • @pdgiddie
      @pdgiddie 15 дней назад +1

      @@Waldemar_la_Tendresse Yeah, I agree tests are essential. I just don't think they can _all_ be written up-front. Maybe one or two to start getting the desired API drafted, but a lot of discovery happens whilst the code is being written, so there's generally a dance between the code and the tests, with both evolving side-by-side.

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

      @pdgiddie
      Even if it was exaggerated in my first statement, that's exactly what I'm talking about. I'm even leaning towards an initial throwaway version without testing and great bug fixing to get a better understanding of the issues up front. The second version is always the best. So specifically:
      1. quick and dirty throwaway version for problem detection
      2. tests per component
      3. component
      4. back to 2, sometimes with another 1 in between

  • @adibemaxwell6111
    @adibemaxwell6111 4 дня назад +1

    Rust devs in Linux.

  • @danieltkach2330
    @danieltkach2330 Месяц назад +5

    Horrible. Reported

  • @LaloHao
    @LaloHao Месяц назад

    1. Made in Java

  • @tjdewolff5104
    @tjdewolff5104 Месяц назад

    Bad code is code containing "Egyptian Dancers" all along. Kill that phenomenon by placing your matching braces in the same column: your code becomes readable...
    Ah, and of cource application of the NEUTiC-rule: Never Ever Use Tabs in Code! Never ever...

    • @Knightfall21
      @Knightfall21 Месяц назад +2

      What if you're coding in Python?

    • @peternimmo74
      @peternimmo74 26 дней назад

      Everyone seems to love K&R braces,I hate it, so much harder to see where blocks start and end.

    • @divinecomedian2
      @divinecomedian2 16 дней назад +1

      Tabs are great. Still not sure why some folks don't like them.

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

      @@divinecomedian2 Simple reason: there's still a debate going on whether tabs sould cover 8 spaces ("THE SACRED STANDARD") or 4 or whatever. Even a great mind mentioned 3.14 in this respect.
      The worst is a combination of both tabs AND spaces.
      No, to me its just spaces: they're unambiguous.