re: How to name software things, be a good programmer & work solo VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I've recently made a change in our api where we had three data properties where each meant totally different thing. 🤔
 

Are they now named data1 , data2 and data3 ? 😛

 

No! : ) It is paginated research data and JSON previously looked like this:

{
    "page": 1,
    "size": 3,
    "total": 3,
    "data": [
        {
            "countryId": 1,
            "categoryId": 2,
            "data": [
                { "year": 2012, "data": 123.45 },
                { "year": 2013, "data": 123.45 },
                { "year": 2014, "data": 123.45 },
                { "year": 2015, "data": 123.45 },
                { "year": 2016, "data": 123.45 },
                { "year": 2017, "data": 123.45 }
            ]
        }
    ]
}

Now it's been renamed to be as follows, which is 1000 times better!

{
    "page": 1,
    "size": 3,
    "total": 3,
    "results": [
        {
            "countryId": 1,
            "categoryId": 2,
            "timeSeries": [
                { "year": 2012, "value": 123.45 },
                { "year": 2013, "value": 123.45 },
                { "year": 2014, "value": 123.45 },
                { "year": 2015, "value": 123.45 },
                { "year": 2016, "value": 123.45 },
                { "year": 2017, "value": 123.45 }
            ]
        }
    ]
}
code of conduct - report abuse