I work as a product support analyst looking to grow into a full-time SE role and working on independent projects can be discouraging. I even had the impostor syndrome at times, this was very reassuring! Lots of these tips I can apply to my day job too. I appreciate this video. thanks @Andy
The 7 Fundamentals To Be A Better "debugger" 1. Mindset Change 2. Read Error Message 3. Using Debugging Tools 4. Double Check Logic 5. Assume Human Error 6. Small Changes 7. Take Mental Break
I think the most important thing is that you don't assume your code works because there were no compilation or runtime errors. The really bad errors are where the code doesn't do what it's supposed to, maybe in just one isolated corner case. So test your code over a range of data, especially corner cases and satisfy yourself as to the logic. One other point. Make a point of deleting all temporary variables when you're done with it(In Java, C etc, this can be done using codeblocks} But always do that, expressly deleting variables if necessary. Temporary variables that held on to values from a different part of the code are a big source of errors in a lot of code. At the same time, use temporary variables rather than the main variables with long names in the process-heavy parts of the code. The final assignment to the main variable can be done in the end. Reduces the chances of the misspelling errors he talks about in the video. Finally if you are going to use print statements or whatever to debug the code, it's a good idea to save the file with a separate name first. This way you don't have to worry about adding further bugs by your experiments. And it's good to list the lines where you've made changes in a temporary comment as you go on
I’m still very new to coding but debugging is actually one of the attractive parts of coding to me. I love trying to find small problems and looking at things from different angles. This might not be the case when it’s actually my job but hopefully it’s not too painful since I like it from the start. Great video Andy!
no its not debugging sucks. unit tests are made to avoid debugging as much as possible because it can make a large codebase tottaly unmanagable if your not testing. people should be good at debugging but they should certainly not enjoy it.
THIS. THIS. THIS. ABSOLUTELY THIS. The FIRST thing you want to learn about programming at all is LEARN HOW TO DEBUG. Everything you said in the video is 100% spot on you can't miss any of this stuff. But definitely the most important lesson here is DON'T ASSUME, EVER. Your assumptions are going to be challenged at every step of the design process and it is important to SLOW DOWN and learn how to diagnose the problem. I personally like to systematically remove the most recent thing from a program and return to the most recent functioning version and slowly add everything back until I find out what the problem is. Then I take a closer look, replace, remove, fix etc. whatever the problem is and then run test after test after test to make sure the programming is rock-solid and your issue is 100% fixed. I think the most important thing you can learn in programming is learn how to slow down and carefully write your code and have a roadmap prior to writing this code. Keep a notepad to write down your concepts and re-examine it as you program and debug your code until you have achieved your vision or at least the closest you can to your vision.
I've actually recently gotten to the point where I'm debugging my code in my project. I've definitely been Googling for solutions. Useful video, thanks.
Check the number and order of (), [], and {}. For example : Add the number of the first ( and subtract the number of last ). If this is 0 then the number of them is correct. Anything else and you got an ()s error.
As a puzzle-loving gamer, I can really attest to the diffusive thinking. By giving your mind a break, you give it time to cool down and a good chance to refresh and tackle the problem(s) in a new way. One time I had a dream on how to beat a level I struggled for, for days and it was exactly what I needed. Bone headed mistakes will happen. I try my best to mitigate them but I'll still somehow skip over that semi colon key. Take it slow. I have a mental checklist of simple issues I look for in my code first like missing semi colons.
Perfect topic and dead on right about it. It is so easy to make a minor mistake while coding learning the debugger is an requirement. Reading and understanding the errors and stepping though the code is extremely important.
For some of us beginners we also need this video so as to b very careful while writing codes and to know first hand the task at hand and be prepared for it
I never heard of diffused thinking before and this is so true for me! I thought it was just me who always get problems figured out when I step away from doing code and I always wondered why it happened. Thanks for the new info. All your points are very relatable 💯
Haha, its really funny you made this! I was just sitting at my desk with pen and pad trying to find the root of a problem in some code (I found it yay :) ) and my phone was sitting beside me and gave me a notification of your video lol. Good timing Andy! And great video! 👍👌
Hey Andy, great video! I might have missed it, but I was wondering if you would cover what type of projects that you feel are the best to have on your portfolio? I’ve heard from so many different sources/videos varying opinions on projects. Some say that to be a developer all you need is to have something kinda challenging like a bug-tracker, while others say that it doesn’t hurt to have smaller projects like tic-tac-toe or sudoku solvers on your portfolio. What do you think? I’d love to hear your thoughts on this.
I used to see the term debugging and debug mode here and there but wasn't sure what it is. Anyone who just starts coding would already be debugging a few times.
Which do you prefer, gdb or lldb? Once your code is working properly, you may want to make it run faster. You'll need to see which part of the code is taking the most time; Valgrind is a good tool for this.
@@ademineshat im gonna need more than that.. A wrench in the head, couple of times, a slavic way of fixing things.. Hopefuly, that will do, and then ill reboot..
Metacognition. Thinking and analyzing the way you think. It's super powerful. Pump the brakes on an emotional rise or depressive mood and vivisect it as it attempts to take over. Nothing quite like it.
The biggest mistake I've made in my life that I wasn't learning, I was memorizing. That's how I couldnt do anything . I can't even solve programming challenges. Guys please give me some tips . What do I do ?
try taking all these coding challenges or try using hackerrank or leetcode to upgrade your problem solving skill. These challenges will force you to improve your ability to learn because you will constantly have to do research on your own from several sources and pool all these information you get to solve those problems.
When learning do not only repeat the programming examples on your computer. Also make little changes to check if you did understand it and test it on tour computer. Also think about similar things you can do with items you have learned and try them.
Stop memorizing stuff and take your time to complete coding challenges....also there will be times you will not understand anything but it just happens and it's OK!
The other day I was trying to make a api call based on the some logic and it wasn't throwing any errors and it was doing what I wanted it to do just not when I wanted it to do it... So I spent quite a bit of time working through my api and working through the way I was fetching it and storing it on the font end but everything was looking correct... So I was like I need to go do somthing else for a minute... When I came back I immediately noticed that I just put the the call I wanted to perform if the if statement was false inside the if statement 🤦🏻♂️. Some times you just need to step away haha
Very nice video :). What I'm going to say is not really related to the video, but I still hope I'll get some help. I'm in the beginning of my learning and I already saw that my biggest problem is my way of learning. It's too academic. I tend to just learn the lessons and try the given examples but that's all... It's like I'm too afraid to actually code and try things (maybe I'm too afraid to see that I still suck at coding?). What's very frustrating is that I do know that learning code like that is not the best...but I can't let my academic habits go... Did that happen to some of you? How did you overcome this?
Do the tutorials then use what you have learned to write your own application. How about an application to manage ‘Manufacturers’ and the ‘Widgets’ that they make? Think about ALL the potential issues: what happens to the widgets if you delete a manufacturer (which should never happen - you should make the manufacturer ‘inactive’)? Can you transfer a widget from one manufacturer to another? What about duplicate names etc?
Thanks for this video I have 1.6 year experience I don't know is I have ability to work on another company or project but I works on Linux on SET TOP BOX software where i do 90% bug resolve and debugging in java, and I can say I have command on debugging So I want to know answer all my IT seniors who reading this comment is I can work on another company or not Thanks Waiting for your reply.
Debugging is like the last hope you can have when your code doesn't work lol. Once you get hands on debugging it becomes a habit. Also looks like I have a crush on Andy 🤭
Or don't. Learn coding with nothing more than a text editor. It slows things down, but helps you learn as well. Some times I enjoy getting away from the IDE. It helps to actually be so wrong that the program won't even start. You learn a ton that way, vs. fixing the error as soon as the IDE flags it in red.
Also blame someone else in a joking manner, makes it more fun and easier: Examples in C: "Looks like Ritchie is ddosing my code again" "Ritchie WILL pay for that" "That Ritchie bastard is spamming packets again" "I knew it! It wasn't me, it was this compiler all along. It's specifically programmed to ruin my code, recognizes the style and then doesn't run it on purpose" "This compiler has a grudge against me I swear, I need to see who programmed this compiler, investigate those people"
"You are going to reference the variable in the wrong time. That's software development." Nope that's JavaScript. Because it let's you fail silently. :)) Jokes aside, great video Andy.
so you're in the shower thinking about your dirty code han?! hahah jk great video ! the part about bringing some creativity to solve your code's problems is really true ! there's allways another way of doing things, and we should allways remeber that the system is never wrong (we are xD)...
so, yeah sorry, a quick one, are you saying you learnt programming in one year, like you literarily 'self-taught' yourself in 2014 and landed your first job in 2015? and please how was that like really possible...and yeah i know that you don't need to be a total expert to land a job, so the question was actually, ''is that really possible to self-learn in just one year and land a job"?
How are your debugging skills at this point? Did this video give you any valuable tips on how to improve them moving forward?
I work as a product support analyst looking to grow into a full-time SE role and working on independent projects can be discouraging. I even had the impostor syndrome at times, this was very reassuring! Lots of these tips I can apply to my day job too.
I appreciate this video. thanks @Andy
Mine are non-existent.
Very helpful.. thank You
@@lizzymichaels this video would be so much better if there was a practical side of it
I saw a funny quote on reddit that said, “debugging is like being a detective in a crime movie where you’re also the murderer”
Lol pretty accurate.
debugging sucks, testing rocks. but who the hell has time to write good tests when your loaded over your head with so much technical debt?
Being able to debug is a good sign that you understand the logic behind your code. Great advice, Andy!
The 7 Fundamentals To Be A Better "debugger"
1. Mindset Change
2. Read Error Message
3. Using Debugging Tools
4. Double Check Logic
5. Assume Human Error
6. Small Changes
7. Take Mental Break
This one needs to be on the top
I think the most important thing is that you don't assume your code works because there were no compilation or runtime errors. The really bad errors are where the code doesn't do what it's supposed to, maybe in just one isolated corner case. So test your code over a range of data, especially corner cases and satisfy yourself as to the logic. One other point. Make a point of deleting all temporary variables when you're done with it(In Java, C etc, this can be done using codeblocks} But always do that, expressly deleting variables if necessary. Temporary variables that held on to values from a different part of the code are a big source of errors in a lot of code. At the same time, use temporary variables rather than the main variables with long names in the process-heavy parts of the code. The final assignment to the main variable can be done in the end. Reduces the chances of the misspelling errors he talks about in the video. Finally if you are going to use print statements or whatever to debug the code, it's a good idea to save the file with a separate name first. This way you don't have to worry about adding further bugs by your experiments. And it's good to list the lines where you've made changes in a temporary comment as you go on
I’m still very new to coding but debugging is actually one of the attractive parts of coding to me. I love trying to find small problems and looking at things from different angles. This might not be the case when it’s actually my job but hopefully it’s not too painful since I like it from the start.
Great video Andy!
Debugging is one of the fun and interesting parts of programming.
no its not debugging sucks. unit tests are made to avoid debugging as much as possible because it can make a large codebase tottaly unmanagable if your not testing. people should be good at debugging but they should certainly not enjoy it.
Debugging without actually showing any examples or actual real life example of debugging. Great it is an honor to to you.....
THIS. THIS. THIS. ABSOLUTELY THIS.
The FIRST thing you want to learn about programming at all is LEARN HOW TO DEBUG.
Everything you said in the video is 100% spot on you can't miss any of this stuff. But definitely the most important lesson here is DON'T ASSUME, EVER. Your assumptions are going to be challenged at every step of the design process and it is important to SLOW DOWN and learn how to diagnose the problem. I personally like to systematically remove the most recent thing from a program and return to the most recent functioning version and slowly add everything back until I find out what the problem is. Then I take a closer look, replace, remove, fix etc. whatever the problem is and then run test after test after test to make sure the programming is rock-solid and your issue is 100% fixed.
I think the most important thing you can learn in programming is learn how to slow down and carefully write your code and have a roadmap prior to writing this code. Keep a notepad to write down your concepts and re-examine it as you program and debug your code until you have achieved your vision or at least the closest you can to your vision.
I've actually recently gotten to the point where I'm debugging my code in my project. I've definitely been Googling for solutions. Useful video, thanks.
Check the number and order of (), [], and {}. For example : Add the number of the first ( and subtract the number of last ). If this is 0 then the number of them is correct. Anything else and you got an ()s error.
As a puzzle-loving gamer, I can really attest to the diffusive thinking. By giving your mind a break, you give it time to cool down and a good chance to refresh and tackle the problem(s) in a new way. One time I had a dream on how to beat a level I struggled for, for days and it was exactly what I needed.
Bone headed mistakes will happen. I try my best to mitigate them but I'll still somehow skip over that semi colon key. Take it slow. I have a mental checklist of simple issues I look for in my code first like missing semi colons.
Perfect topic and dead on right about it. It is so easy to make a minor mistake while coding learning the debugger is an requirement. Reading and understanding the errors and stepping though the code is extremely important.
For some of us beginners we also need this video so as to b very careful while writing codes and to know first hand the task at hand and be prepared for it
I never heard of diffused thinking before and this is so true for me! I thought it was just me who always get problems figured out when I step away from doing code and I always wondered why it happened. Thanks for the new info. All your points are very relatable 💯
Haha, its really funny you made this! I was just sitting at my desk with pen and pad trying to find the root of a problem in some code (I found it yay :) ) and my phone was sitting beside me and gave me a notification of your video lol. Good timing Andy! And great video! 👍👌
Nice! I know all about that haha. Cheers!
Hey Andy, great video! I might have missed it, but I was wondering if you would cover what type of projects that you feel are the best to have on your portfolio? I’ve heard from so many different sources/videos varying opinions on projects. Some say that to be a developer all you need is to have something kinda challenging like a bug-tracker, while others say that it doesn’t hurt to have smaller projects like tic-tac-toe or sudoku solvers on your portfolio. What do you think? I’d love to hear your thoughts on this.
I appreciate Andy doesn't have adverts.
Thank you Andy, this was useful and one of its kind ☺️ please do a video on testing the solutions we develop
You landed your first job after 1 year of teaching yourself how to program. Did you follow any roadmap or did you come up with your own study pattern?
I used to see the term debugging and debug mode here and there but wasn't sure what it is. Anyone who just starts coding would already be debugging a few times.
Which do you prefer, gdb or lldb?
Once your code is working properly, you may want to make it run faster. You'll need to see which part of the code is taking the most time; Valgrind is a good tool for this.
Debugging and researching skills are critical! Great video!
I need to learn how to debug my brain..
It's the same thing with code 😂
Meh too
@@ademineshat im gonna need more than that.. A wrench in the head, couple of times, a slavic way of fixing things.. Hopefuly, that will do, and then ill reboot..
Metacognition. Thinking and analyzing the way you think. It's super powerful.
Pump the brakes on an emotional rise or depressive mood and vivisect it as it attempts to take over.
Nothing quite like it.
Great advice! Your videos actually help. Thank you for posting this and please keep posting videos like this.
The biggest mistake I've made in my life that I wasn't learning, I was memorizing. That's how I couldnt do anything . I can't even solve programming challenges. Guys please give me some tips . What do I do ?
try taking all these coding challenges or try using hackerrank or leetcode to upgrade your problem solving skill. These challenges will force you to improve your ability to learn because you will constantly have to do research on your own from several sources and pool all these information you get to solve those problems.
Maybe start some simple programming project.
When learning do not only repeat the programming examples on your computer. Also make little changes to check if you did understand it and test it on tour computer. Also think about similar things you can do with items you have learned and try them.
@@JanJeronimus Thanks man
Stop memorizing stuff and take your time to complete coding challenges....also there will be times you will not understand anything but it just happens and it's OK!
Great background video on Debugging. Thanks, Andy.
{2021-08-04}
The other day I was trying to make a api call based on the some logic and it wasn't throwing any errors and it was doing what I wanted it to do just not when I wanted it to do it... So I spent quite a bit of time working through my api and working through the way I was fetching it and storing it on the font end but everything was looking correct... So I was like I need to go do somthing else for a minute... When I came back I immediately noticed that I just put the the call I wanted to perform if the if statement was false inside the if statement 🤦🏻♂️. Some times you just need to step away haha
I love you. Thank you so much for your content. I’m tuned-in for the night.
Very nice video :).
What I'm going to say is not really related to the video, but I still hope I'll get some help.
I'm in the beginning of my learning and I already saw that my biggest problem is my way of learning. It's too academic. I tend to just learn the lessons and try the given examples but that's all...
It's like I'm too afraid to actually code and try things (maybe I'm too afraid to see that I still suck at coding?). What's very frustrating is that I do know that learning code like that is not the best...but I can't let my academic habits go...
Did that happen to some of you? How did you overcome this?
It'll get better with time. Try to be consistent about coding.
Do the tutorials then use what you have learned to write your own application.
How about an application to manage ‘Manufacturers’ and the ‘Widgets’ that they make?
Think about ALL the potential issues: what happens to the widgets if you delete a manufacturer (which should never happen - you should make the manufacturer ‘inactive’)? Can you transfer a widget from one manufacturer to another? What about duplicate names etc?
I was hoping for a demonstration
Thanks for this video I have 1.6 year experience I don't know is I have ability to work on another company or project but I works on Linux on SET TOP BOX software where i do 90% bug resolve and debugging in java, and I can say I have command on debugging So I want to know answer all my IT seniors who reading this comment is I can work on another company or not
Thanks Waiting for your reply.
Working on a semi team. My rule is: if something is not working, it is the humans fault.
Thank you Andy 💪
You're very welcome!
Another great one from Andy!
Great video, bro
Thank you 😊
Thanks for sharing! It's really insightful :)
Debugging is like the last hope you can have when your code doesn't work lol. Once you get hands on debugging it becomes a habit.
Also looks like I have a crush on Andy 🤭
9:41 Occams Razor right there.
I should probably learn how to open the IDE first
lmao I believe in u man
Or don't. Learn coding with nothing more than a text editor. It slows things down, but helps you learn as well.
Some times I enjoy getting away from the IDE. It helps to actually be so wrong that the program won't even start. You learn a ton that way, vs. fixing the error as soon as the IDE flags it in red.
Im usually debugging when i write php code, but mostely console.log() in javascript.
Examples makes sense
Hey! what are you thoughts on someone who wanna be an Android app developer?
Also blame someone else in a joking manner, makes it more fun and easier:
Examples in C:
"Looks like Ritchie is ddosing my code again"
"Ritchie WILL pay for that"
"That Ritchie bastard is spamming packets again"
"I knew it! It wasn't me, it was this compiler all along. It's specifically programmed to ruin my code, recognizes the style and then doesn't run it on purpose"
"This compiler has a grudge against me I swear, I need to see who programmed this compiler, investigate those people"
Great video Thanks Andy🌱
SUPER VIDEO
I WANNA BE A MASTER DEBUGGER
Dude you rock!!!!!
"You are going to reference the variable in the wrong time. That's software development."
Nope that's JavaScript. Because it let's you fail silently. :))
Jokes aside, great video Andy.
Good point! Cheers Kat :-)
Superb bro....
Keep doing more videos 👍
IDA or OLLYDBG ?
Thank you❤😘
so it's like skyrim modding
How about using rust
so you're in the shower thinking about your dirty code han?! hahah jk great video ! the part about bringing some creativity to solve your code's problems is really true ! there's allways another way of doing things, and we should allways remeber that the system is never wrong (we are xD)...
Fundamentals 1 - 4 === "CRUD" :)
Every time I see your blue bullet points it makes me hungry for cheeto puffs xD
Lol
make 👏 few 👏 changes 👏 check 👏 often 👏
so, yeah sorry, a quick one, are you saying you learnt programming in one year, like you literarily 'self-taught' yourself in 2014 and landed your first job in 2015? and please how was that like really possible...and yeah i know that you don't need to be a total expert to land a job, so the question was actually, ''is that really possible to self-learn in just one year and land a job"?
assist alot
andy I give up, 6 years of trying to become a programmer and still no job. I am nothing
You're a hell of a lot better than nothing. Give yourself some credit.
Try finding a mentor.
A very small fraction of the population knows how to code.
if (debugger === true) {
🤯
}
The way I debug is "I refocus"
pretenders huh?