Stop Trying To Write "Perfect" Code

Sdílet
Vložit
  • čas přidán 15. 06. 2024
  • To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/TheCodingSloth . You’ll also get 20% off an annual premium subscription.
    This video was sponsored by Brilliant
    Stop trying to write perfect code and go touch some grass.
    // BOOKS MENTIONED //
    Pragmatic programmer: amzn.to/44ey2X2
    Perfection trap: amzn.to/3Ua5oBT
    Clean Code: amzn.to/3Jwoxcj
    // NEWSLETTER //
    Sloth Bytes: slothbytes.beehiiv.com/subscribe
    // BUSINESS INQUIRIES //
    Email me: thecodingsloth88@gmail.com
    // SOCIALS //
    Twitter: / thecodingsloth1
    TikTok: / thecodingsloth
    Discord: / discord
    If you'd like to support me I'd appreciate if you get a membership for the channel so I can give at least give you exclusive perks for the support
    / @thecodingsloth

Komentáře • 170

  • @TheCodingSloth
    @TheCodingSloth  Před měsícem +12

    To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/TheCodingSloth . You’ll also get 20% off an annual premium subscription. The books I mentioned are in the description as well as my newsletter. But you better stop trying to write perfect code or else the tickle monster will get you

  • @MasterQuestMaster
    @MasterQuestMaster Před měsícem +77

    I wanted to do a project, but ended up agonizing too much over how to make everything clean and yet reusable that I never even got started properly.

    • @alexale5488
      @alexale5488 Před měsícem +4

      Yess!
      I obsessed over creating perfect classes, reusable modules...and I realized...no one cares that class to be modifiable in anyway...they care about it making it's job in that moment...

    • @hermes6910
      @hermes6910 Před měsícem

      @@alexale5488 You have to find a good balance.
      Perfect code is mostly useless and slow.
      But too bad code is a nightmare past a few files/hundred of lines.

  • @tolotrarabefaly1333
    @tolotrarabefaly1333 Před měsícem +32

    I actually gave a lot of thought about that topic today since I'm currently guilty about this.
    The problem with trying to always maintain that high standard is that you're gonna always write flawed code since you don't know everything and you end up slowing yourself down and potentially your team, and this also induces a lot of pressure and anxiety on yourself too.
    If you turn out be entangled in that curse, IMO the remedy is that you have to LEARN to be okay with the fact that the code you wrote is not written in the best possible way and leave any unnecessary premature optimization loophole, yet still good enough in order for you to continue to move on towards what you / your team is building.

    • @meltygear5955
      @meltygear5955 Před měsícem +1

      It gets worse if what you're trying to write is something you want to include in your portfolio, because the engineer who will judge you if you deserve the job will read it

  • @vynaaa4395
    @vynaaa4395 Před měsícem +25

    5:47 This is the most beautiful function I have ever seen! Peak software engineering.

    • @blursed2452
      @blursed2452 Před měsícem

      that's how I write shit lmao, I guess I'm a really bad programmer then😂😂

    • @siposz
      @siposz Před měsícem

      Best recursion ever.

    • @DDvids123
      @DDvids123 Před měsícem

      Oh yeah, let’s run a recursive algorithm all the way to the data type’s max value and once we get there, determine if the number is even or odd lol (rip modulo)

  • @treygardner2428
    @treygardner2428 Před měsícem +4

    I am just starting my coding “lifestyle” this year, starting school in the fall, and you have been such an influence!!! Love the videos

  • @cody_codes_youtube
    @cody_codes_youtube Před měsícem +17

    You can definitely end the video just 2 seconds in. Perfect code does suck. It’s a unicorn

  • @pavloburyanov5842
    @pavloburyanov5842 Před měsícem +8

    Oh man, I got all 3 types of perfectionism and it really sucks me dry. Going from burnout to burnout.

  • @JCastCode
    @JCastCode Před měsícem +1

    This is my answer to my problem lol. Currently stuck on a project trying to get a clean code. I am a beginner, Thank you for this!

  • @ricardogodoy7337
    @ricardogodoy7337 Před měsícem +1

    Super awesome video, very enlightening, subscribed!

  • @bearded-cat
    @bearded-cat Před 25 dny

    Thanks this actually helps a lot and reinforces the idea that I should be going with the project I started, working on it actually makes me really anxious because I am scared I'll not figure out something

  • @Mathieuny
    @Mathieuny Před měsícem

    I love this video, thank you. I'm just starting my programming journey :)

  • @mridul2846
    @mridul2846 Před měsícem +1

    Thank you sloth.. I was over optimising my code for literally no reason.. now I feel kinda stupid.. Thanks for the timely video! Saved me a lot of time n effort.. Subscription added!

  • @thekibouminecraft9361
    @thekibouminecraft9361 Před měsícem +30

    i started coding yesterday

    • @ravikumar1232
      @ravikumar1232 Před měsícem +20

      Welcome to the abyss

    • @the_flipside_world
      @the_flipside_world Před měsícem +7

      good luck bro you're gonna need it

    • @Simple_OG
      @Simple_OG Před měsícem +1

      Good luck buddy which language you are learning ?

    • @gabbeeto
      @gabbeeto Před měsícem +9

      Jesus Christ don't be consumed by complicated stuff early on. Focus on understanding your programming language and build stuff first

    • @Simple_OG
      @Simple_OG Před měsícem

      @SamerTahsin my advice will be learn some basics c and understand how memory manages it will help you a lot you can watche some videos on my code school

  • @begthere3839
    @begthere3839 Před měsícem +3

    Brother i found you bcoz of random() of youtube algorithm
    anyway your way of explanation was to the point and needed in today's era of programming, thanks a lot cheers

  • @tuhin1264
    @tuhin1264 Před měsícem +2

    Actually good artists have a super power of embracing their mistakes/Imperfections. Coders also need this (for personal project only).

  • @maddsgn9681
    @maddsgn9681 Před měsícem +2

    Whoa, what a cool montage style 😎 Ty for the video, hope u have a good day

  • @brangtoggez6363
    @brangtoggez6363 Před měsícem +1

    This is the best video for me right now, since yes I want everything to be perfect, now I realized I am being too hard on myself, and even my friends in programming, I keep nagging them about it. Now I feel sorry, well thank you for releasing the video.

  • @sabinshrestha5335
    @sabinshrestha5335 Před měsícem +1

    Just the video I needed.

  • @elysian_myst
    @elysian_myst Před měsícem +1

    A very good video sloth, keep it up!

  • @scrudover1247
    @scrudover1247 Před měsícem +1

    This is so timely. I'm currently going through this, as I'm assigned to a project in work wherein it's the first project for my team that's supposed to pay more attention to optimization.
    The problem is I'm a junior dev who's too smooth brain. I guess I should dial it back a bit and not obsess over every line of code, especially given that this is my first project and my team probably doesn't expect me to nail it the first time.
    Thanks for the video.

    • @netherportals
      @netherportals Před měsícem

      Throwing code at an AI can help rinse your brain. I could help you if u get a brain itch down the road.

  • @govindpvenu
    @govindpvenu Před měsícem +1

    Thank you for this sloth

  • @meltygear5955
    @meltygear5955 Před měsícem +4

    I go through tutorial after tutorial and feels like my code sucks even the moment I type it. I haven't wrote a single functional app that I can call "my own" for months. I also chase the "best language" so my knowledge is shallow in multiple languages instead of deep in 1-2. Thank you for this, I'll read the pragmatic programmer AND apply it.

  • @icemans1matedude339
    @icemans1matedude339 Před měsícem +1

    And this my friends is why i only code on a per project basis, otherwise i would physically destroy myself with my own unrelenting imposter syndrome

  • @vallunacoder.wecodetogether
    @vallunacoder.wecodetogether Před měsícem +2

    Hi sloth hope yoy are doing OK. I from Colombia 🇨🇴 . And I really like your videos !!!!❤

  • @lukwagoimmanuel3051
    @lukwagoimmanuel3051 Před měsícem +2

    thanks so much

  • @HebaAltaha
    @HebaAltaha Před měsícem +1

    Nice video
    Thanks for the video

  • @GooksanGom
    @GooksanGom Před měsícem +1

    5:22 "Premature ejacul... Premature optimization!"🤣🤣🤣

  • @itzkasmi
    @itzkasmi Před měsícem

    You mention doing more project will make you a better developer, how long should you spend on a given project? Or does it depend on how big of a project you’re working on?

  • @fallennarcotic6981
    @fallennarcotic6981 Před 29 dny

    Bro the spongebob intro took me back so hard I felt like a little kid in the safest space possible

  • @mycoffee2654
    @mycoffee2654 Před 17 dny

    I've never felt so called out

  • @neozoid7009
    @neozoid7009 Před měsícem

    Thanks for such Soo cool informations 💌💌💌

  • @jayleo500
    @jayleo500 Před měsícem +2

    I would say overengineering is good for learning. Not in practice tho. From what Ive seen, the only thing that really matters is having an air tight coding standard and good docs.

  • @DungeonMartian
    @DungeonMartian Před měsícem

    Great video

  • @altu8590
    @altu8590 Před měsícem +4

    Sorry, but I'm addicted to it like crack cocaine, so no.

  • @netherportals
    @netherportals Před měsícem +1

    Teaching people how to use your code with minimal words usually (Hit enter) is how to do it. I write code mostly for video games like FreeRiderHD and KingdomofLoathing , I always have time to make new things.

  • @zorth4729
    @zorth4729 Před měsícem

    I remember this guy’s video about being unemployed last year.
    I was too. I hope he’s found a job since then.

  • @SimGunther
    @SimGunther Před měsícem +1

    1. What's the data I got to work with and how much of it must we ingest at any given time?
    2. What are the problem space constraints I must obey?
    3. What's the output I must produce given this data?
    4. What's the performance constraints given certain data sizes?
    5. How frustrated would someone else get from reading code that's high on performance, but low in comprehension speed and high in overall WTH score?
    6. What's the minimum information about the domain that I need to understand about from stakeholders before I can actually solve the problem?
    7. Can I draw a good enough picture about the problem and how it can be solved given all the constraints above?
    As long as I have this benchmarks in mind and check all those boxes, I can churn out reasonable code in record time without feeling the need to be "perfect".

    • @netherportals
      @netherportals Před měsícem

      Get unicycle, get a bunch of weights, get some pads for yo shoulders, put dem weights on yo shoulders, ride

  • @hahe8530
    @hahe8530 Před měsícem

    Thank you very much for this video! Perfect code has been my downfall for so long. I’ve stopped 2 projects because of it. I’ve always had imperfect code which has always tormented me because I try my best to be the best except I’m just competing against myself. I’m not sure if that made sense but thank you anyways!

  • @alienm00sehunter
    @alienm00sehunter Před měsícem

    The thing about "optimization" is that it means different things to different people. This is because you can optimize for different things. For example: memory usage, code size, execution time, time complexity, size complexity, latency, throughput, etc. I feel like lots of people actually try to optimize for things that are impossible to quantify or measure like "clean code", or "good code", or "DX" etc. this can easily lead to burnout and negative feelings because you're just stumbling around. You learn early in performance optimization that if you don't start by measuring then you won't actually get anything done. You also learn that there are bad and good measurements. When optimizing for "good code", you really can't make any measurements. I also feel like all the measurements that we do have in the "good code" space, like Uncle Bob's Clean Code, are actually terrible measurements. I think they are like all the measurements that companies have for developer productivity which most developers know are complete bull shit.

  • @laxy-gamer
    @laxy-gamer Před měsícem +7

    Bro I created over 10-15 games, but still I think that I'm only able to write "hello world" and nothing else

    • @erdosh5373
      @erdosh5373 Před měsícem

      same bro😭 I'm kind of learning, but I still feel like that all can i write it's hello world

    • @unknownbirdpro
      @unknownbirdpro Před měsícem +2

      Seems like you make these games by watching youtube tutorial😂😂

    • @_bhp
      @_bhp Před měsícem

      @@unknownbirdpro yeah get out of tut hell if that's where you're at

    • @halfbakedproductions7887
      @halfbakedproductions7887 Před měsícem

      I tried getting into gamedev and it seems like everything is so much effort. You get stuck, you Google everything and you find some channel called like "John Smith Games" who has been an indie for 15 years but never did it professionally. He knows everything but is showing you outdated and lazy ways of doing everything.
      Same goes for those Unreal tutorials that start with "Open up the third person template" (rather than teach the fundamentals of how it all works) as they use the old input system and hard-reference everything to break the Observer pattern.

  • @valery.weasel
    @valery.weasel Před měsícem

    Clean Code is like 1000 pages, bro, respect

  • @note4nv
    @note4nv Před 22 dny +1

    If it worls it works

  • @thejoker7705
    @thejoker7705 Před měsícem +1

    Liked,commented and already subbed❤

  • @SkySenseiii
    @SkySenseiii Před měsícem +2

    What's the tts voice you're using for books?

  • @kirillvoloshin2065
    @kirillvoloshin2065 Před měsícem +1

    Moving fast to learn is one thing.
    Moving fast at work likely leads to technical debt, which will need to be refactored at some point

  • @Zyhru
    @Zyhru Před měsícem +2

    Yall not hearing him! Stay with him now 🗣️🔥🔥

  • @ArleyChannel
    @ArleyChannel Před měsícem +1

    Please dude what editing software do you use ?

  • @Loki_Dokie
    @Loki_Dokie Před měsícem

    It's the same as writing a novel/short story. You have to edit after or you'll never finish the book, but if you do It'll still need editing.

  • @ArcheryLuna
    @ArcheryLuna Před měsícem

    Yes

  • @paulkomini6678
    @paulkomini6678 Před měsícem +1

    I don't know why we say "good code" and not "good enough code" cause at the end of the day that is what it's what matters

  • @theweirdpurplephantom1398
    @theweirdpurplephantom1398 Před měsícem

    I only strive for a minimum of good enough,and if it ends up better,good for me

  • @Dysax
    @Dysax Před měsícem +1

    another banger

  • @Skeffles
    @Skeffles Před měsícem +1

    I think this is really valuable advise but for inexperienced coders wanting to make big systems, hacking something together can quickly be a disaster. It's about understanding what perfections to add for the requirements of what you're making.

  • @poineapple2086
    @poineapple2086 Před měsícem +4

    sloth does it get better

  • @zolo8888
    @zolo8888 Před měsícem

    Hi, I have a question. I joined a coding school 6 months ago, and we have a lot of projects to complete. Some former students who have finished the projects have put them on git hub or made tutorials on medium. I see a lot of students in my class going 5x faster than me by copying the code projects we have to do and just learning how to reproduce them. But personally, I do the projects on my own then optimize to improve my problem-solving skills, architecture and build synapses related to coding but evolution takes time. Am I making a mistake in the way I learn to code? Should I be doing what they're doing?

  • @hi_beemo1808
    @hi_beemo1808 Před měsícem

    there was one time when I wrote a comment on a post that has a meme about bad code from a programers group on Facebook, on the comment I was asking for help to how to fix the 6 variables i made to store 3 positions, everyone thought it was funny and the 15 years old me was so frustrated 😅

  • @uraxii2944
    @uraxii2944 Před měsícem

    I've started rolling with the idea that "clean code" basically means it minimizes the amount of frustration it brings people.

  • @mommaeltala
    @mommaeltala Před měsícem

    what if you write in assembly? because if you dont get your code right you get a segmentation fault.

  • @thiagoassisfernandes
    @thiagoassisfernandes Před měsícem

    Waiting for the primeagens take on this

  • @brockdaniel8845
    @brockdaniel8845 Před měsícem

    Sooo good😂

  • @vickyhuang5229
    @vickyhuang5229 Před měsícem +1

    The anxiety of making "perfect" code is the worst feeling that I had

    • @pavloburyanov5842
      @pavloburyanov5842 Před měsícem +1

      you going to make perfect code, but your making just nothing. I know that feeling

    • @netherportals
      @netherportals Před měsícem

      @@pavloburyanov5842 It helps when you have similar projects to borrow from.

  • @NoBothere538
    @NoBothere538 Před 27 dny

    guys i have a question, should I learn python or godot game development?

  • @Simple_OG
    @Simple_OG Před měsícem +1

    Oop is best

  • @pyp2205
    @pyp2205 Před měsícem

    I find myself writing code that can be considered as "not clean" or "not perfect". But I don't really care to be honest, if it at least works for me then I'll be fine with it.

  • @poschinski
    @poschinski Před měsícem

    The game undertale has a switch statement with over 1000 cases. Thats was something that showed me that often the most important thing is that it works... it doesnt matter how "bad" it's actually implemented.

  • @datpham2425
    @datpham2425 Před měsícem +1

    This is the first time I see an angry sloth...

  • @darrenzou2225
    @darrenzou2225 Před měsícem

    Tgis is like Bigbox SWE but 10 minute videos

  • @Fullrusher
    @Fullrusher Před měsícem

    I enjoy coding , and wanted to make a job out of it but with the AI stuff I just had quit , is this worth doing ? ( I don't mind doing it for free but it feels like it may end up being in vain)

  • @GiantBlueRX
    @GiantBlueRX Před měsícem +2

    Damn after i watch this video i feel that i put pressure on myself too much i learn too deep, overthinking and very high standard
    Bro you save my life, lifetime and my butt 🌚
    (Really good vid)

  • @Alucard_Seven
    @Alucard_Seven Před měsícem +2

    Cant write perfect code when all ur code is terrible. Most of my code breaks with the slightest breeze. But I'm learning new skills, I do try to stay with the best practices but if my code works don't touch it. Since yt keeps deleting my comments my last project was a discord bot with chatgpt integration for a roleplaying server. Learned so much in the past 3 weeks of development.

    • @netherportals
      @netherportals Před měsícem +1

      What was your last project about?

    • @Alucard_Seven
      @Alucard_Seven Před měsícem

      @@netherportals Discord Bot using Python with ChatGPT integration for a buddies server. I eventually got it all to work "perfectly", but it took some time. trial and error and lots of learning new APIs, I also rewrote most of it to be somewhat cleaner code. Next, I'm adding a database system to keep track of scores and IDs.

    • @Alucard_Seven
      @Alucard_Seven Před měsícem

      @@netherportals Discord Bot with chatgpt integration. I first wrote my code with horrible code but after the project started to reach a point of functionality I rewrote it to "cleaner code". most of the stuff that works I didn't touch.

    • @Alucard_Seven
      @Alucard_Seven Před měsícem

      ​@@netherportals Discord bot with chatgpt intergration. I did write the first few files with terrible code to get it running, but then later on I did rewrote most of the code to be somewhat "cleaner code"

    • @Alucard_Seven
      @Alucard_Seven Před měsícem

      @@netherportals Discord bot with chatgpt intergration. I did write the first few files with terrible code to get it running, but then later on I did rewrote most of the code to be somewhat "cleaner code"

  • @t.mollov566
    @t.mollov566 Před měsícem

    5:25 😆

  • @equious8413
    @equious8413 Před měsícem

    I do not have this problem. I'm the personification of the "good enough" meme while coding.

  • @jayg6434
    @jayg6434 Před měsícem

    Perfectionism is a sign of OCDP personality!

  • @MasterQuestMaster
    @MasterQuestMaster Před měsícem +1

    6:00 But optimizing my for loop feels so good :(

  • @0brooo
    @0brooo Před měsícem

    I came for programming tips and I got life lessons. What’s next? I gotta shower?

  • @enthsz8446
    @enthsz8446 Před měsícem +2

    Bro, did you know that in portuguese sloth means Lazy? Sorry for the randomness I was taking a shower and thought about this 🙂

  • @nicholasfinch4087
    @nicholasfinch4087 Před měsícem

    I spent a whole year trying to build an application that never launched because I was fixated on optimizing every step of the user lifecycle.
    Eventually I ended up just redoing the entire thing and just literally cave man coded it. It ended up being far less stressful in the end.

  • @paultapping9510
    @paultapping9510 Před měsícem

    10/10 video, though living in my walls to obtain data for this very personal attack seems a bit much tbh.

  • @eightsprites
    @eightsprites Před měsícem

    Now I be That guy.. 5:47.. recursion really 🤣..
    lalalala.. return !(n%2);

  • @harshchauhan5514
    @harshchauhan5514 Před měsícem

    I will start coding from tomorrow

  • @hermes6910
    @hermes6910 Před měsícem

    It's better to be able to make somewhat "perfect" code (or at least understand what that means) and adapt it to your needs, than to ignore these concepts completely and not be able to apply them (overall, not in full).
    Good to read, get your own ideas and make productive, well-designed code.
    productive, well-designed code.
    Unfortunately, in my work, these books have probably never been read and I'm now in charge of an unmaintainable code base.

  • @K29ninjaNelsonYT
    @K29ninjaNelsonYT Před měsícem +1

    Sasa sloth uko aje unajua wewe ni manzee wangu

  • @user-cs2ek6bo1p
    @user-cs2ek6bo1p Před měsícem

    My new job correspond need perfect code that make me burnout

  • @kateiry4719
    @kateiry4719 Před měsícem

    I think our society needs a therapist type specifically for programmers...

  • @pablocau3792
    @pablocau3792 Před měsícem +1

    Dude. We are only trying to write simple code.

  • @derekblaney8617
    @derekblaney8617 Před měsícem +1

    Hi sloth

  • @deventerprises2640
    @deventerprises2640 Před měsícem +2

    Write good code
    Tell chatgpt to optimise it
    ~ *Wiseman*

  • @itarinsukhorino6161
    @itarinsukhorino6161 Před měsícem +1

    ahh I feel so lucky, that I'm bad with coding, so I won't have perfectionism nice

  • @kkdsbop3113
    @kkdsbop3113 Před 7 dny

    Bro😭...why i am too bad at even doing projects own my own....i have to see the code and then write then see and then do 😭... what to do...k have learn't everything know syntax but am idiot and can't to a single project😭

  • @i-am-linja
    @i-am-linja Před měsícem

    This is my problem in every area of life: if I don't do it _right,_ that's bad; if I don't do it _at all,_ that's neutral. Exacerbating matters is I don't feel joy, and can't be motivated to do anything for myself; I can't "push through" bulldozer perfectionism, because there's nothing to push with.

  • @mamamikazala
    @mamamikazala Před měsícem +1

    My man, great video you got there, but recommending anything from Bob Martin makes me very uneasy

  • @Alucard_Seven
    @Alucard_Seven Před měsícem

    code

  • @vladimirtchuiev2218
    @vladimirtchuiev2218 Před měsícem

    As a hobbyist concept artist, I don't know when to stop scribbling on a painting

  • @filipslezak5152
    @filipslezak5152 Před měsícem +1

    Instead of perfect, write maintainable code, everybody including yourself will thank you in unspecified amount of time in the future when the time will come to refactor that thing :)

  • @No-Nama-_-.0
    @No-Nama-_-.0 Před 17 dny +1

    Hi everyone I am new to programming in python so can anyone give me some project

  • @ComicusFreemanius
    @ComicusFreemanius Před měsícem +1

    Done > Elite

  • @joevaghn457
    @joevaghn457 Před 7 dny

    Holy F🐓👌🫘 you are calling me out ;-;

  • @absmustang
    @absmustang Před měsícem

    Write shit code and move one.
    There’s no time to be perfect. I get it.

  • @ricardosouza9887
    @ricardosouza9887 Před měsícem

    👍

  • @termisher5676
    @termisher5676 Před měsícem

    I made brute force instead of binary search to find optimal angle to walk around square that half's fps.
    Then I figured I could just expand aabb of enemy 2 times to grt colision area expand by 1 additional unit and go to best corner after finding what one is closest to enemy back while is walkable