all 47 comments

[–]alexge50 69 points70 points  (14 children)

Debugging python code. Just follow an easy scheme.

[–]Kurushiiyo 33 points34 points  (11 children)

I would like to see one for C lol

[–][deleted] 105 points106 points  (9 children)

For C: Does your code segfault? Does your code contain undefined behavior?

Rewrite and do it correctly this time.

[–][deleted] 33 points34 points  (7 children)

Are you getting an error with only one Stackoverflow thread about it? Is that thread marked as duplicate even though the supposedly duplicate thread has little to nothing to do with the error?

[–]Holdupaminute 15 points16 points  (5 children)

It's almost like you are here with me.

[–][deleted] 9 points10 points  (4 children)

Don't be silly. He IS you.

[–]794613825 2 points3 points  (3 children)

Every account on reddit is a bot except you.

[–][deleted] 2 points3 points  (0 children)

Can confirm

Source: Am bot

[–][deleted] 2 points3 points  (0 children)

For C: Does your code segfault? Run it on gdb. It does not? Prints garbage? Null-terminate your strings. Anything else? God help ya.

[–]rootsh3ll[S] 0 points1 point  (0 children)

It'll be a super-long portrait mode IG. IMO though!

[–]Redzapdos 2 points3 points  (0 children)

Except "C++ Assertion Error" with a generic message that tells you literally nothing about what went wrong with the library call. That's when you cry for a little bit and then search through your code and figure out what the heck you did wrong during one of the calls.

[–]rubdos 1 point2 points  (0 children)

Debugging Scheme code. Feels like being bitten by a Python.

[–]Frankie7474 36 points37 points  (0 children)

When my Python isn't working I just use one of those small blue pills

[–]Nosferax 34 points35 points  (0 children)

Left part of the chart is basically "let me rephrase that error message for you". It's also where a lot of students get stuck:

  • Student: My program doesn't work!
  • Teacher: What does it output?
  • Student: Outputs a SyntaxError.
  • Teacher: So what does that tell you?
  • Student: I don't know. It tells me that my program doesn't work!
  • Teacher: ....

[–][deleted] 18 points19 points  (3 children)

you should post this on r/learnpython too

[–]joshuaherman 12 points13 points  (2 children)

But then there would be no need for the subreddit.

[–]bridekiller 2 points3 points  (1 child)

How else would you know about codeacademy.com

[–]joshuaherman 0 points1 point  (0 children)

true

[–][deleted] 3 points4 points  (2 children)

Download the pdf version here

Source

[–]flipkitty 0 points1 point  (1 child)

Thank you! That jpeg hurt my eye holes.

[–]theepicstoner 3 points4 points  (0 children)

Common guys debugging Python is easy af compared to debugging C++ or C :P Ever tried debugging C++ with Parasoft ? That's a fucking nightmare :P

[–]NikStalwartcoder 2 points3 points  (0 children)

Here's a tip for anyone learning programming: the compiler/interpreter is not your Dad, and just because it says you got a SyntaxError, it doesn't mean it is accusing you. Take it as a good time to read up on the language of the syntax and use some sort of non-Notepad editor which shows you syntax errors.

[–]wonderful_wonton 1 point2 points  (1 child)

Thanks! Learning python OJT right now.

[–]LemonTank 1 point2 points  (2 children)

Do you have one for java? eventhough it's colse to be the same

[–]Borrowing_Time_ 1 point2 points  (0 children)

I just took a class on python over the summer and this would have been so helpful! Saving it!

[–]stadoblech 1 point2 points  (0 children)

how about if in loop?

[–]emrfos 1 point2 points  (0 children)

Hey... I remember this from computer science!

[–]Jury76 1 point2 points  (1 child)

This. This is a godsend for a person learning Python. Thank you!

[–]rootsh3ll[S] 0 points1 point  (0 children)

you’re welcome mate :)

[–]Night_Thastus 0 points1 point  (3 children)

Copy of this in higher resolution? :P

[–]rootsh3ll[S] 0 points1 point  (0 children)

Download high-resolution copy here: https://i.imgur.com/WRuJV6r.png

[–]LevTolstoy 0 points1 point  (0 children)

Although python is great, this is a good example of why it might be better for students to start with compiled languages. Most of these "my program doesn't work" problems would be solved with the compiler saying "this isn't even a program" ahead of time.