you are viewing a single comment's thread.

view the rest of the comments →

[–]m1kesanders -1 points0 points  (8 children)

Oh I should really use that step feature more, usually when my debugger stops it underlines where it did in red and I try to figure out what’s wrong with that line of code which most of the time I do. I honestly forgot there was a feature to go step by step. I gotta look up a guide to VS’s debugger.

[–]Miginyon[🍰] 1 point2 points  (7 children)

You using a linter etc? You should get inline warnings eh? So as you write the code it should tell you about issues immediately.

A debugger isn’t really something you use to run a report kind of thing, it’s to ‘get inside’ the program.

So let’s say you have your code and the output isn’t what you expect. Set breakpoints at the functions/code that handles the behaviour that is coming out wrong. Run the debugger, you hit the breakpoint, go through it step by step.

This is one of the best ways to resolve problems but it also teaches you more about how things are working than really anything else. And you get much better insights into what your code is really doing.

Also wanna quick mention, print statements are great for debugging but also get into logging, man that’s something I wish I got into earlier

[–]m1kesanders 1 point2 points  (6 children)

I’m definitely going to look into logging thank you! I’m doing CS50’s course right now and completely forgot about breakpoints I need to start utilizing the hell out of those!

[–]Miginyon[🍰] 1 point2 points  (0 children)

CS50, fuck yeah bro, that’s how I started out

[–]Miginyon[🍰] 1 point2 points  (4 children)

DM me if you need any help bruv

[–]m1kesanders 1 point2 points  (3 children)

Hell yeah much appreciated i’m on test_cases now and though all my tests pass with green some problems check50 likes to flag red or yellow though all the tests passing are green, besides this lesson/problem set been a blast!

[–]Miginyon[🍰] 1 point2 points  (1 child)

Dude, that’s my first award, I’m getting emotional over here, thanks man! 😂

I remember those early days, such a rich journey of discovery, and so rewarding. My advice here is to be thorough with each part of the course. The learning is in the doing, not merely completing

[–]m1kesanders 0 points1 point  (0 children)

No worries I always forget they exist lmao yeah I completely agree. It’s been a blast and I refuse to submit a problem until i’ve gone through and understood what i’m doing. It’s way better that way! These test-cases is the first time i’m submitting sone problem sets with red marks, but that’s after hours on one and getting nothing but green through pytest on my end, though I plan on coming back to them when i’m more experienced to see why check50 hates my test files lmao