Hacker News new | ask | show | jobs
by iamwil 2490 days ago
Depends. If I'm just sketching something in code, or I don't know what I'm actually building, I'll write it out in code first.

However, if I'm designing a known thing, where I understand what it's suppose to do; I usually devise a mental model of the thing I'm trying to build before I start committing to code.

Also, having a mental model for the system that you're designing makes it apparent whether someone else can pick up and understand your system.

I also don't really use a debugger. Not sure why though.

1 comments

I've also never used a debugger. Python libraries like icecream (https://github.com/gruns/icecream) make print debugging pretty nice. I wonder if I'm missing out, though. I use VS Code a lot, and have been intending to see if I can fit its debugger into my workflow.
I think you are missing out. Debuggers allow you to know the state of variables at every line, not just the ones where you print debug. Debuggers also allow you to set watch expressions and occasionally you step through library code which begins helping you understand the source of your dependencies.
Usually debuggers take extra steps to set up, and I find it only helps for code that's really hard to reason about. But the most time consuming thing is just stepping through the code, and if it happen to go too far, I have to start over from the top again.

I do like time-traveling debuggers though. Those give me something print statements don't give, and it's really great to examine the state as the application is progressing.

Just got this on a newsletter https://github.com/oslabs-beta/reactime