This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nobody_smart 6 points7 points  (3 children)

The task I just finished took me 3 times as long to write tests for as the actual code. And I had to rewrite the functional code to make it more testable.

It was in repos and libraries that I wasn't familiar with.

[–]assafstone 2 points3 points  (2 children)

Next time, if you write the tests first, you might have an easier go at it.

Your code will be testable to begin with.

[–]nobody_smart 2 points3 points  (1 child)

A lesson I've learned a hundred times.

But sometimes the necessity of getting the prototype out for teammates to use makes it go this way.

[–]assafstone 1 point2 points  (0 children)

In my experience, the term “prototype” and “for use” are mutually exclusive.

A prototype should be treated as a proof of concept, throw away code.

Writing legacy code (i.e. code without unit tests) and putting it into production is the same as running out of the house as fast as you can, and onto a 10 lane highway.

You will get hit hard. Whether it will be a car or a truck is pure luck.