I am not sure I follow your arguments here. ADTs are stuffs like Customer, 
Address, Invoice, etc. and I don't think they should be bolted into the 
language. They are abstract types you make your own so that you can 
describe your data in terms of the problem you are trying to solve. They 
are essentially your own responsibility to define.

All I tried to say earlier is that since you needed more than a number 
(because you want to include null as one of the possible values), it seems 
to me you are better off defining your own data type. If you are doing 
JSON, you can define something like JSONNumber. It is more descriptive than 
"int?" and easier to maintain in the long run.

On Monday, August 21, 2017 at 8:24:26 PM UTC+7, Tong Sun wrote:

>
>
> On Monday, August 21, 2017 at 3:44:41 AM UTC-4, Henry wrote:
>
> In my opinion, if you need a nullable type, you're entering a domain 
>> problem. You are better off creating your own ADT (abstract data type) with 
>> more descriptive names rather than "int?" or "float?".
>
>
> When we are talking about ADT, we are talking about extending the language 
> itself. So I agree that it is a language problem, but do not agree it is a 
> *domain 
> only problem*, which is a polite way of saying, "that's your own problem, 
> deal it yourself", because we've seen so many replies with so many 
> suggestions and recommendations, i.e., just like what I suspected, you 
> will see different people doing different things, which will be just 
> like different people using different string implementation in C, and we 
> end up with many C string libraries and implementations that are 
> incompatible with each other.
>
> Again, whenever we are dealing with data, this (null situation) is 
> inevitable. You are not suffering from the problem today do not mean that 
> other people are not suffering, or you will never ever meet with it. 
> I.e., in my view, it should be considered as part of the future Go. 
>
> I do agree that there should be *more descriptive names rather than 
> "int?" or "float?"*. That's why I only said "*like*" "int?", because 
> there is no such name so far. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to