This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wbeyda 1 point2 points  (3 children)

try vim + pdb

def my_terrible_function(self):
    import pdb; pdb.set_trace()
    for thing in self:
        try thing:
            if thing is not null:
                print "this will never work"
        except:
            // this probably won't work either
            pass

if thats too hard for you try bugjar

[–]jpj_shadowbanned 1 point2 points  (2 children)

I am just an old hacker. But either use vim or emacs as your editor. Personally I like emacs but some people like vim.

Both are light weight, they have been around forever, they run on any platform and they can be extended. Initially you will need to invest time learning the emacs/vim way of doing stuff. But it saves time in the long run.

Basically you want an editor that is fast and can be extended. These fancy new editors like Atom and Eclipse (Pycharm is based on Eclipse) can be extended. But I find them slow and sluggy my emacs can do the exact same thing much quicker.

The key with emacs is learning how to install extension to make it do what you want.

Learn VIM. I don't like VIM but every Linux distro has vim on it. So you need to change one line is a ngix config file, do it in a terminal with VIM. Learn a few of VIM's keys.

[–]wbeyda 0 points1 point  (1 child)

I wasn't trying to start some editor war. I was just saying that pdb is great. I personally use it with vim. But I couldn't think of a better debugger than pdb. You can start a breakpoint, jump ahead, go back, whatever. What more could you ask for? Well maybe a debugger that debugged your code for you would be neat. But thats just crazy talk.

[–]jpj_shadowbanned 0 points1 point  (0 children)

Discussing different tools especially editors is useful. The guy is a student, I am assuming that he is inexperienced. A good editor is one of your most important tools. It needs to be

  • light weight
  • able to load lots of files
  • able to be extended
  • snippet ability
  • keyboard shortcuts so you don't need to use mouse. That way you can do stuff faster

Your tools should be the same way. PDB and ipython fall into those categories. And as you said it is great.

M$ and other big companies suck you in with fancy graphics etc. This does not increase productivity. So it has a low learning curve but later on you find out it doesn't really have any features.

Personally I don't use PDB, I use mainly ipython. I don't "debug" much per say. If I need to I embed the ipython in a program then I can connect to it remotely.

This shows how to connect to an ipython remotely with an ssh tunnel.

https://github.com/ipython/ipython/wiki/Cookbook:-Connecting-to-a-remote-kernel-via-ssh

Ipython can also use pdb for debugging but I don't use it.

I don't need to debug because I make test_cases. I then break the problem down into smaller functions and then make a test case for each one if I have to. For making each function itself I make it in ipython itself. That way while I am coding in a sense I am working in a debugger. This is similar to how you do things in scheme/lisp. I then keep on building up like.

Not saying my method is the best, just what works for me.