• 0

Data Dictionary vs Object


Question

I have two developers, one web and one mobile.  When looking at the following data, my web developer calls it an "object" and my mobile developer calls it a "dictionary".  They argue among themselves as to what it's called, and I can't chime in as I've never heard of the term "dictionary" before.  Are they both right, or is there a difference between the two?

 

Here's my JSON object:

 

{
	"votes":{
		"republicans":		46.09,
		"democratics":		48.18,
		"libertarians":		3.28,
		"greens":		1.07,
		"independents":		0.54,
		"others":		0.84
	}
}

 

Link to comment
https://www.neowin.net/forum/topic/1378638-data-dictionary-vs-object/
Share on other sites

8 answers to this question

Recommended Posts

  • 0

This is pretty easy to clear up. A dictionary is an object. So I guess they can both be right. Web is calling it an object most likely due to working with JavaScript, would be my guess. Mobile developer is being more specific. A dictionary is just an object that contains key-value pairs. 

  • 0
3 minutes ago, Brian Miller said:

Thanks. So they're actually is the difference. What is the difference?

A dictionary is an object but not all objects are dictionaries. 

 

An object can be a collection of dictionaries, for example. Or a collection of Lists. Or a button. Etc. 

  • 0

Whether what you posted is an object or a dictionary depends entirely on what language and libraries the developer is using and how they intend to load/parse it.

 

So they both wrong.

  • 0

It's an Object, but more specifically it's a Dictionary Object. It's also an Associate Array, a Map, and a Symbol Table.

 

Don't get caught up on semantics. It's an object represented by key/value pairs and if you keep the naming convention within context most people will know what you mean. I personally call it an Object when I'm writing JavaScript, an Associative Array when I'm writing PHP, and a Dictionary when writing Python. I call it "JSON" when it's JSON :/

  • Like 2
  • 0
1 minute ago, astropheed said:

It's an Object, but more specifically it's a Dictionary Object. It's also an Associate Array, a Map, and a Symbol Table.

 

Don't get caught up on semantics. It's an object represented by key/value pairs and if you keep the naming convention within context most people will know what you mean. I personally call it an object when I'm writing JavaScript and a Dictionary when writing Python.

I think you probably said it more eloquently than I did. 

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.