top | item 42054641

(no title)

1 points| jarirajari | 1 year ago

discuss

order

jarirajari|1 year ago

One of the fundamental problems in programming is the lack of well-defined and higher-level data types. The types that work out-of-the box similar to libraries. A big chunk of programming is about how to map real world concepts to data types and how to map types to other types. Still, often programmers use primitive data types like strings, ints, etc. for representing real-world concepts. Why don't we start delivering type-first libraries which focus on well-defined and well tested data types, so that you don't need to re-invent them every time. And make to them free of errors and easy to share (bundles with versions). Notoriously difficult data include monetary and money units, and how many times we need to ask chatgpt and stackoverflow people what is the correct way to validate phone numbers, urls, etc. before we start focusing on data types and validation? And before anyone has the chance I want to say that indeed libraries expose data types which you can use, but in that case a library should separate the data types from methods and depend on the data types (library).