About offloading work to the client

I have been working on an open source Discord client for a while, it uses the official REST API and tries to reproduce the features of the original electron client. When I got to the point where I could actually chat, one of the first things I tried, was sending emojis. Well, didn’t quite work out. When I entered emoji-sequences like :cry: or :sunglasses:, all I got back was plaintext. But why is that, if the original client converts all those sequences into actual Unicode characters? This is simply due to the fact, that in order to implement this feature, Discord uses client-sided business logic. So before sending the message to the server, for example:

Read More

But we have full test coverage!

I often see people claiming that their tests are as good as they could get, since they have full (100%) test coverage. And obviously 100% coverage is as good as it could possibly get. Or is it not? You guessed it, coverage isn’t everything, The quality of the tests plays a big role as well.

Read More

Think twice before using varargs

Varargs, which is short for variadic arguments, are a pretty cool thing. They allow your functions to take from 0 to n arguments, the amount of possible function arguments might differ from language to language though. Most of you have probably already used a function which makes use of varargs. Throughout this blog post, I am gonna use Java for examples.

Read More