10 Newbie Programming Mistakes

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.ค. 2024
  • 10 common mistakes I see new programmers make.
    ----
    If you like cooking, checkout my side project: www.mysaffronapp.com/
    ----
    Join the Discord: / discord
    ----
    Patreon: / benawad
    ----
    Follow Me Online Here:
    Twitch: / benawad
    GitHub: github.com/benawad
    LinkedIn: / benawad
    Instagram: / benawad97
    Twitter: / benawad
    #benawad
    TikTok: / benawad ​

    ----
    Follow me online: voidpet.com/benawad
    #benawad
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @artem4460
    @artem4460 5 ปีที่แล้ว +2206

    #1 Putting everything into a single file
    #2 Manually formatting code
    #3 Logging to much output
    #4 Not reading error messages
    #5 Copy and pasting code that you have no idea how it works
    #6 Not using the right data structure
    #7 Using multiple if statements instead of doing if/else statements
    #8 Doing too much pre-processing
    #9 Large unorganized commits
    #10 Putting secrets or artefacts into GIT

    • @Bulldog22224
      @Bulldog22224 4 ปีที่แล้ว +147

      Not the hero we deserve, but the hero we all need

    • @vikas6024
      @vikas6024 4 ปีที่แล้ว +21

      Only a god can do this 🙌

    • @johnwick3321
      @johnwick3321 4 ปีที่แล้ว +33

      Thank you. Save me 7 mins.

    • @johnnycochicken
      @johnnycochicken 4 ปีที่แล้ว +10

      I like how he explains these though

    • @jimii_47
      @jimii_47 4 ปีที่แล้ว +9

      this is the reason i always go to comments. Because of heroes like you. Thank you

  • @kekwnet
    @kekwnet 3 ปีที่แล้ว +301

    Error: ; expected
    Me: uses google

    • @majinzeke4977
      @majinzeke4977 3 ปีที่แล้ว +1

      Looool

    • @jefersoncosta2621
      @jefersoncosta2621 3 ปีที่แล้ว +11

      We should create a Vscode extension that will automatically look into google your error output. LOL

    • @someonehere4380
      @someonehere4380 3 ปีที่แล้ว +1

      use duckduckgo

  • @adithyareddy6211
    @adithyareddy6211 5 ปีที่แล้ว +1241

    Also:
    - Giving up too early / not being persistent and persevering through frustration.
    - Expecting to be good without putting in the work.
    - Thinking you know everything / you're the shit.
    - Thinking you'll never be able to do something because you're not smart enough.
    - Not pushing yourself out of your comfort zone.
    - Not asking for help because you're afraid people will judge you.
    - Asking other people for help before you even try to do something yourself.
    - Not believing in yourself :)

    • @kristiyanivanov7414
      @kristiyanivanov7414 4 ปีที่แล้ว +2

      Adithya Reddy yup

    • @sciencecompliance235
      @sciencecompliance235 4 ปีที่แล้ว +62

      Except this is just basic life advice and not specific to programming.

    • @remix2die4
      @remix2die4 4 ปีที่แล้ว +1

      Nice!

    • @otub
      @otub 4 ปีที่แล้ว +13

      i have all of these problems

    • @ichaa3tech
      @ichaa3tech 4 ปีที่แล้ว

      I think this i can relate to this without the judging part . i dont relate to anything in the video .

  • @vykac
    @vykac 3 ปีที่แล้ว +275

    I expected "using angular" as one of those

    • @kamcosmic
      @kamcosmic 3 ปีที่แล้ว

      how come?

    • @abe10
      @abe10 3 ปีที่แล้ว +19

      As a React developer it's in my religion to detest Angular, lolz

    • @liambrem223
      @liambrem223 3 ปีที่แล้ว +1

      If only...

    • @avnishbadoni1393
      @avnishbadoni1393 3 ปีที่แล้ว

      🤣🤣🤣

    • @guilhermehenrique-zj5tt
      @guilhermehenrique-zj5tt 3 ปีที่แล้ว +1

      @@abe10 me too XD. i learned angular before react. and i can say. angular is a mess.

  • @David-kg5nn
    @David-kg5nn 4 ปีที่แล้ว +380

    The error message one was a big one for me early on. I found it so intimidating at first, but it is super useful.

    • @RyanValizan
      @RyanValizan 4 ปีที่แล้ว +4

      David I try to look at the error first, however, 90% of the time it still makes 0 sense to me and goes into the google search box, lol. What gets really frustrating is when you get errors in your console log on the page from chrome extensions & spend an hour trying to figure out where the error is coming from, only to figure out it has nothing to do with your site at all.

    • @escapechar
      @escapechar 3 ปีที่แล้ว +3

      Yes it’s true, but sometimes in C and C++ you just get memory allocation errors and such which doesn’t really help you find where you error is

    • @fierles7989
      @fierles7989 3 ปีที่แล้ว +1

      tbh I find the exact opposite waaay more frustrating. Something doesn't work and you have no error: what tf do you do? That's usually a stupid mistakes you can't google (unlike an error) and will spend hours trying to fix.

    • @slamislife74
      @slamislife74 3 ปีที่แล้ว

      I'm the same way. As soon as I forced myself to stop relying on tutorials so heavily, I built a silly example app in Django, and I was surprised at how far I could go just by reading and fixing the error message when they came up! :D

    • @ighsight
      @ighsight 3 ปีที่แล้ว

      It really saves a ton of time to read the messages. Learned after hours on StackOverflow going through a zillion ALMOST the same scenarios that don't solve your issue.

  • @rafaelpernil
    @rafaelpernil 3 ปีที่แล้ว +39

    My best advice is: Fail as hard as you can
    Try to do things your way, to the extreme. And you will see why you were wrong and learn super fast. Because, if you do things in a particular way because somebody told you so, you will not understand the importance and meaning behind each advice.
    Also, try to make your life easier, simple solutions are often the best ones. If something seems more complicated than it needs to be, try to expand your toolset, change the perspective of the problem, divide the problem into sub-problems...

  • @techstacker5361
    @techstacker5361 5 ปีที่แล้ว +114

    *Manually formatting code* 0:55 - this is so true. Oddly I often see veteran developers do this in video tutorials. It's such a waste of not just time, but your _life._ All the little wasteful decisions you make add up over time! Imagine having spent 100+ hours of your career manually formatting code for no reason. You could have spent that time on better things, such as health, family, friends (or more work 😁).

    • @jamesmontis488
      @jamesmontis488 4 ปีที่แล้ว +2

      this is one strong reason i like Xcode, it autoformats lots of things like if statements or switches and is really easy to arrange. I'm just a 1st year though what do i know, but it does seem nice

    • @steves1015
      @steves1015 4 ปีที่แล้ว +7

      TechStacker veteran programmers possibly got into this habit from using the older, crapier IDEs or very basic text editors when they were younger.

    • @stratvids
      @stratvids 4 ปีที่แล้ว +1

      @@jamesmontis488 Xcode is prob one of the worst IDE's ever made .. well short of the original version of eclipse. I use Vs code almost exclusively now and if apple didn't force me to use xcode to compile apps for iphone i'd drop xocde completely

    • @RyanValizan
      @RyanValizan 4 ปีที่แล้ว +5

      i format my code to be visibly easier on the eyes when looking through with comment notes to explain sections. many times, the code can get misaligned as things change or are added in time. Some pages get very bad, but when you have a lot of mixed language pages (jsp & php pages for example can mix html and their server side language) having an auto-beutifier doesn’t really work too well for those.

    • @frederikja2210
      @frederikja2210 3 ปีที่แล้ว +3

      well spending time during work to manually format is not really time wasted for you but rather money wasted by said company. but i doubt they are actually just formatting code. i usually format my code manually as a sort of fidgeting toy while thinking about a problem, or going over expected outputs in my head before i test.

  • @subzoronltd7779
    @subzoronltd7779 4 ปีที่แล้ว +6

    Also get up and go for a walk/eating/hydrating will help a lot with keeping the mind fresh. So many times I've been having a mental block with a problem and then after having a quick walk I end up thinking of a new approach to solve it.

    • @ezwalduzumaki3161
      @ezwalduzumaki3161 4 ปีที่แล้ว

      fosho, sometimes when im stuck i go watch anime, come back l8r with a new approach that works. ;) had big struggles with pagination.

  • @kamdroid
    @kamdroid 5 ปีที่แล้ว +338

    #3 should be using the debugger. Just like you use the code formatted you should use a debugger 👍🏼👍🏼

    • @lukaskovar6921
      @lukaskovar6921 5 ปีที่แล้ว +3

      How i can use debugger with React ?

    • @tkdevlop
      @tkdevlop 5 ปีที่แล้ว +12

      It depends when you really don't know what's going own debugger make sense but when you just wanna see data change/retrieve properly log makes sense.

    • @kamdroid
      @kamdroid 5 ปีที่แล้ว +2

      @@lukaskovar6921 checkout code.visualstudio.com/docs/nodejs/reactjs-tutorial#_debugging-react

    • @RyanValizan
      @RyanValizan 4 ปีที่แล้ว +15

      I’ve been programming for over 15 years and still have yet to figure out how to properly utilize a debugger. Almost all the code I’ve written has been in JS/CSS/HTML/ & JAVA(JSP). Java debugging is a thing, but it’s not so much for a Spring 1 web app that requires a special database connection to our backend erp for any testing to take place. This has led a lot of our debugging to be done post dev deployment through VSTS pipelines & placing console logs in points of interest during testing - whether in the java or js files.

    • @notyoursurya
      @notyoursurya 4 ปีที่แล้ว

      Holy crap! I was about to say that. 😐

  • @at_249
    @at_249 2 ปีที่แล้ว

    Love your videos. Thanks for doing this.

  • @0chriscrew0
    @0chriscrew0 5 ปีที่แล้ว

    Thanks for the video!

  • @puruvijay6185
    @puruvijay6185 3 ปีที่แล้ว +3

    Ben: "Don't put large commits"
    Taylor Swift: ... You belong with me...

  • @sidlife365
    @sidlife365 3 ปีที่แล้ว

    Amazing tips Ben!!!

  • @repe0
    @repe0 4 ปีที่แล้ว +6

    I took part on this beginner react native course for fun. The instructor tried to help one person who could not boot up the react native at all.
    It literally said "run npm install" because during initialization of expo create app the person had problems with internet connection and npm install could not been run succesfully.
    I pointed this out and said you should run npm install. The instructor was really obnoxious and said you don't have because it's running automatically. I repeated that it says in the error message, please run npm install. Then finally the guy runned npm install and it would, of course. The instructor said well, I guess it fixed the issue and moved on to teach people react-native..

  • @bryanurizar
    @bryanurizar 3 ปีที่แล้ว

    Solid points, thanks!

  • @TheDRAGONFLITE
    @TheDRAGONFLITE 3 ปีที่แล้ว +43

    5:07 "Basically, be lazy." Oh? Okay sounds good to me.

    • @ImperatorZed
      @ImperatorZed 3 ปีที่แล้ว +3

      being truly lazy takes a lot of work

    • @thesupercoach
      @thesupercoach 3 ปีที่แล้ว +3

      Dude, the reason I started programming is because I'm lazy as fuck. I had a job where I moved into a role where there was insane amounts of copy/paste repetition. The people I was working with just accepted it. I said fuck that and hacked up a template using javascript and a few regexes to fill the copy/paste for me. Fast forward a year or so and I was pretty much a full time programmer. Since then, I haven't looked back.

    • @jarlfenrir
      @jarlfenrir 3 ปีที่แล้ว

      What he really meant, I guess, was "make your program lazy".

  • @Epistemer
    @Epistemer 4 ปีที่แล้ว +9

    these were honestly the best tips I've ever heard, not too generic, not too specific. 👍

  • @fahmidamashura7076
    @fahmidamashura7076 4 ปีที่แล้ว

    Thank you very much for this video. I did it all of it. It's very helpful.

  • @joshuaevans4301
    @joshuaevans4301 4 ปีที่แล้ว +45

    Re: Logging too much output. I _highly_ recommend getting used to using debuggers and breakpoints. It can take some time to figure out the initial setup, but it makes fixing bugs so much easier :D

    • @floppy-disko2378
      @floppy-disko2378 3 ปีที่แล้ว +2

      I think I agree, I'm a newbie but one good video on breakpoints and debugger tools and some code later I became addicted to them

    • @orangeVSappel
      @orangeVSappel 3 ปีที่แล้ว

      @@floppy-disko2378 could you link to that video if possible?

    • @floppy-disko2378
      @floppy-disko2378 3 ปีที่แล้ว

      @@orangeVSappel How to debug c++ in Visual Studio, this video is in a really good series from The Cherno

    • @orangeVSappel
      @orangeVSappel 3 ปีที่แล้ว

      @@floppy-disko2378 Thanks, I'll check it out

    • @AddyVDH
      @AddyVDH 3 ปีที่แล้ว +1

      Meh I'm not a big debugger guy, makes you reliant on a specific env. It's a pain to have to hook up all your docker containers to a debugger for instance.

  • @ngoako
    @ngoako 3 ปีที่แล้ว

    These are actually useful, thanks!

  • @pearlsswine
    @pearlsswine 3 ปีที่แล้ว

    Awesome tips!

  • @6006133
    @6006133 4 ปีที่แล้ว +3

    You actually rarely need if-else. Worked on a new project for a year with 3 people. We had half a dozen if-else by the end. Guard clauses and polymorphism are your friend.

  • @spacedumpster
    @spacedumpster 5 ปีที่แล้ว +57

    Read error messages
    Best tip, by far 🔥

    • @RyanValizan
      @RyanValizan 4 ปีที่แล้ว

      Zack Krida and limiting what you send to the error log. I had an issue arise the other day where services were interrupted. the logs were so jammed full of debug crap I couldn’t find the error msg easily, so i had to disable debug logging and clear the logs to make the error msg more distinguishable. was a super easy fix after i did that.

  • @baracjohn3913
    @baracjohn3913 5 ปีที่แล้ว

    Again great videos

  • @parasarora4711
    @parasarora4711 3 ปีที่แล้ว +1

    my favourite is the last one using environment variables for putting secrets or artefacts into GIT. thanks brother

  • @XDBjoernXD
    @XDBjoernXD 3 ปีที่แล้ว

    You are a great person for helping us on learning programming. Thank you

  • @mohammadrasoulfard-habibi3066
    @mohammadrasoulfard-habibi3066 5 ปีที่แล้ว +2

    So glad I found this channel thanks buddy.

    • @bawad
      @bawad  5 ปีที่แล้ว

      welcome :)

  • @relentless2917
    @relentless2917 2 ปีที่แล้ว

    Hey Ben, can you recommend a good resource to learn data structures and algorithms? I don’t have a CS background, ouch.

  • @goodwish1543
    @goodwish1543 4 ปีที่แล้ว +2

    Mistakes are faster to learn and fix. Thanks for sharing.

  • @mabdullahsari
    @mabdullahsari 5 ปีที่แล้ว +28

    That's some advanced green screen usage, a different environment every time!

    • @thedeveloper4207
      @thedeveloper4207 5 ปีที่แล้ว +6

      Is it really a green screen?

    • @mabdullahsari
      @mabdullahsari 5 ปีที่แล้ว +12

      @@thedeveloper4207 No, it was sarcasm.

    • @thedeveloper4207
      @thedeveloper4207 5 ปีที่แล้ว +5

      @@mabdullahsari lol 😂... You had me with that 😂

  • @andresmontoya7852
    @andresmontoya7852 5 ปีที่แล้ว +6

    I like so much your videos bro, when you talk I can understand you, because I speak Spanish and it's a little tricky to me understand English well 😁 thanks!

  • @the_first_hunter
    @the_first_hunter 3 ปีที่แล้ว +1

    Lol mine is worse
    I spend hours debugging why the function doesn't work until I realize I haven't called it

  • @mateuscosta5359
    @mateuscosta5359 4 ปีที่แล้ว +16

    Man, i felt like you were talking to me lol, cause I just created a React Native application and using the API key inside the code, without using the environment variables. Good advice, Thanks!

    • @mulwelimushiana8388
      @mulwelimushiana8388 3 ปีที่แล้ว

      Wait what? I'm currently using API keys inside code 😒 What is environment variables?

    • @mulwelimushiana8388
      @mulwelimushiana8388 3 ปีที่แล้ว

      In a React Native App

    • @mateuscosta5359
      @mateuscosta5359 3 ปีที่แล้ว +3

      @@mulwelimushiana8388 Hi man, environment variable is a variable that you can create in a .env file created in your project and assign a value to it, it is usually not added to version control, or you can add(to version control) only as an example with the variable names but without the values, like create another .env file but named .env.example, because it is not a good practice to leave your credentials like an API key inside of your code. And there is a way to read the values of the variable in your code, depending on the programming language it can be different, I recommend you to do a research of how to do it in JavaScript, since you are using react native

    • @mulwelimushiana8388
      @mulwelimushiana8388 3 ปีที่แล้ว +1

      @@mateuscosta5359 wow Thanks a lot man. I'll look at it.

  • @IAstonI
    @IAstonI 3 ปีที่แล้ว +1

    6 months into my first developer job and I think I have made all of thesemistakes and learnt from them ofcourse!

  • @faisalalmalki9834
    @faisalalmalki9834 3 ปีที่แล้ว

    hello Awad from your perspective what is the best platform to learn how to code

  • @A432Hz
    @A432Hz 4 ปีที่แล้ว +189

    Why am I watching this, I can’t even program

    • @jawad9757
      @jawad9757 4 ปีที่แล้ว +30

      I'd recommend you get started

    • @cyberwebdev
      @cyberwebdev 3 ปีที่แล้ว +10

      I agree with Jawad, now he might change his username and if someone sees my comment after he does that, The Won’t Know Who I’m Talking To. So to that person that doesn’t exist yet, Jawad is the comment above me ^^^.

    • @jawad9757
      @jawad9757 3 ปีที่แล้ว +5

      @@cyberwebdev lol, I'm never changing my username

    • @cyberwebdev
      @cyberwebdev 3 ปีที่แล้ว +4

      Ok, Deafult Pfp in a Green Background, now he might change his pfp, and if someone sees this after he does, they wont know who I’m talking to... and think I’m lonely and is talking to no one. So to that person that doesn’t exist yet, hello, I hope Covid has stoped, and BLM is true in the future... also back to topic, that guy is the comment above me. edit:^^^

    • @jawad9757
      @jawad9757 3 ปีที่แล้ว +2

      @@cyberwebdev dw, I'm lonely too, no one to talk to

  • @xhmbx9548
    @xhmbx9548 3 ปีที่แล้ว +3

    Putting everything into a single file
    MAN I FELT THAT TO MY SOUL 😂😂😂😭😭😭

  • @Lindaine
    @Lindaine 3 ปีที่แล้ว +6

    Commiting is the one for me, I tend to forget to commit after I did something especially if I'm trying to solve a problem.

    • @CatDevz
      @CatDevz 3 ปีที่แล้ว

      I do too and my solution has become to make 3/4 commits at the same time. All git clients let you choose what files (and even lines) you want to put into a commit.

  • @abdulazizjamshidi425
    @abdulazizjamshidi425 4 ปีที่แล้ว +1

    Well this just made me realize my programming class is good because they told us ctrlA followed by ctrl I to automatically format code is eclipse along with using if else statements rather than using only if statements

  • @Foxtrot6624
    @Foxtrot6624 3 ปีที่แล้ว +7

    No. 0 noob error, not watching all informational TH-cam videos at 2x spped so you can learn twice as fast

  • @forrestgrover4568
    @forrestgrover4568 4 ปีที่แล้ว +1

    The last three mistakes are super common among most students. Definitely good advice!

  • @Gamez4eveR
    @Gamez4eveR 3 ปีที่แล้ว

    I was working on fixing unit tests failing and I went too far in the class tested and did an undo changes. Little did I know I reset the logic I rewrote for another method that was completely fine.
    Can I get an F?

  • @ikemkrueger
    @ikemkrueger 3 ปีที่แล้ว +2

    When I made large changes, I use „git add -p“ to split them into smaller commits.

  • @rubenadema1094
    @rubenadema1094 4 ปีที่แล้ว +108

    Good luck reading those C++ error messages XD

    • @escapechar
      @escapechar 3 ปีที่แล้ว +8

      Ruben Adema or C, they are both pretty confusing and meaningful at the same time

    • @eddieh7962
      @eddieh7962 3 ปีที่แล้ว +36

      They r so confusing until u find the problem and u realize they were saying it so plainly before

    • @ekinox3783
      @ekinox3783 3 ปีที่แล้ว +37

      @@escapechar laugh in segmentation fault

    • @berylliosis5250
      @berylliosis5250 3 ปีที่แล้ว +6

      I've never had a problem with C++ error messages, they're really not bad

    • @user-zs6cl6td4t
      @user-zs6cl6td4t 3 ปีที่แล้ว

      what arcane language are they written in fr

  • @ArnoldsKtm
    @ArnoldsKtm 3 ปีที่แล้ว +3

    Gosh, I've lived through all of these. It's almost kind of nostalgic.

  • @ScipiPurr
    @ScipiPurr 3 ปีที่แล้ว +1

    6:15 For #10 something I like to do when working on production code is I'll have secrets loaded through environment variables like you suggest and I'll also have the project configured for docker-compose. The docker-compose.yml will be configured for running the code in debug mode and will live in git and I have any secrets or production configuration loaded through docker-compose.override.yml, which will be in the .gitignore. This nicely isolates any secrets to just the override file and any safe configuration can be shared with git.
    If you can't dockerize your project, you can also do similar things with .env files but I find them to be more unwieldy, personally.

  • @enio1111
    @enio1111 4 ปีที่แล้ว +15

    Read the air message 😂

  • @franksimon8375
    @franksimon8375 2 ปีที่แล้ว

    Thank you for this, I just started coding and this gives me an idea of how good I am. Which is actually difficult when self educating

  • @joshman1019
    @joshman1019 3 ปีที่แล้ว

    Another one: Learn keyboard shortcuts that can make your life easier. Like in VS or VS Code. Shift + Delete will cut an entire line. Ctrl + Backspace will delete an entire word. Alt + Arrow Key will move a selected line. In windows, the Windows Key + V will allow you paste the last few things you've copied. That way, you can go ahead and copy all of the values you'll need and then paste all at once. These are all things that will prevent the flow of thought from being interrupted by the developer having to do manual word processing. There are so many TH-cam tutorials where they spend a crazy amount of time moving text around. Work smarter not harder.

  • @sidlife365
    @sidlife365 3 ปีที่แล้ว

    Amazing feedback.

  • @shivamshrivastav685
    @shivamshrivastav685 2 ปีที่แล้ว

    this is a great example of a video that looks a million times better not in fullscreen which is nice

  • @IGNACY-fp8zo
    @IGNACY-fp8zo 3 ปีที่แล้ว

    I tried running a few while loop but it freezes after 2-7 loops :/

  • @leonxx9790
    @leonxx9790 3 ปีที่แล้ว

    As a new programmer I have problems with #6, #8 and #9. Data structures is very important to inderstand. Good point with preprocess as due to lack of experience I tought that it's nice to have everything on the top. With commits.. I know that I should do smaller commit's but something going wrong somethimes.. again due to lack of experience I start to change one thing, after I have to change another and after I already should commit huge amount of work.. it's like a snowball)) insteed I should be able to break the big thing on smaller parts. Well we all learning! Thank you for the video

    • @allentom97
      @allentom97 ปีที่แล้ว

      If it helps, commit small and often then push once you are happy that you have done the main task.
      Don’t feel you have to push a single commit at a time.
      Or if it is a small change just add it in the message.

  • @MrC0MPUT3R
    @MrC0MPUT3R 4 ปีที่แล้ว +3

    Lol I had a boss (the owner of the company) who was very guilty of the first one. Every time I would point it out in code review he'd just ignore me. When I left the company there was a lot of barely maintainable code.

  • @dapipocapopai3032
    @dapipocapopai3032 3 ปีที่แล้ว +5

    What I was expecting: 10 Newbie Programming Mistakes
    What I got: 10 daily habits I have that are wrong

  • @anonymoususer7663
    @anonymoususer7663 3 ปีที่แล้ว

    I'm a total noob and i've never needed to copy and paste error codes into google. I usually just find the line the error is on (my visual studio 2017 shows me what line) and then I can usually instantly figure it out based on what is there.

  • @djinn9488
    @djinn9488 5 ปีที่แล้ว +4

    Trying to work on #9, myself 😅

  • @nn-hs6ho
    @nn-hs6ho 3 ปีที่แล้ว

    wow great vid quality

  • @pokefreak2112
    @pokefreak2112 4 ปีที่แล้ว +7

    I completely disagree with the elseif one, I see a ton of co-workers introducing complex nested branching when all they needed was some early return conditions

    • @Maniacsurvivor
      @Maniacsurvivor 4 ปีที่แล้ว

      Why not just use a switch case then.

    • @patrickspiegel5524
      @patrickspiegel5524 2 ปีที่แล้ว

      @@Maniacsurvivor no advantage using if/else and switch statements over eachother. just comes down to style preference. The nice thing about if/else is the new scope, while in switch case you have the same scope in all statements.

  • @JulleHimself
    @JulleHimself 3 ปีที่แล้ว

    Have worked now as a programmer for almost 2 years and was just curious if I am doing something mentioned here.
    I'm guilty though of console.logging, because I feel like the debugger in VS code for React is really hard to follow, unlike VS when debugging something in C#. I do find bugs fairly effeciently though I would still say but I could def improve on that one hehe.

  • @Maniacsurvivor
    @Maniacsurvivor 4 ปีที่แล้ว +2

    Lucked out, yes 😅 I was sure you would mention not using automated tests.

  • @abduvosidmalikov
    @abduvosidmalikov 3 ปีที่แล้ว +1

    using map instead of looping over lists.. that was interesting! Thanks

  • @superzekethegreat
    @superzekethegreat 3 ปีที่แล้ว +1

    I've been programming for years now and sometimes I still fall victim to number 9-Large unorganized commits. It tends to be for me at least that the more tired I get (once your 10-12 hours in) I get alot more likely to do this.

  • @CottidaeSEA
    @CottidaeSEA 3 ปีที่แล้ว

    One "mistake" I see a lot of people do is adding strings together with +, especially when printing things out.
    Using String.format(), std::format() or whatever your language provides is generally much easier to work with once you learn how it works.

  • @rmarinero
    @rmarinero 4 ปีที่แล้ว +2

    For debug use a debugger, do not print, do it only for programs that require logging.

  • @dr_j0nes
    @dr_j0nes 3 ปีที่แล้ว +1

    What is an Air Message?

  • @alanhunt3772
    @alanhunt3772 3 ปีที่แล้ว

    Bro, my commits are YUGE. We’re talking going from 1.0.0 to 2.3.0. Thank you for calling me out, definitely going to work on that.
    I would also recommend as you’re developing to keep official API documents up in the browser for quick reference, especially if you’re new to a language. Really helps show you what tools are available to get the job done.

    • @Nashy119
      @Nashy119 3 ปีที่แล้ว

      If you're working on a big application and somewhere in the world someone finds a bug in it, you can checkout the commits to find which one introduced it. Obviously at that time you'd like a small atomic change with a reason rather than a huge wall of changes.

  • @anthonyz9197
    @anthonyz9197 3 ปีที่แล้ว

    +1 for not reading error messages. I've seen this before with my colleagues. They come to me with the error and I literally take a screenshot of the error message and send it back to them saying that is what they need to do to fix it.

  • @abstractapproach634
    @abstractapproach634 3 ปีที่แล้ว

    I'm guilty of #3, but when you don't know where the error is it helps, I often look at the variables every loop. I kind of manually set break points with while(getc(stdin) != '
    '); statements.
    Also, #6, ..... I'll look into that
    #9, what's a commit?

  • @phileon2323
    @phileon2323 3 ปีที่แล้ว

    I remember when I first started unity, I would have huge update functions which is just cluttered and I would waste so much time in debugging

  • @karanagarwal282
    @karanagarwal282 3 ปีที่แล้ว

    I feel what you missed was that putting multiple if statements instead of if else can result into logical errors in your code
    I did that too much logging out a lot of time but that always goes like a print statement in inner loop than outer and so on....
    And as you said people should read error messages, I think error messages are programmers and debugging team's best friend

  • @paungster
    @paungster 3 ปีที่แล้ว

    These points are important. I used some of the points after seeing this video.

  • @christophs.3334
    @christophs.3334 3 ปีที่แล้ว +1

    I actually dont agree with the if statement part. I think it is a good practice to do if statement which are not nested, without else and for example terminates the function run with a return instead of doing these insane nested if statement stuff which is nobody able to read

  • @Kamiyaa
    @Kamiyaa 4 ปีที่แล้ว

    The reason why some ppl do the preprocessing upfront is because they were taught in school thats how you write C code. But that's only half the truth. Unless you're developing for some reason obscure system like some corporate UNIX system, the compiler will have support for c99+ and will allow you to declare variables in the middle of your functions. I really agree though, having variables declared in the beginning just pollutes your state and makes your mind have to juggle around more unnecessary variables

  • @FlaviusAspra
    @FlaviusAspra 3 ปีที่แล้ว

    I don't even know where to start, but I got to start somewhere.
    First off, I don't understand why so many newbies give advice to other newbies. I know, you want to help, the thing is, the issues you raise are real, they should be addressed, BUT the solutions you provide are incomplete.
    #3 "logging too much output" -- you want to do structured logging, meaning with information like: loglevel, subsystem, component/package/class, method, line, and then you want to filter in a targeted manner. This way, you can also configure the logging for production.
    #7 "Using multiple if statements instead of doing if/else statements" the situation which you describe sounds like not using polymorphism. When you have a mutually exclusive list of ifs, you want to put each block of the if inside a class, using a common contract, and inject it from outside
    #9 "Large unorganized commits" -- here you're not offering a solution. To make good commits, do like this: before starting to work, think what you're going to do to the code. THAT is your commit message. Keep it in the back of your mind. Now start working towards that goal ONLY.
    Want to do some "boyscout rule"? Sure, do it, but do it only in isolated parts of the code (which will be clear git hunks -- think of git add -pv -- not amalgamated between modified lines of code touched by your initial "commit message"). As you modify your code, you get ideas for refactorings? Sure, do them, but not in the code YET, do them just as commit messages, and put those commit messages in your mental queue of commit messages. In this queue, you'll have at the top your initial commit message, and then the next commit messages - already prepared in your mind, they "just" need to be put into practice, one by one.
    I'm a CTO at a smaller company, 15 years of experience, hope these refined advices help.

  • @tegaogheneovo5881
    @tegaogheneovo5881 2 ปีที่แล้ว

    That thumbnail got me

  • @mulwelimushiana8388
    @mulwelimushiana8388 3 ปีที่แล้ว

    I feel proud of myself because I learnt all of these lessons myself and improved 👌

  • @SepSol75
    @SepSol75 4 ปีที่แล้ว +7

    Just commited my code after watching this so that it won't get bigger than it already is xD

  • @saarinenj1
    @saarinenj1 3 ปีที่แล้ว

    I just started to self taught me on html. I do all of these mistakes.
    What do i do lol

  • @BenRangel
    @BenRangel 3 ปีที่แล้ว

    When it comes to naming
    * not pluralizing (”item” could be an array)
    * unclear booleans function names like ”checkValid” (..when ”isValid” would be better). Possibly cause they are scared to death of fn names sounding similar to property names
    * no instinct for succinct names. like arrayOfNamesWhicyHaveBeenFiltered instead of just filteredNames
    * no instinct when a variable name could help to clarify or when it’s unneceessary, they just follow ”patterns”. If someone stored a complex regex into an ”isValidEmailRegex” var they can happily remove that variable name if they’ve heard someone saying not to use variables unnecessesarily in the codebase. Or go the opposite route and write ”isXtrue = x==true” if they hear someone saying variablenames can be used as clarification.

  • @thiyagutenysen8058
    @thiyagutenysen8058 3 ปีที่แล้ว +3

    maan, your voice is most satisfying.

  • @synthesizedsimurgh2127
    @synthesizedsimurgh2127 4 ปีที่แล้ว

    Is that You Belong With Me playing in the background?

  • @matssommervold
    @matssommervold 3 ปีที่แล้ว +1

    I don't know what it is, but I don't like auto-formatting at all. And I really don't like it when people use tabs equivalent to 2 spaces instead of 4. But I feel like I am the only one :/

  • @JetJockey87
    @JetJockey87 3 ปีที่แล้ว

    I was thinking more like, loops should always start the index at 1, not 0.
    Or when you can't copy paste files between environments, just encode them to base64, copy the text and decode it in the new environment.

  • @AnkitJosh
    @AnkitJosh 3 ปีที่แล้ว

    turned on captions,it showed "air massage"

  • @aflibnush
    @aflibnush 4 ปีที่แล้ว

    Good ones ✌

  • @terminallumbago5582
    @terminallumbago5582 4 ปีที่แล้ว +3

    Number 3, I would say use debugger and avoid print statements especially if it’s production code.

    • @davidgerstgrasser8650
      @davidgerstgrasser8650 4 ปีที่แล้ว +1

      i think sometimes a debugger is overkill. print can be nice for debugging

    • @terminallumbago5582
      @terminallumbago5582 4 ปีที่แล้ว +1

      Oompa Loompa Yes it can be. I don’t think it’s good practice though, in case it slips into production and you end up printing something you shouldn’t be. I admit though that I’ve done it myself, for the exact reason you mention, especially if it’s that bloody remote debugger.

  • @raz1572
    @raz1572 3 ปีที่แล้ว

    The error message one gave me data merge flashbacks...

  • @charliesumorok6765
    @charliesumorok6765 3 ปีที่แล้ว

    1:25 It is also a good idea to label your logs.

  • @_GhostMiner
    @_GhostMiner 3 ปีที่แล้ว +3

    4:10 flashbacks of yandere simulator code,

  • @MaxPicAxe
    @MaxPicAxe 4 ปีที่แล้ว

    Yeah, whenever I see an error, I immediately look at the line number and head back to my code. But to be honest, that's fine for me because I can normally identify the mistake. If not, I'll actually read the error message, or in more detail.

  • @redwilliams1804
    @redwilliams1804 3 ปีที่แล้ว

    1:40 But stay away from print debugging, it can clutter your code very easily. Using lodging module with Python and similar alternatives for other languages

  • @tejasn3835
    @tejasn3835 3 ปีที่แล้ว +7

    #3 Logging too much output - still a noob mistake
    use the debugger instead

    • @Nerketur
      @Nerketur 3 ปีที่แล้ว

      If only there was a good php debugger

  • @ryanyanko3547
    @ryanyanko3547 3 ปีที่แล้ว

    My biggest mistake is not doing something because I can't find the best way to do it, or trying to optimize as I go. It's best to first make it work, then go through it and make it work well and fast (optimize)

  • @billy4299
    @billy4299 4 ปีที่แล้ว

    I very often do huge commits... It's a tough habit to get out of

  • @cedric1731
    @cedric1731 3 ปีที่แล้ว

    My biggest newbie move recently was calling a function training a neural net which returned the net but instead of saving it to a variable I just called the function... That is what I would call pain...

  • @chipcoint9674
    @chipcoint9674 3 ปีที่แล้ว

    How do you get the idea of changing the code on an error without reading the error?? XD

  • @SpinningcatOMG
    @SpinningcatOMG 3 ปีที่แล้ว

    Yeah, I'm guilty of some of these out if laziness, but only slightly. The only one I'm egregiously bad with is large commits.

  • @WrestlingTournamentsDotCom
    @WrestlingTournamentsDotCom 3 ปีที่แล้ว +1

    I setup auto format after watching this. You’re right, I waste a lot of time. Thank you.

  • @louelaurelio8769
    @louelaurelio8769 3 ปีที่แล้ว +1

    k, so I was looking for resources or whatever term you use for it if your trying to learn something and I stumbled across this guy and didn't notice I'm halfway end of the vid bcs he's so cute