Hi,

having null values meaning checking for nulls everywhere, which by itself
adds quite meaningless code all over the place.

I would say mature programmung style is to avoid having nulls whenever
possible, including serialization on disk/wire.

Other thoughts about not having null:

- "I call it my billion-dollar *mistake*. It was the invention of the
*null* reference
in 1965." https://en.m.wikipedia.org/wiki/Tony_Hoare

- *"Null sucks."* -Doug Lea <http://en.wikipedia.org/wiki/Doug_Lea>

- for more background/morivation of avoiding nulls please see
https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained

If we ought to change something - I would suggest eliminating the code that
puts nulls in the objects that should be serilaized.

Hope this helps.

On Wed, Dec 23, 2015, 08:08 임정택 <[email protected]> wrote:

> Hi devs,
>
> It could be a tiny / trivial issue, but I'd love to see our opinions about
> the JSON output.
>
> When we use Map to body in JsonResponse (for REST API), it only represents
> keys which have non-null value to JSON.
> Please refer https://github.com/apache/incubator-zeppelin/pull/562
>
> It seems to be Gson's behavior, optimization of the size of the JSON
> output.
>
> If we prefer all fields to be represented, we can modify it easily. Please
> refer here.
>
> http://stackoverflow.com/questions/3923759/gson-ignoring-map-entries-with-value-null
>
> All Json Responses will be affected, so I'd love to hear that we want null
> objects or not.
> Please share your opinions.
>
> Thanks!
> Jungtaek Lim (HeartSaVioR)
>

Reply via email to