Or get both? As a research mathematician, my iPad Pro is for drawing mathematics and reading papers, to get me away from a 32" screen when I'm not coding. The MacBook Air is for when I can't be at my 32" screen.
Coding intricate data structures is like teaching the computer chess. It helps if you understand chess. I can't imagine understanding what I want my code to do, without an involved process of drawing everything repeatedly in many variations.
Someday there will be an iPad drawing editor like Emacs, arbitrarily scriptable using further drawings, never putting down the Apple Pencil. We're still at the earliest stages of "word processing" technical art; this evolution is still to come.