Code readability question. Which is better, A or B?

Which do you think is easier to read? A or B?

  • A

    Votes: 0 0.0%
  • B

    Votes: 0 0.0%

  • Total voters
    0
  • Poll closed .
A

Anonymous

Guest
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:
data_set($result, '_raw.'.$lnp_service::getName(), data_get($response_payload, '_raw'));

Here's B)
Code:
$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.
 
Back
Top