What is the quickest way to write code?

András Tóth - Nov 15 '20 - - Dev Community

In the many development teams I was working in was a period when some manager urged "Folks, now it is not the time to write pretty code, let's get the simplest code as fast as possible out just to test if customers need this!".

No need to overcomplicate it, don't cook anything fancy, just feed the customers! Just like you throw together potato, bacon, eggs and onion in a pan and that's it! (Result is parasztreggeli 👆 - a food you won't hear about).

What they mean is to write code poorly and only fixing it when the feature proves its existence. They usually reason about it as justified technical debt, but to quote George Fairbanks quoting Ward Cunningham:

“A lot of bloggers at least have explained the debt metaphor and confused it, I think, with the idea that you could write code poorly with the intention of doing a good job later and thinking that that was the primary source of debt.”

In my own experience I find it hard to write code poorly. When I try not to think in advance I usually lose myself in a web of half-baked, contradictory code. Then I get frustrated, delete some it and start writing pretty code, then I remember, "Hey, this is exactly what we are not supposed to do!", then I am trying to hack it again.

The result: bad code that took I think as much as or more time than writing normally with a horrible mood as a side effect.

In other words I don't have the expertise to understand problems enough not to shoot myself in the foot, but not enough to write "pretty code".

Discussion: What is the quickest way to write code?

What are you doing in these circumstances? There is a huge pressure on the development team, it was promised (without them) to the higher management, that feature X will go in beta testing by this and this date and you can't write pretty code?

Is there a trick to this so I can actually write throwaway code faster than writing average code?

Or at least let me know if I am the only one struggling with this 😳😅.

The only time I managed this requirement working was when the task at hand was small and specific enough that you can just copy-paste a new version of your code, modify it and see how it performs as an A/B test.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .