Just started work at this new company as a backend developer and immediately got into a heated argument with one of the front end guys.

Poor guy has been a front end developer for 5 years and doesn't know how to submit a form input as an array.


  • 9
    How something so small can turn into a "heated argument" says more about both of you
  • 1
    that was a little vague, I develop on the frontend only so far and I've gotten spoiled borrowing formspree's server for for submission. Small projects of course, but still I could c how someone might not have come across finding out how to do that and still keep their job if they're a really good designer...

    So the real question is did he just not know or was he trying to tell you how to do it the wrong way? Like how did we find ourselves in an argument over this?
  • 0
    @feroza Good luck!
  • 3
    Form input as an array 🤔... Are taking about sending the form inputs as a JSON object?
  • 4
    Can I get a job there? I know txt, xml and csv! Im good at assembling legos, as well.
  • 1
    @h4xx3r Nope, we're talking about grouping form inputs into an array 😆
  • 1
    @feroza visually or programmatically? 🤔
  • 0
    I'm confused why you'd want to. Isn't it usually done via constructing an object and sending that to the API? Am I missing something?
  • 0
    @M1sf3t @polaroidkidd e.g

    <input name="product[name]">
    <input name="product[price]">

    On the back-end I would directly fill the entire product array into my Product model, since I have a name and price property.
  • 0
    @feroza that html doesn't make sense? Why your input name would have the value of product name? Also I think calling custom key array just array is confusing.
  • 0
    @sSam That is the name of the input, the two inputs would get POSTed to the back-end as an array with title and price items.

    This is standard practice, nothing out of the usual.
  • 0
    @feroza yea I missed the bit about the array. Still why the argument, he was talking over his head an wouldn't back up on it?
  • 0
    @feroza ah, I see. Thank you for clarifying.

    Personally deconstructing a JSON object seems preferable for me. I could map it directly to a POJO or if my backend is on JS, so much the better (that is, if the form always sends the same elements)

    Either way, I learnt something today!
Your Job Suck?
Get a Better Job
Add Comment