Hacker News new | past | comments | ask | show | jobs | submit login

about removing quotes from strings, I tought about it, and I think as long as some other display property is different (to differentiate the number 4 from the string "4") and something more than color to avoid causing trouble to colorblind people I think it's a good idea.

the array indices I was thinking on having it as an option, I would like 'something' to make them standout as lists even when no index is displayed, any idea?

will open issues for both:

* https://github.com/marianoguerra/json.human.js/issues/5

* https://github.com/marianoguerra/json.human.js/issues/6




> about removing quotes from strings, I tought about it, and I think as long as some other display property is different (to differentiate the number 4 from the string "4")

The problem is that for most people the technical and subtle difference between 4 and "4" does not have any meaning except that "the system" apparently differentiates for some reason. Subsequently they will (implicitly) attach some meaning to the difference, but, as they don't have a background in information, their understanding probably does not correspond with the reasons why you implemented this difference. For example, they could think that "4" means "about four", or "four is important", or "four", or whatever.

Unless the difference between "4" and 4 is or becomes relevant to the user, the user should be prevented to have to differentiate between the two. And "because the system asks for it" doesn't really make it relevant to most users.

I do understand the problem, of course. Without some function attaching meaning to the JSON fields, a program cannot know if a 4 has to be 4 or "4". That means you have to make a rule one way or the other. The question you should ask yourself is: which one is best in your situation given the audience you target. Possible rules:

- a numerical number on its own, however written, is interpreted as 4 instead of "4". So, "4", " 4", 4, " 4 " will all be interpreted as 4. - all primitive fields are all strings. The program has to attach meaning to them. So, 4, "4", " 4", are all "4" - there is a difference between "4" and 4. If you want the number, use 4, if you want the text four written in numericals, use "4".


Thanks for the quick response. I guess I should have opened issues myself, but I have some irrational fear about using github features.

>something more than color to avoid causing trouble to colorblind people I think it's a good idea.

I think what you have is decent. Bold for numbers. Italics for literals.

Making arrays stand out is tough. Perhaps you could do some zebra striping on arrays. Or use bullets outside of each array value that mimics a list?


someone in the comments here said that zebra stripes are a bad practice and linked to some resources about that, so guess zebra stripes won't do (I'm also using them for objects, so they won't stand out as lists but as collections of things together with objects)

someone pointed out on an issue that empty lists and empty objects can't be differentiated, so a solution that handles both would be cool.

question: why the github fear? :)


Without derailing this thread, tldr: social anxiety around contributing to OSS. That sounds pretty dumb I know.


Re: list styling - you can make the whole list a different colour and also "extract" it with different borders. Consider indenting items more visibly - either more leading space or a more visual left border (e.g. something that looks like [ or { )


A icon prefix for each item. For example, taking from bootstrap glyphicons, icon-comment for strings, icon-calculator for numbers, and icon-check for booleans.


They already stand out as a list by the fact that they contain multiple items.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: