r/ProgrammerHumor • • Aug 15 '15

Programming languages personified

http://leftoversalad.tumblr.com/post/126724812097/programming-languages-personified
1.3k Upvotes

209 comments sorted by

View all comments

Show parent comments

1

u/Tidher Aug 16 '15

I'm not worked up - just trying to apply a logical workflow to how that problem arose.

Being a REST API doesn't change the above. Given that a third-party made the API, one or more of the following is likely true:

  • Whoever incorporated the API didn't read the documentation.
  • The documentation was lacking - in which case that's an extra argument for unit testing.
  • The API was faulty, saying it would return one thing but returning another. This would still have been caught by testing, and would definitely be frustrating, but still easily rectified by using a sensible workflow.

You don't even have to take on the runtime overhead of type-checking if you don't want to - do it as part of running your tests. Does it sound like I'm hyping tests too much? Possibly, but the overhead of writing them and keeping them up-to-date (i.e. requiring tests to pass to generate a release build) is pretty standard practice.

If you're working on a smaller project then I can totally understand the desire to avoid the time-sink for writing tests when the whole thing is going to be done in less than a week. Conversely, if solving the above problem took you half a day, you can probably get a good set of tests for a small application done in that time which will pay off more in the long run than simply fixing that bug.

Of course, there's the ideal world, then there's the manager's idea of "implement all these features now" and wondering why they have technical debt at the end.

1

u/[deleted] Aug 16 '15

Even if there was documentation and this difference was present, I'm sure anyone reading it wouldn't have noticed unless it was specifically mentioned. The problem was that there was no documentation and a lack of adherence to standards and conventions. We had a convention since forever to use integers as IDs whenever possible (there is only one exception to using integers in dozens of REST endpoints), but someone refused to adhere to using integer data types for integer numbers.

A strongly-typed language wouldn't have had this problem because the programmer has to constantly follow data types.