Ask HN: What tool/trick has most improved your programming productivity? - dizzydes
======
juangacovas
Interactive debugging. "Most bugs are a result of the execution state not
being exactly what you think it is" (Carmack) and it's astonishing how many
people just refuses to effectively debug using an interactive debugger, which
allows for easy inspection of anything, at any moment, with a REPL for a given
state of your program, including call stack inspection/jumping and what not.
Some say that "printing" and/or "logging" is just "enough", when those are
_other_ debugging techniques and often needed too. Heck, even some say that
"if you need to step through your code you already are in bad shit" just as an
excuse.

Knowing how to do effective, interactive debugging in any language is a major
step in productivity: it helps in so many ways: learning, diagnose, getting
things done...

~~~
arduinomancer
I can’t stand watching people do the add print statement —> compile —> run
loop over and over. You can save so much time just stepping through and
printing things in the REPL. It’s like you’re gonna be in this industry a long
time, learn the damn tools.

Sometimes if I’m writing a complicated piece of logic I’ll even jump straight
to the debugger on first run just to look at all the values and make sure the
assumptions were correct.

~~~
wingerlang
Both have their place, printing is good when you need to get some quantity
reads.

------
IpV8
I like to leave off at the end of the day knowing what the next step is. I
leave a small task that I could easily do then and there. This way I can start
my morning off with a simple, quick, productive task. This gets my momentum
rolling. I learned it reading about some famous author that used to use this
trick.

Other fun productivity tricks include drawing a simple diagram when you can't
focus or don't know what to work on next. I also try to have tasks that take
all different levels of focus and cognitive energy in the backlog so that I
can choose a task based on my mood.

------
muzani
Meditation. Not the type that keeps you calm, but the type that acts as
internal debugging.

All my issues with procrastination come from some deep internal issues, for
example, an aversion to working hard, sleeping early, or wanting to spend a
lot of time on games as some sort of status symbol.

A lot of these come from mental scars in our past, or even the wrong cultural
conditioning. Basically just think what we would do if we were in complete
control of ourselves, and why we're not doing that. And then dig really deep
to find out where. You'll definitely know when you strike the nerve - it can
trigger a sudden rage or tears. But hitting that nerve reduces the control it
has over you.

------
stevefan1999
Keeping a private "playground" code repository that hosts various
"trivial"/useless projects you've flash through in your brain during free
time. For most of us, a simple application prototype is good enough.

Keep them buried for some period (maybe a month or so), then review back your
code and see what's the good, bad & ugly you used to have (e.g algorithm
usage, memory allocation, code style, correctness). I love this kind of
"writer's retrospection" to see how much we've grown.

------
beatgammit
I like the Pomodoro method. Basically, focus on a task for 25 minutes, then
take a 5 minute break. Every 4 blocks, take a 15 minute break instead.

I work at home, so I do housework in some of those 5 minute breaks. It's
different enough that it helps clear my mind enough to focus again after the
break.

I'm still trying to find a good way to plan these work chunks, but so far I
think emacs org-mode will work pretty well.

~~~
avichalp
I find it difficult to break after 25 minutes when I am too much into the
stuff specially in between complex debugging. Then I feel like I am not doing
Pomodoro right. Do have a similar experience?

------
speedplane
Test driven development. Making your tests first, or at least early, helps you
mentally nail down what you want your software to do. It also helps you think
defensively early-on about corner cases and race conditions.

But that isn't really where the biggest benefits lie.

When you come back to that code a year later and have to make changes to it,
but have forgotten how it works, having all the tests pass with good coverage
provides a significant (but not absolute) level of confidence that you didn't
break anything.

Given that so much development time is spent editing/updating code, rather
than writing it from scratch, this can be a huge speedup in productivity.

------
macando
Prettier for auto formatting. Tailwind for CSS.

However, the biggest win was having a custom React boilerplate better suited
to my needs than anything else that's out there.

~~~
tmm84
I love using prettier. I just hit that format button or let it format on save.
No reason to waste time formatting it when something can do the styling I
normally do automatically.

------
wil999
Jetbrains IDEs and learning using flashcards.

~~~
dizzydes
+1 on Jetbrains, I've just installed PHPStorm and have skipped a ton of env
setup BS already by having PHPStorm run my stuff from inside a docker
container managed in the IDE itself.

What do you learn using flashcards, out of interest?

~~~
wil999
I use Ankidroid and make my own cards.

It works on all platforms and is free. Usually just language syntax, and
keywords.

But there are great free flash cards like this one on Kotlin:
[https://ankiweb.net/shared/info/1229687199](https://ankiweb.net/shared/info/1229687199)

I got inspired by Derek Banas video:
[https://youtu.be/5urUZUWoTLo](https://youtu.be/5urUZUWoTLo)

