Most code bases are littered with strings. Strings contain URLs, texts for labels, whole JSON documents. They are used as IDs for entities. They represent domain concepts like names and telephone numbers. They can even be interpreted as code. Strings are incredibly flexible. In fact, all of the use cases just mentioned are interchangable in the eyes of the compiler! It doesn't matter! You're free to try to post a URL as payload to an HTTP request to your JSON document instead of the other way around. You can try to compile a phone number into a .NET assembly. But of course you rarely want to exercise this freedom. You want to keep the phone numbers separate from the SQL queries. This is what types are for. We can tag the values to make sure we don't mix them up. In addition, types can be used to make any assumptions we might have about valid and invalid values explicit. Sometimes these assumptions can be formalized as patterns or grammars, other times they are tacit and vague. In either case, it is time to take a serious talk about all the strings in our programs and learn to handle them better. Check out more of our featured speakers and talks at https://ndcconferences.com/ https://ndcoslo.com/
Get notified about new features and conference additions.