Elegant code vs ‘just making it work’

I love being clever. I love clever little tricks, clever little bits of code. So when I’m trying to pass several rows of data from a Php script into Javascript so I can use it to put markers on a Google Map. The really clever thing to do would be to create an array of objects in Php, encode them into JSON and then decode the JSON and use the object notation for each instance of the object

class Incident{
public $incidentDate;
public $desc;
public $latitude;
public $longitude;

public function _construct($incidentDate, $desc, $latitude, $longitude){
$this->incidentDate = $incidentDate;
$this->description = $desc;
$this->latitude = $latitude;
$this->longitude = $longitude;
}
}

But can I make it work?? Nope. So I’ve JSON’ed up each array, passed them in and then used the Javascript Array.prototype.map method to populate my arrays and create my oh so clever markers. Now, should I get them to bounce or not……………………

Coding, but which flavour?

I’d say I’m a moderate coder, I don’t seem to have the inspiration that I’ve seen in others; I’ve seen people build themselves a development environment in a morning to achieve something they need to do, but if I put my mind to it and with a fair bit of trial and error, I can achieve. However, it seems my chosen dialect of the last 15 years, Visual Basic, is now as popular as using leeches in medicine. I’ve flirted with Javascript, it genuinely seems an exciting prospect but there is such a plurality of plugins, of standards and of flavours that I always seem to fall back to Php and it’s steady data handling and echo-ing of HTML elements. Guess it’s head down, read up on NPM and React and hope my brain can learn when to use two ‘=’ signs and when to use three!