So many times on this site I see people trying to do things like this :
I don't think that this is some sort of pattern that people naturally fall into. There must be some sort of tutorial or learning material out there that is showing this, otherwise we wouldn't see it so much. What I'm asking is, am I making too big a deal of this or is this a really bad practice?
MYAPP.constants = <php echo json_encode($constants) ?>;
also is it OK to directly encode data you plan to use in a library
ChartLibrary.datapoints = <php echo json_encode($chartData) ?>;
or should we make an AJAX call every time?