I run the code line by line. Now working with Python and functions, I find it difficult to figure out what is going on and to build,,, 2/
-
Show this thread
-
the code interactively, as I'm used to. I use Spyder with an ipython console and have tried pdb.set_trace, but it is very cumbersome... 3/3
3 replies 1 retweet 0 likesShow this thread -
python2-trepan is a slightly more advanced debugger that allows you to "step into" functions but it's not super well documented
2 replies 0 retweets 2 likes -
But yeah, debugger's like that in python aren't as good as they are in lot's of other languages.
2 replies 0 retweets 2 likes -
If you keep your functions small (you should be able to describe exactly what a function does without using the word "and") then usually /1
2 replies 0 retweets 1 like -
Replying to @alex__morley @o_guest
that's another of my bad habits. Though when I try keeping them small then I get lost into what calls what, i.e. the flow through it all
1 reply 0 retweets 1 like -
For sure their is a balance to strike! I try to write flow of what I want to do as comments before I write any code ... /1
1 reply 0 retweets 1 like -
then fill in the blanks with code or functions that I've written separately, keeps my head straight(-ish).
1 reply 0 retweets 1 like -
Replying to @alex__morley @venpopov
Nice. Pseudocode is useful. I tend to just code as I go but I see the value of planning stuff out. I plan but often by scribbling on paper.
2 replies 0 retweets 1 like -
We mortals need to plan out our code since we can't visualize the entire codebase in our heads like
@o_guest.pic.twitter.com/H5k0uY4sDF1 reply 0 retweets 4 likes
Too kind! I think it's just years of doing it. I probably plan without realising it.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.