Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I see no mention of an improved debugger. IMHO, the atrocious debugger in JupyterLab is one of the primary reasons why it is difficult to write good code in this environment.

Even a simple improvement like remembering the sizes of various subpanels in the debugger sidebar will make me feel like I am not pulling teeth when I use it.

And don't get me started on inspecting the value of variables. If you are looking for more than an object within an object, you might as well go back to print statements.



Eh, print/log debugging works fine. Especially in an interactive environment: you've got direct access to the variables and objects, and can easily inspect them directly.

At some point I felt like I was a bad dev for not using a debugger, but at this point I think I'm more versatile since I'm less dependent on finicky tooling to figure out what some code is doing... Every language has it's own debugger to learn, but logging (and good strategies for logging) works about the same everywhere.


Debugging nested dicts and high-dim arrays is a nightmare using print


in python you can turn nested dictionaries and other data structures into json, but only if the data structures doesn't include circular references. I use that a lot.

something like

  >>> d = { "a":1, "b":[1,2,3] }
  >>> import json
  >>> print( json.dumps(d, indent=2) )
  {
    "a": 1,
    "b": [
      1,
      2,
      3,
    ]
  }


Try pprint:

  >>> d = { "a":1, "b":[1,2,3] }
  >>> d["d"] = d
  >>> import pprint
  >>> pprint.pprint(d)
  {'a': 1, 'b': [1, 2, 3], 'd': <Recursion on dict with id=4516761856>}


thanks, great!


Try `str`


Do you know how it compares to using Visual Studio Code's debugger with notebooks? I'm wanting to find a notebook debugger recommendation for my students.


The VSCode debugger works amazing with notebooks. I find it super useful all the time when I develop. Just install the Jupyter extensions and it should work


Vscode's notebook is quite good (as good as you consider it to be in comparison to pycharm), but on my system it always exhibits bugs: 'random' need to rerun code multiple times for the debugger to recognize changes, not terminating debugging session when I stop it, freezing interactive debugger shell in the middle of a session, etc.


Is this in the context of students learning to code, or something else where they need to use the notebooks to supplement their study?


Engineering students (not software) learning numerical methods, so doing programming themselves, but nothing very sophisticated. Their programming skills are mostly pretty limited so simpler is better. At the moment we use plain Jupyter notebooks, but a variable value explorer and simple debugger would be helpful. I want to avoid the (to them) bewildering complexity of an IDE.


Have you tried pyCharm? I believe even community (free) edition should have support You are looking for


No I haven't, but it looks like the community edition can't do notebooks: https://www.jetbrains.com/help/pycharm/jupyter-notebook-supp...


Ah, my bad then.

If it's for student, you could maybe get educational license, that is completely free for all their products, but I imagine it could be quite a hassle


Pycharm's notebook debugger is top notch, but their notebook implementation is, imo, clunky and slow.


Give it another shot if you haven't recently. I was a hardcore Jupyter Lab user and PyCharm pulled me away with their recent updates. Same hotkeys, good integrated tool support.

The VS Code implementation of notebooks has too much vertical space for me.


I'll try then! Last I remember they had some weird variable loading policy: even under small cell executions there'd be noticable delay before variables got 'refreshed', even when lazy loading was configured. Maybe only a problem on my end though.


The debugging engine is the same. They both use debugpy 'via' the Jupyter wire connection.


Also it has a poor multi-user experience.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: