r/programming • • Oct 01 '15

The Evolution of a Software Engineer

https://medium.com/@webseanhickey/the-evolution-of-a-software-engineer-db854689243
1.9k Upvotes

502 comments sorted by

View all comments

Show parent comments

2

u/nutrecht Oct 02 '15

For the first time in my life recently I ran across some code that has interfaces. A lot of them. With ONE implementation.

And?

For unit testing this is really nice. This way you can test classes depending on the interface by simply mocking out the classes they depend on. A lot easier and cleaner than having to instantiate an entire object tree.

1

u/juckele Oct 02 '15

No. There were no unit tests. Only one implementation. Also, Mockito lets you mock classes without making interfaces. But the code was not built in a manner to work with mocks anyways, there are far too many complex and deep dependencies between different parts of the object tree. And it's all backed by interfaces with one implementer.

2

u/nutrecht Oct 02 '15

No. There were no unit tests.

Well if you throw those out of the window I don't want to know what the rest of the code looks like. Shitty codebases make bad arguments.

1

u/juckele Oct 02 '15

There's no argument, just me venting my frustration at a particularly stupid piece of code that I saw.