10 Coding Principles Explained in 5 Minutes

Поділитися
Вставка
  • Опубліковано 18 тра 2024
  • Get a Free System Design PDF with 158 pages by subscribing to our weekly newsletter: bit.ly/bytebytegoytTopic
    Animation tools: Adobe Illustrator and After Effects.
    Checkout our bestselling System Design Interview books:
    Volume 1: amzn.to/3Ou7gkd
    Volume 2: amzn.to/3HqGozy
    The digital version of System Design Interview books: bit.ly/3mlDSk9
    ABOUT US:
    Covering topics and trends in large-scale system design, from the authors of the best-selling System Design Interview series.
  • Наука та технологія

КОМЕНТАРІ • 62

  • @brhoom.h
    @brhoom.h 12 днів тому +25

    "remember code tells you how comments tell you why" This is actually so good 🔥

    • @gavinjones
      @gavinjones 9 днів тому +2

      Totally agree. I hate comments which just say what the next line is doing.
      They get so distracting that i have set my editor to color comments almost the same as the background color. So they don't interfere when reading code

    • @michaelvilain8457
      @michaelvilain8457 4 дні тому +2

      I've had a boss yell at me for putting so much commenting in my code, specifically why I'm doing something and what else I've tried. I told him "In 6 months, I'm not gonna remember any of this. Or I might get hit by a bus. Would you rather someone spend a day or a week trying to fix or implement something new on top of what I wrote?" He was all about "I want it now" rather than "I don't care about 6 months from now."
      Interesting that I do a lot of what you mention and only had 2 computer science classes in college. The rest were in Chemistry, yet I only use my degree in the kitchen when I cook. I'm sure there are other who code much faster but I consider myself blessed that I've NEVER had to code anything in Cobol.

  • @IndulgeBySho
    @IndulgeBySho 12 днів тому +15

    I have 14 years of experience as a business architect, yet I see people doing better job at summarising concepts in our pipelines here (not to mention, in the most creative way possible). I love your book too. Cheers! Thanks...🎉

  • @levonog
    @levonog 13 днів тому +13

    I really like your content and I really like the “5 minute video” format, I think this length is optimal for tech video.

  • @dhinesha9949
    @dhinesha9949 12 днів тому +6

    00:01 Coding style ensures consistent and readable code.
    00:40 Write clean, understandable code with helpful comments
    01:24 Robustness is key in coding principles
    02:07 Coding principles help create modular and organized code.
    02:49 Use single responsibility principle and automated testing for success
    03:31 Database class helps keep main app logic clean
    04:16 Passing parameters enhances code organization and understandability.
    05:00 Security is everyone's job in coding.
    Crafted by Merlin AI.

    • @juliocryv
      @juliocryv 7 днів тому

      great... use single responsibility principle and automated testing... my fail :(

  • @gus473
    @gus473 13 днів тому +4

    Excellent reminders and suggestions! 😎✌️

  • @argfasdfgadfgasdfgsdfgsdfg6351
    @argfasdfgadfgasdfgsdfgsdfg6351 13 днів тому +17

    THANK YOU for bringing the obvious truth to the masses: Code tells you 'How', comments tell you 'Why'. My colleagues seem to be to stupid to understand this and will simply deny writing any comments at all.

    • @augustsbautra
      @augustsbautra 12 днів тому +2

      Getting to the bottom of when and why the pernicious idea of "comments mean not clear enough code" got off the ground could be real interesting. And we'd know who to off when time travel becomes a thing.

    • @stevefrandsen7897
      @stevefrandsen7897 12 днів тому

      Same comment for unhelpful maintenance log entries. "Fixed a date function" - what was wrong? "Added another parm" - to do what? "Initialized a variable" - which one and why? I just never understood the lack of a short in code comment like "Leap year logic". "Extra Last day of Business Month processing." "Prevent zero divide".

    • @skyhappy
      @skyhappy 12 днів тому

      Comments are for speed also. Id rather read a comment than a whole block of code. Too much comments is better than too little. Be generous to the next person

    • @TrungNguyen-mj2id
      @TrungNguyen-mj2id 12 днів тому

      @@skyhappy that's not appropriate way to use comments. When your code is long, do refactor. Comments should only be used to explain "why" you do something.

    • @skyhappy
      @skyhappy 12 днів тому

      @@TrungNguyen-mj2id I'm not sure how much code you've written. There are always blocks of code that should be in one function and breaking it up only breaks the flow. 1 simple comment allows someone to skip reading 10-20 lines of code. It's much more read optimized

  • @tanvirazad5118
    @tanvirazad5118 5 днів тому +1

    I follow you on LinkedIn and UA-cam. Out of curiosity, I have one thing mesmerizing about how you are making these beautiful gif.
    Keep posting content like this.

  • @hbachme
    @hbachme 4 дні тому +1

    Thank you for your wonderful contents.
    P.S:
    There's a typo in 2:34, eatable interface is estable
    And Easy to test is East to test in the side of the circle

  • @augustsbautra
    @augustsbautra 12 днів тому

    This is a coding principles explanation video. All codedwarfship is of the highest quality. It is encrusted with clear, eye-catching visuals and reassures with simple, easy to apply tips. In the video is a reminder to write comments for "why", not "how". It relates to whole swaths of coders not writing a single line of documentation anywhere.
    Jokes aside, the quality and density of advice given here is through the roof!

  • @user-me7xe2ux5m
    @user-me7xe2ux5m 7 днів тому +2

    This is a great video with really valuable recommendations. Thus, please take my comments regarding the typos not as a critique of the content.
    - At 2:07 in the SOLID principles explanation section, I noticed a typo ISP => Interface Segregation Principle. The word Interface is misspelled.
    - At 2:30 the interface Eatable is misspelled (Estable in the video)
    - At 3:02 the last sentence of Security Test. It probably should state "penetration" testing (instead of penetrating testing)
    - At 4:41 the content of the white circle probably should be Refactor instead of Refractor

  • @chiebidoluchinaemerem5860
    @chiebidoluchinaemerem5860 13 днів тому +1

    This is Nice, thanks 👍

  • @gingerpukh7309
    @gingerpukh7309 13 днів тому +4

    Great 👍

  • @nintran52
    @nintran52 11 днів тому

    Awesome video ❤

  • @quarkyquasar893
    @quarkyquasar893 13 днів тому +4

    I love your videos and watch every single one of them, but I have a recommendation. I have been noticing an increase in typos over recent videos, like for example in SOLID the Interface Segregation Principle has a typo and a line below that also is having a mistake in DIP acronym. I love your videos but doing a grammar review once before uploading would be a good indicator for your audience to show the amount of effort you put into your videos, and before major typos become a thing. Lovely video otherwise, lots of great information :D

    • @manavkhandurie3591
      @manavkhandurie3591 13 днів тому +2

      Yea i guess its a case of the video editor may not be from a CS background or may not be an English speaker

  • @LiveWithStocks
    @LiveWithStocks 4 дні тому

    I strongly agree all of them. Nonetheless, I noticed that a passion to do so and a habit to do so are more important. Often times, they compromise and do not spend 1 more hour on writing better comments but simply call it a day.

  • @midjhelins8383
    @midjhelins8383 12 днів тому

    informative!

  • @eyalrin
    @eyalrin 13 днів тому +4

    In the SOLID section the header says Robustness

  • @djjiang3718
    @djjiang3718 8 днів тому

    Hello! I love it! And how to create those awesome visuals like in the video? Anyone know? Thanks

  • @catcatcatcatcatcatcatcatcatca
    @catcatcatcatcatcatcatcatcatca 12 днів тому

    Commenting is very hard. I like the traditional style emacs lisp is commented: each style starts with a big comment giving some commentary. Each file also ends with a comment, but this is mostly for historical reasons.
    functions defined by defun, variables defined by defvar and defcustom as well as macros (note: lisp macros aren’t not preprocessor macros) have an in-build document-string.
    This means that documentation is defined while writing code, but accessed independently of it. If you want to use a function you first pull out the document string, not the definition. The system forces you to write actually useful comments because you can’t rely on the code to explain your documetation.
    After this, comments on code are rarely needed. You can still make them of course, but you already wrote few paragraphs describing the whole file and you wrote documentation for each function so you rarely need to clarify the implementation.
    Many comments feel necessary only because the purpose and intended usage of the whole function or module was never written down. After those are clarified, the code can be awkward and non-straightforward, but still be understood. Good types and names can do this, but one brief documentation paragraph or two makes it very clear.

  • @littlellama8405
    @littlellama8405 5 днів тому

    What tools do you use for your animation and video? Thanks :)

  • @breakunknown
    @breakunknown 4 дні тому

    Gold

  • @orkhepaj
    @orkhepaj День тому

    assertions? never seen those

  • @scuden
    @scuden 12 днів тому

    Who spotted the typo at 2:32?

  • @bikedawg
    @bikedawg 13 днів тому +69

    "How to write clean code" : never contract work to anyone in Bangalore.

    • @stonecorleone
      @stonecorleone 13 днів тому +2

      Haha

    • @ajayadav09
      @ajayadav09 13 днів тому +2

      hahah

    • @jameshunt1822
      @jameshunt1822 13 днів тому +34

      Or hire a good Indian engineer. You pay peanuts, expect peanut butter.

    • @teeesen
      @teeesen 12 днів тому +15

      Bad code knows no borders.

    • @chpsilva
      @chpsilva 11 днів тому +2

      @@teeesen agreed. It's a mean stereotype.

  • @ilikegeorgiabutiveonlybeen6705
    @ilikegeorgiabutiveonlybeen6705 12 днів тому

    these ofc arent dogmas

  • @KhyberKat
    @KhyberKat Годину тому

    SOLID has been way over hyped, and people continue to blindly cite it.

  • @mrtienphysics666
    @mrtienphysics666 10 днів тому

    “Everybody in the world is now a programmer. This is the miracle of AI.”
    Jensen Huang, 2024

  • @xuedi
    @xuedi 7 днів тому

    I disagree on the comments, good good does not need any comments, the functions/methods/classes names should speak for itself ...

  • @naa_rang
    @naa_rang 12 днів тому +2

    These 5min videos get very fast. They don't solve the purpose unless you already know the topic well and you just want to revise.

    • @phatboislym
      @phatboislym 12 днів тому +1

      don't think anyone opened this ~ 5 min video expecting in-depth analysis of 10 complex concepts but that's just me

  • @bokistepy
    @bokistepy 8 днів тому +2

    Buy a new mic, or improve audio editing skils, ty;)

    • @yaketyjak
      @yaketyjak 8 днів тому

      I thought it was fine.

    • @TanveerAhmed10
      @TanveerAhmed10 7 днів тому +2

      audio is fine, buy a new ear or improve hearing ❤

    • @bokistepy
      @bokistepy 6 днів тому

      @@TanveerAhmed10 sarcasm is for smart ppl

    • @traitpichardo2046
      @traitpichardo2046 5 днів тому

      Audio is fine buy a new life

    • @dev0_018
      @dev0_018 3 години тому

      his audio is fine but you probably need to get new speakers or headset