Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I can't think of a reason to not send in string arrays.</p> </blockquote> <p>A string is a single entity. Your colleague uses the string "object" (an object in the sense of a variable or entity) to make it carry information, a very little form of a domains specific language that is.</p> <p>But as it already shows, it's just overhead and not necessary. Probably that guy is just lazy to type and thinks that is more cool. What actually more cool is, is to just upgrade PHP and use the new array notation. It's short as well and it carries more information than a string which needs a parser (here explode with the separation character) first:</p> <pre><code>explode("|", "value1|value2|value3"); array("value1", "value2", "value3"); ["value1", "value2", "value3"]; </code></pre> <p>If you want an opinion how serious your colleague is: He is playing. Playing is okay, but if he needs to do power-play to show that he can suppress that as a style onto a shared codebase, slap onto his fingers. That's stupid. If you need an array, pass an array.</p> <p>This is not something like let's say regular expressions. This is just some self-mockery of your colleague introducing problems into the codebase. Only because something is possible does not mean that it is better.</p> <blockquote> <p>I can't think of a reason to not send in string arrays.</p> </blockquote> <p>Well, some probable reasons I can imagine:</p> <ul> <li>Others just want to show they know different to you <em>and</em> have the power to convince everytbody else in the project (social problem)</li> <li>You can't accept that your standing in the team is too low, that you can not even make reasonable arguments to convince everybody else and you run here to moan because you hope you find to get more strength instead of escalating responsively @ your team (social problem)</li> <li>That guy is just a bastard and want to introduce secret complexity so that only he can edit and change the code (career management, can be a sign of a social problem as well).</li> </ul> <p>Please don't take these comments too seriously ;) It's okay you ask, but there is not much of an answer, because this smells fishy because there can be reasons that something like that can be useful (albeit I doubt that, because with some little OOP things start to look really differently here). So it always depends, but try to keep the code you edit simple to edit and don't add much magic. One could consider that string as a magic array.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload