3 Coding Techniques To God-Tier Developer

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2024
  • These 3 coding techniques will change your life.
    🌟 Hey devs! 🌟
    Ready to level up your coding game? Check out this awesome course on Microservices using Go!
    🚀 From beginner to pro, learn to build scalable apps with ease. Don't miss out!
    Enroll now: 👉 kantan-coding....

ความคิดเห็น • 150

  • @kd8437
    @kd8437 3 หลายเดือนก่อน +86

    as a lead dev, I can only say that you never want to debug such code, which contains 10 small functions, because someone decided to split everything. It is a huge pain to debug such code, because you have to switch context a lot. You have to switch between function, classes, files.
    Sometimes it is much better just to have one bigger method instead of 5-10 small. Sometimes it is always better to not create an abstraction for every single potential change, because many of them will never happen.
    For example, it doesn't make sense to create an abstraction for delimiter, because delimiter may never change. But sometimes it makes sense to create such abstraction, haha...that's the hardest part of programming - to find a good balance and write readable not overcomplex code.
    It is not hard to create overcomplicated code with many abstractions, but the real problem is to create easy readable code for complex solutions.

    • @RafaeldaSilvaPeres
      @RafaeldaSilvaPeres 2 หลายเดือนก่อน +4

      Just like in real life people who can communicate good won't be just randomly spitting complex words that encapsulates bunch of meanings in itself, but will actually know when it is needed to use them, just like when you in a courtroom then maybe it might be a scenario for that or when writting an official document, otherwise, even tho you can say some badass words nobody will understand you, therefore failing to communicate, even tho what you saying makes sense.

    • @adennis200
      @adennis200 2 หลายเดือนก่อน +5

      Thats exactly what my lead keeps saying all the time. We have so much abstraction, that nobody can follow the code anymore. Debugging is so hard and take up too much time.
      You should not abstract for abstraction-sake.

    • @edmel144
      @edmel144 หลายเดือนก่อน

      As a novice programmer I find too little abstraction is way worse than too much. At my level (finance job vba and Python) people just out everything in one procedure. I think if you have little experience you should abstract until you release you’ve got too far, then dial it back, otherwise you will never know where the line is.
      Though I am coming from a consideration as programming as a skill all can use in their everyday job, rather than professional devs working on enterprise software.

    • @sanglin9387
      @sanglin9387 หลายเดือนก่อน

      you can fight the trend . kinda ugly people teach abstraction

    • @TheIllerX
      @TheIllerX 5 วันที่ผ่านมา

      ​@@edmel144 Yes, you can do both too much and too little abstraction. Beginners typically do almost no abstraction and mid devs are sometimes more prone to do too much.
      It is a bit like the old saying that if you just got yourself a nice hammer, everything starts to look like nails. Later you realize there are more tools that matter than the hammer.
      I'm not sure I agree on taking the abstraction too far and then try to reverse it though. It is easier to abstract and split functions apart than going the other way, I would say.
      Once you have created too many small functions and they are used everywhere in the code, you cannot just remove them without having to refactor a lot of existing code.

  • @stangeorge6893
    @stangeorge6893 3 หลายเดือนก่อน +206

    This is what the "elegant mid developer" would do, not a senior. You take a simple function with 2-3 mistakes and create so many abstraction layers it's crazy. You should have stopped at injecting the external deps as params and that's it.

    • @vigneshwaran9209
      @vigneshwaran9209 3 หลายเดือนก่อน +22

      People are in love with abstractions man. They just abstract anything and everything.

    • @psychoclips6817
      @psychoclips6817 3 หลายเดือนก่อน +7

      Thank you! So refreshing to hear this from others.

    • @javier.alvarez764
      @javier.alvarez764 2 หลายเดือนก่อน +1

      Yeah also realized these having 10 enterprise projects. Abstractions are good in theory, but an overkill and overengineering if no one will actually used it and it is only specific to that context. There are only good to when you rearch the project. Scope and requirements of the project keep changing in the middle of the process.

    • @ratfuk9340
      @ratfuk9340 2 หลายเดือนก่อน +9

      Programming is about abstraction. This video is about how to manage abstraction. The results don't have a crazy amount of more "abstraction layers", you're being ridiculous. Also, pure functions are easier to reason about so that part is valid. The issue with the video are the examples: it's pointless to wrap db.saveFormatted(name) into its own function that does nothing but call the method with the parameter. Same for the formatName function, the function for that already exists and it's the strings.TrimSpace function so there's no reason to wrap it unless you really want to rename it for some reason (there are valid reasons for wrapping to rename). In other words, the formatAndSaveName function was actually already consistent with what the video is trying to say, imo. After the changes in the video, all calls to the original formatAndSaveName function have to be replaced with a call to formatName followed by a call to saveFormatted. But it'd be more sensible to just use the original unwrapped library/module functions that have already been tested. And if you do this is many places in the codebase, it's sensible to make a function that does both of them (with the delimiter passed as a parameter) which is what the formatAndSaveName function was (after dep injection). So in that sense, yes, there's redundant abstraction in these examples but nothing "crazy".
      But let's be more generous in our interpretation: the examples in the video are just that, examples. The principles that they try to convey are totally valid and useful. You just have to be mindful when to apply them.

    • @Joshuaomorales
      @Joshuaomorales หลายเดือนก่อน +1

      As expected from someone who do not do unit testing.

  • @StanislavStratiev
    @StanislavStratiev 3 หลายเดือนก่อน +84

    I can't read the code with all this movement :( have a good day.

    • @Dungeon_Synth_Enjoyer
      @Dungeon_Synth_Enjoyer 3 หลายเดือนก่อน +10

      TH-cam has a built in pause function. All you got to do is click on the screen. You’re welcome.

    • @snyp2527
      @snyp2527 3 หลายเดือนก่อน +25

      Or maybe the creator should avoid situations where a viewer has to pause the video every 5 seconds ​@@Dungeon_Synth_Enjoyer

    • @user-fed-yum
      @user-fed-yum 3 หลายเดือนก่อน +6

      @@Dungeon_Synth_Enjoyer​​⁠Some people have neurological issues with moving text. That's why, for example, CSS has directives supported by every browser, to reduce motion. Your proposal to pause every so often is naive, unhelpful, and rude. Please educate yourself about accessibility guidelines, ie how to consider people with a range of disabilities, before you write any client side code.

    • @Yooper_eh
      @Yooper_eh 3 หลายเดือนก่อน +4

      @@Dungeon_Synth_Enjoyer Sorry, that's not the point. While the animations are very entertaining and flashy, you lose focus on what is happening. Just taking out the old and replacing it from various directions is distracting. If an element is removed just to be re-inserted in another place, it is better to just have it move from where it started to where it needs to be. Pausing the video just freezes all the elements out of position. A better approach is a side-by-side or over-under comparison.

    • @Yorgarazgreece
      @Yorgarazgreece 2 หลายเดือนก่อน

      @@Dungeon_Synth_Enjoyer yeah that's rather dumb argument. i shouldn't have to pause every 5 secs and even miss the thing because final code stays for less than 1 sec on screen. Also pausing loses train of thought.

  • @AAntonovG
    @AAntonovG 3 หลายเดือนก่อน +127

    This technique is not a Got-Tier developer, but just a middle-developer who says WOW, looking at the elegancy and beauty of this code. If you look more carefully, you will see, that you just move complexity from one place to some other. This other place is usually is some initialisation code, like main function or DI-container. So you either not test this other code, saying "oh, this is initialisation code, I don't need to test it" or you have absolutely the same problems as the original code. You cannot mock DB, you have to change tests when your behaviour changes. BUT one important thing changes when you apply this famous trick: you brake encapsulation, making refactoring almost impossible.

    • @Pavel-wj7gy
      @Pavel-wj7gy 3 หลายเดือนก่อน +11

      Sad to see this comment not getting upvotes it deserves. Content makers on TH-cam are notorious for coming up with sterile examples upon which they try proving a point and, incidentally, revealing that they don't really understand what they are doing.

    • @Kyle-do6nj
      @Kyle-do6nj 3 หลายเดือนก่อน +2

      Other than "DI/Injection", the rest should really just be called "Compartmentalization"

    • @privateagent
      @privateagent 3 หลายเดือนก่อน +2

      In what language you cannot mock a dB?

    • @AAntonovG
      @AAntonovG 3 หลายเดือนก่อน +3

      ​@@privateagent my statement was not about some language, but about the DI-trick, where you move DB initialisation outside of some function. There, outside, you still have to create DB connection and if you like to test this "outside code", you cannot do it, because it creates DB connection and sometimes it is not applicable for unit tests. So you have to mock again, and mock again and it could happen infinitely. At the end of the day you just don't test all your code with DB, you keep it untested. Hope it makes more clear my idea.

    • @DoDo-uw2no
      @DoDo-uw2no 3 หลายเดือนก่อน

      @@AAntonovG Hey thanks for your comment, for my understanding could you maybe clarify why refactoring would be impossible?
      Also if having the initialisation code in the meson function (or some init function) is not the best approach since you sometimes can’t unit test it. What would be the correct way of handling this situation?

  • @pokefreak2112
    @pokefreak2112 3 หลายเดือนก่อน +40

    that func saveFormatted is a bad idea
    it doesn't do any formatting and just saves the raw input, so if your API consumer doesn't format first you now have incorrect data in your db.
    should've called it saveUnsanitized if that's what you really need, or just call it saveFormatted and implement as db.save(format(name))
    that way the format function is still testable but any data inserted into the db using your api is also formatted

    • @LawZist
      @LawZist 3 หลายเดือนก่อน +2

      Its only a simple example for the video you know right?

    • @kazmi401
      @kazmi401 3 หลายเดือนก่อน +8

      @@LawZist If it is only an example then what is the meaning of title "God-Tier Developer"

    • @LawZist
      @LawZist 3 หลายเดือนก่อน

      @@kazmi401 by showing you a simple example to teach someone a new skill that will get him one step further to be a god tier developer, or maybe it is just sound good and get more traffic and likes because its sound better.

    • @Tinker77
      @Tinker77 3 หลายเดือนก่อน +1

      The name of saveFormatted is fine.
      The name saveFormatted implies that what is being saved is already formatted. It isn't named formatAndSave, or processAndSave, etc. The fact that it uses the past tense of Format (Fromatted) specifies in plain English that the function ... saves something that has been previously formatted .
      Now I would be a little more wordy in my function name to something that describes WHAT is being saved, such as saveFormattedFullName.

    • @thesaintnoodle
      @thesaintnoodle 3 หลายเดือนก่อน +2

      @@Tinker77 it quite literally saves anything string you pass it regardless of whether it has been formatted or not

  • @ShadowKestrel
    @ShadowKestrel 3 หลายเดือนก่อน +16

    I love how zig takes dependency injection to such an extent that *memory allocation* is passed into any functions that need it (in the form of an Allocator struct)

    • @benjaminblack91
      @benjaminblack91 3 หลายเดือนก่อน

      Better than implicitly passing around some global variables like in malloc.

  • @Rtzoor
    @Rtzoor 3 หลายเดือนก่อน +14

    to much animation. going back and forth multiple times was making it hard to keep track, because you expect a forward progression, but then be pulled back unexpectedly, then forward again, you quickly lose the sense of knowing what to expect. furthermore, the second and third techniques were glossed over compared to the first one, which feels imbalanced and incomplete. however, the overall structure was well, as well as the individual animations, and the examples as well. im sure some minor changes will make the production quality even better. it seems like you forgot to account for how the audience will process the content, getting absorbed in your own understanding, which is a very common pitfall. all that aside, i am looking forward to the next one!

    • @kantancoding
      @kantancoding  3 หลายเดือนก่อน +1

      Thank you for this! It really helps 🙂

  • @zhexymusic
    @zhexymusic 3 หลายเดือนก่อน +5

    0:04 1. fmtr should be allocated after check for empty string, because it is a rudimentary allocation if empty is true; 2. it is not necessary to allocate validator to check string length; 3. there should be check for error before return from db.fetchData or for empty return; 4. formattedName is unnecessary allocation, since fmtr.formatName call can be passed within db.fetchData call.

    • @zhexymusic
      @zhexymusic 3 หลายเดือนก่อน

      0:30 the behavior of called functions should not change, as you first complete utility functions and then utilize them. The caller should know specification and it be concrete. Otherwise it is an infinite monkey problem.

    • @zhexymusic
      @zhexymusic 3 หลายเดือนก่อน

      0:55 compiled program should either check for dependency, or dependencies should be baked into the program.

    • @zhexymusic
      @zhexymusic 3 หลายเดือนก่อน

      1:58 you still need to allocate those dependencies somewhere in the code. So db variable will still be present. And since the type of parameter is concrete/known and not any, it is not so much of an injection, but rather swapping the value. If you mean an interface, then yes, we can talk about dependencies. But then the concrete type underlying interface should conform to interface specification.

    • @zhexymusic
      @zhexymusic 3 หลายเดือนก่อน

      3:10 where is atomicity? Function should either format or save to the database.

    • @zhexymusic
      @zhexymusic 3 หลายเดือนก่อน

      3:53 ehm, let's make first function in the video non-deterministic and second deterministic?

  • @draakisback
    @draakisback 19 วันที่ผ่านมา +1

    While these ideas are fine in the abstract, they can truly get out of hand in real world examples. I can't tell you how many code bases I've worked on that tried to follow the solid or clean code principles only to end up so far in the abstract that they kind of lose the entire point and become way too complected. My rule of thumb is to just try to make my business logic as pure as possible but only within reason. If I find that the code is ballooning because of some abstraction that I've added, then usually it's not worth the pain. You also have to be aware of how much overhead you're adding to your program. Dependency injection can be really expensive depending on the dependencies that you are injecting into your functions/classes.

  • @nerewan
    @nerewan 3 หลายเดือนก่อน +14

    single word: "incapsulation"
    u shouldn't pass so many parameters into yr method, but u could pass them over class constructor, it's more readable and easily to maintain

    • @nerewan
      @nerewan 3 หลายเดือนก่อน

      @@edmunns8825, oh, thanks, dude! I was totally sure that it is "in" as "in something" 😅

    • @anho-uw2vt
      @anho-uw2vt 2 หลายเดือนก่อน

      But the video is about functions not methods or functional programming not object-oriented programming. So the video title should more be like "coding techniques for functional programming"

    • @ratfuk9340
      @ratfuk9340 2 หลายเดือนก่อน

      Hell no lol.

  • @Nellak2011
    @Nellak2011 3 หลายเดือนก่อน +2

    @Kantan Coding
    Lovely video, I think the three patterns you chose are indisputably good. Unfortunately, it seems most of the comments are ignorant and don't know what they are talking about.
    Keep up the good work and great animations!

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน

      Hey! Thanks for the feedback. I encourage discussion even if people disagree with me! So it’s a good thing imo. Maybe we can change their minds 🙂

  • @mochadwi
    @mochadwi 3 หลายเดือนก่อน +1

    i really love the animation, giving me more clarity, thanks!

  • @TannerBarcelos
    @TannerBarcelos 3 หลายเดือนก่อน +8

    These concepts are important across all languages, but something about Go makes it all so elegant and easier to understand. Awesome video.

    • @anho-uw2vt
      @anho-uw2vt 2 หลายเดือนก่อน

      Only if you are following a functional programming style. In object-oriented programming, you don't pass in that much parameters.

  • @ianokay
    @ianokay 3 หลายเดือนก่อน

    Fantastic video, simple, well explained, and accurate. Also not trivial or straight forward, despite being simple, which is a great combination. Thank you for your efforts

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน

      Thank you for watching!

  • @FernandoLeonRamos
    @FernandoLeonRamos 3 หลายเดือนก่อน +1

    these videos are so good. already knew it but damn. i wish i was a noob watching these

  • @omegand.
    @omegand. 3 หลายเดือนก่อน +20

    Your style of editing is so good...

    • @coladock
      @coladock 3 หลายเดือนก่อน

      Nope, hard to read the codes...

  • @MaxPicAxe
    @MaxPicAxe 3 หลายเดือนก่อน

    Very well put together video and I really like the power the music brings. I think the animations were a bit excessive especially when watching at 2x speed but other than that it's perfect.

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน

      🤣yeah maybe you are right about the animations being excessive. I will tone it down in the future. But anyways thanks for taking the time to give feedback that is actually helpful.

  • @mhouney
    @mhouney หลายเดือนก่อน

    I like these kind of videos. Very informative! How do you animate these videos?

    • @kantancoding
      @kantancoding  หลายเดือนก่อน

      Thank you! And thanks for watching. As for your question, I can’t really explain it in a comment. It’s not like there’s one tool that produces a good video. I use many tools to try to make the videos as engaging as possible.

  • @Joshuaomorales
    @Joshuaomorales หลายเดือนก่อน +1

    The developers who are complaining about the amount of abstractions in this video are those who do not appreciate or understand the DRY principle.

  • @dancortes2164
    @dancortes2164 3 หลายเดือนก่อน

    Great video! This makes code really readable!

  • @_theashishbhatt
    @_theashishbhatt 3 หลายเดือนก่อน

    Hey Kantan, I like your content and appreciate you experimenting. This style of animation (long duration "flying in") is making it difficult to read. Try with different animation styles, in the powerpoint world there's "appear" effect which is a little less distracting. I feel it would be less distracting if the text stays on screen longer than it's moving, try toning down the "duration of animation". You are close, just a few more tweaks.

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน

      Hey thank you! Good points that are helpful. I will keep iterating

  • @psenej
    @psenej 3 หลายเดือนก่อน +2

    woow i love this kind of coding video !! what do you use for the filmmaking of the code part ?

  • @bjni
    @bjni 3 หลายเดือนก่อน

    im living in Japan trying to become a golang backend dev, cool that you focus on golang

  • @EngineeringLife0
    @EngineeringLife0 2 หลายเดือนก่อน

    Amazing video bro. I wanted to ask how do you edit your videos like this? Do you hire someone or do it yourself? What tools do you use to get everything like it is.

  • @John-n9f1o
    @John-n9f1o 3 หลายเดือนก่อน

    You have good videos, any chance you can not have music playing? I'm trying to figure out what you're doing and the sound is a distraction. Thanks.

  • @Icewind007
    @Icewind007 3 หลายเดือนก่อน

    Great video and style! Although, it's so relaxing I almost fell asleep.

  • @avalagum7957
    @avalagum7957 3 หลายเดือนก่อน

    I think that what the author talked about is called functional programming: a function output depends on the function arguments only. If you care about side effects, then maybe you should learn Scala and then use zio, cats-effect ... to deal with side effects.

  • @AlfredLotsu
    @AlfredLotsu 3 หลายเดือนก่อน

    Keep going King, more examples please

  • @modolief
    @modolief 3 หลายเดือนก่อน

    Very clean vid, thanks

  • @y3t_
    @y3t_ 5 วันที่ผ่านมา

    i was watching this during commute and the background music made me cry in the bus

    • @kantancoding
      @kantancoding  4 วันที่ผ่านมา +1

      😂 my bad. I didn’t realize how sad the music was when I made this. Maybe I was just in a sad mood.

  • @trungao8011
    @trungao8011 2 หลายเดือนก่อน

    I like this coding font, what is it?

  • @malmiteria
    @malmiteria 2 หลายเดือนก่อน +1

    5:00 no offense but creating a function called saveFormatted that has the only responsibility to call ... saveFormatted... huh?!
    such a junior mistake. You already have a function that does the job, call it, that's it. No need for an extra function that exclusively calls the function you wanted in the first place.
    Same for splitting formatAndSaveName
    It only makes sense because you completely ignored the "call" side of those function, and unquestioningly consider any side effects to be bad.
    Everywhere you called that function, you now have to call both format and save, which both makes it a huge source of bugs, by making it easy to forget one of them, and completely misses the point of API abstractions.
    Not only that, but the fact is, you'd *have* to call them both everytime or so, making the idea of separation of concerns really not apply here.
    Formatting and saving are really really really related concerns, not separate, when your task is to format and save.

  • @eduardointech
    @eduardointech 3 หลายเดือนก่อน +1

    Liked, subscribed.

  • @mizatt
    @mizatt 3 หลายเดือนก่อน +3

    I don't understand how extracting saveFormatted into its own function addresses the side effect. You're still calling it using db, which is pulled from outside of the formatAndSaveName function's scope

    • @bossmusa9075
      @bossmusa9075 3 หลายเดือนก่อน +1

      same here

    • @Creezusz
      @Creezusz 3 หลายเดือนก่อน +1

      Couldn't he just put the formatted name into the original d.saveformated? Why even make a function out of it, if it just calls another function?

  • @GabrielJimenez-wt3hw
    @GabrielJimenez-wt3hw 3 หลายเดือนก่อน

    this man is CodeAesthetic at this point

  • @oussamabouallati
    @oussamabouallati 3 หลายเดือนก่อน +1

    Sir , which software that you use to make such kind of videos.? Thank you

    • @riptorforever2
      @riptorforever2 3 หลายเดือนก่อน

      I would like to know too. The transition effects are of much better quality than the 'morph transition' in Microsoft PowerPoint. I would like to know what software was used in these code transitions, moving only the necessary words.

  • @antoniofuller2331
    @antoniofuller2331 3 หลายเดือนก่อน

    Any code that is loosely coupled is good code

  • @MaximilianPahl
    @MaximilianPahl 3 หลายเดือนก่อน

    Great video. But please allow more time to read/understand the code.

  • @Hartex92
    @Hartex92 3 หลายเดือนก่อน +2

    This might be the best dependency injection explanation i've seen

  • @ArnarYngvason
    @ArnarYngvason 3 หลายเดือนก่อน +1

    Testing frameworks have "monkey patching", which allows you to inject dependencies without having to make your code more verbose by adding arguments.
    I think too many programmers completely miss the point of abstraction. Abstraction is mainly so that you as a human can better understand the code. It should simplify your code, and reduce "noise".
    You have too much going on in your video. Everything is moving and zooming in and out. The part of my brain that does pattern recognition refuses to participate.
    "separation of concerns" is often good, but I would consider it more of a guideline, often "locality of behaviour" can trump this rule.
    "deterministic functions" I agree with, although your example was too simple and didn't explain well why pure functions are good and side effects are bad.
    I think what truly defines a senior programmer is knowing when to break the "rules". Or perhaps we need another tier of programmer above senior.. a master programmer.

  • @martinnorberg7940
    @martinnorberg7940 3 หลายเดือนก่อน +1

    Mocking is not the goal. Mocking is a necessary evil you reach for when integration tests are not enough. It's not something you want to do.

    • @kantancoding
      @kantancoding  3 หลายเดือนก่อน +1

      When did I say mocking was the goal? 😂

  • @malcolmanderson6735
    @malcolmanderson6735 3 หลายเดือนก่อน

    You write a test first, then make it work. Repeat until done.

  • @Zmey5656
    @Zmey5656 3 หลายเดือนก่อน +23

    You have too sad music this time(((

  • @tomsterbg8130
    @tomsterbg8130 3 หลายเดือนก่อน +1

    I'm sure every developer will agree that it's terrible to write atomic functions. Atomic notes are amazing and insane, but atomic functions usually don't end up in a very well-put place or form to be reused endlessly. It's good to write this type of code in a place that you won't edit much like a game engine's devops tools, but the code that you write to glue stuff together shouldn't be like this.

    • @kantancoding
      @kantancoding  3 หลายเดือนก่อน +3

      Every dev agreeing on anything would be wild 🤪

    • @WillEhrendreich
      @WillEhrendreich 20 วันที่ผ่านมา

      What do you mean by atomic? When I hear atomic I think of transactions like in a database or something.

  • @baxstart9008
    @baxstart9008 3 หลายเดือนก่อน +1

    Not so popular take but whenever I see functions that just have one line and call other functions, I cant help but think that its not necessary cuz you can easily replace any callbacks to the function with its single line, The two functions at the end can EASILY be replaced by their one single line in their function block, and you can just call those instead in the main function, Readability? No problem you can always put comments so that you and other people wouldnt get lost on what youre doing, Having functions do nothing but return or call other functions is borderline unnecessary unless its trying to make a reach to an external function, and if you mind that it looks less imperative that way, then thats all on you now

    • @lunarthicclipse8219
      @lunarthicclipse8219 3 หลายเดือนก่อน

      They can, but wrapping a function with another function call is really useful when implementation of the function itself changes. It's the same principle as virtual/abstract methods. What if you would like to call a function that should ONLY be called when you are on android, or another function taht should ONLY be called when you are on IOS? you would have to create if checks every time you call that function, when you can just wrap it around to act as an interface and have the function itself chose the required strategy to perform its action.

    • @baxstart9008
      @baxstart9008 3 หลายเดือนก่อน

      @@lunarthicclipse8219 yeah your example kinda fits with what I said on the last part where it wouldnt look unnecessary anymore if you want it to have certain reaches, and thats understandable enough

    • @lunarthicclipse8219
      @lunarthicclipse8219 3 หลายเดือนก่อน

      @baxstart9008 yah exactly, that is probably the only time it's ever useful lol.

  • @muhammadumarsotvoldiev8768
    @muhammadumarsotvoldiev8768 3 หลายเดือนก่อน

    Thank you so much! Great video. May Allah be pleased with you
    1. Creating objects inside function (DI)
    2. Global variables (non-deterministic, DI)
    3. Single responsibility (seperate functions)

  • @brandondcruz9778
    @brandondcruz9778 3 หลายเดือนก่อน +5

    Awesome, now I have 7 functions, each needing 6 complex parameters. It's gonna be really fun to implement these functions in 30 very different situations, creating those complex objects every time. Now my codebase is 10,000 lines, just like Google's! Wow, writing code is so fun.

    • @kantancoding
      @kantancoding  3 หลายเดือนก่อน +1

      Can you elaborate?

    • @Rama-cr9lc
      @Rama-cr9lc 3 หลายเดือนก่อน +6

      @@kantancoding
      What do you need him to elaborate? His point is concise and clear. Imagine applying this for a hughe codebase; it instantly becomes unmaintainable as you now have, as a result, complexized your functions interfaces, created lots of helper functions and populated all your files with lots of imports. You have to strike a balance

  • @szczepanpogromca4044
    @szczepanpogromca4044 3 หลายเดือนก่อน

    Great video! The editing and code examples are super aesthetic! What editor theme is that btw? The colors are perfect

  • @simo_the_goat
    @simo_the_goat 3 หลายเดือนก่อน +1

    Kantan, didn't you make the same video last 2 weeks?

    • @eleandro
      @eleandro 3 หลายเดือนก่อน +1

      Yes.

    • @eleandro
      @eleandro 3 หลายเดือนก่อน +1

      Actually, it is different...

  • @maximusultra9928
    @maximusultra9928 หลายเดือนก่อน

    what language is the first code in?

  • @antoniofuller2331
    @antoniofuller2331 3 หลายเดือนก่อน

    Wait, I was always using dependency injection, but I didn't know it was called dependency injection. I just instinctively thought it was a better way of coding 4:00

  • @arisun
    @arisun 3 หลายเดือนก่อน

    why are people always willing to fill their code with dumbass layers just to read a variable value lmao

  • @AAntonovG
    @AAntonovG 3 หลายเดือนก่อน

    By the way, quality of video, the voice, the picture, everything is on very high level, sorry, forgot to mention it in first comment.

  • @cicoti
    @cicoti 3 หลายเดือนก่อน +1

    Do you want to be elegant, or do you want to be understood?

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน

      Understood for me

  • @heste.
    @heste. 2 หลายเดือนก่อน

    Let me ask you a question: (does not give time to even pause the vid and see the code)

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน

      You’re right, should have gave more time

  • @andreaslassak2111
    @andreaslassak2111 3 หลายเดือนก่อน +1

    using + for string? thats not even Senior. FTW is this video !!!

  • @asagiai4965
    @asagiai4965 3 หลายเดือนก่อน

    What's wrong with the first code? Well I guess
    It have 2 different types of returns, though you are only expecting 1?
    The if statement can get long if you have multiple things to validate?
    Others?

    • @ImperiumLibertas
      @ImperiumLibertas 3 หลายเดือนก่อน

      The code had several functions and external dependencies that could change resulting in unintended changes to the output of the function. This is what is referred to as "tightly coupled code."
      He uses dependency injection to resolve this issue but I don't recommend using the DI pattern especially for external dependencies. It's usually better to wrap external dependencies than to pass them in.

    • @asagiai4965
      @asagiai4965 3 หลายเดือนก่อน

      @@ImperiumLibertas that's another

  • @Yorgarazgreece
    @Yorgarazgreece 2 หลายเดือนก่อน

    too much animation. can't process it. i'm static dumb 1fps guy sorry 😅
    edit: if the animation was faster, and the code stayed on screen a bit longer it could be readable. but i'm not fast enough to even pause the thing at the right time 😂😂

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน +1

      Thank you! This is actually really helpful. I will keep this in mind for future videos.

  • @artembolshakov1194
    @artembolshakov1194 3 หลายเดือนก่อน +1

    this is so bad example of DO. these functions like you wrote them can work only in libs with good level of abstrations, but good luck to deal with them in production code and static typing languages.

    • @kantancoding
      @kantancoding  3 หลายเดือนก่อน

      What is DO? You mean DI right? Also, this is a statically typed language. Your comment needs more work to be useful. But thanks for watching 🙂

  • @aroundyouaroundme
    @aroundyouaroundme 3 หลายเดือนก่อน

    The video should've been named '3 coding techniques to mid-tier developer with god-tier ego'. There are 3 tiers of developer. 1. I cannot use it. 2. I can use it. 3. I can _not use_ it. You stucked at the tier 2. Good luck with a progress.

  • @NiNgem-bb6lc
    @NiNgem-bb6lc 3 หลายเดือนก่อน

    Nice :3

  • @antoniofuller2331
    @antoniofuller2331 3 หลายเดือนก่อน

    Why am I here? I need dependency injection tutorial

  • @oliverscott6421
    @oliverscott6421 3 หลายเดือนก่อน

    Haskell tho

  • @tua7582
    @tua7582 3 หลายเดือนก่อน

    It's 'delimiter' - not 'delimeter'

    • @kantancoding
      @kantancoding  2 หลายเดือนก่อน

      You’re correct. I can’t spell 🤷‍♂️

  • @kurshadqaya1684
    @kurshadqaya1684 3 หลายเดือนก่อน

    Keynote editing. 👍

  • @kunns123
    @kunns123 3 หลายเดือนก่อน

    Bad choice of music

  • @ReTroIIer
    @ReTroIIer 3 หลายเดือนก่อน +5

    Is delimeter some new kind of distance measurement? Like Centimeter, kilometer, delimeter? 😂
    It's delimiter

    • @kantancoding
      @kantancoding  3 หลายเดือนก่อน

      You got me. I can’t spell 😂

  • @EmreSezgince
    @EmreSezgince 3 หลายเดือนก่อน

    There is no god except for Allah being unique

  • @user-fed-yum
    @user-fed-yum 3 หลายเดือนก่อน

    This video is so far away from the real world. It doesn't do a great job of explaining the concept, on the contrary, it creates many arguments as to why it's a bad idea. It's a poor example, out of context, that needs more than five minutes. The title is inaccurate, click bait. Whilst some might find the animations nice to look at, time spent in a code editor showing actual working code that tests, builds, and runs, would be much more educational and credible.

  • @kekw6383
    @kekw6383 3 หลายเดือนก่อน

    BRO IM CRYING, idk why