Hello! I'd like to get some feedback on a code readability question. I'm not going to state my personal opinion here because I don't want to sway your decision. Here are the two chunks of code. Please note that we use the Laravel framework, and one of the examples uses Laravel helper functions called
data_set and
data_get. (see
https://laravel.com/docs/5.7/helpers#method-data-get)
Here's A)
Code: Select all
data_set($result, '_raw.'.$lnp_service::getName(), data_get($response_payload, '_raw'));
Here's B)
Code: Select all
$lnp_service_name = $lnp_service::getName();
$raw_response_payload = $response_payload['_raw'];
$result["_raw.$lnp_service_name"] = raw_response_payload;
Of course, without context, both might seem a little bit strange. But generally speaking, what's your opinion? Which is easier to read and understand? Please use the polling option to cast your vote.