title: Getting an enum from backend and use it as a string in javascript
body: <p>Today I had a rather heathed discussion with a java backend developer. I do the frontend side with jsangular. His rest service sends me an object that includes an enum. I get this as a string and need to show it in an angular grid.</p>
  
  <p>The enums are very self explainable.</p>
  
  <p>Examples what I get:
  <code>Person = {gender: "MAN", position: "IS_EMPLOYED"}</code></p>
  
  <p>In the view I have to show the following:
  <code>man is employed</code></p>
  
  <p>So i solved it in a simple and generic way:
  <code>Person.gender.toLowerCase () + ' ' + Person.position.toLowerCase ().replace ('_', ' ')</code></p>
  
  <p>He found this terrible programming and demanded that I would make a mapper with if else or switch 
  So: <code>If(Person.gender==="MAN") return "man"
  Else if....</code></p>
  
  <p>The label name is always the same as the enum name (only lower case and space instead of underscore)</p>
  
  <p>He went on a rampage that it was bad coding and basically  terrible and a sin against god...</p>
  
  <p>So my question is this bad/good practice (so a b/w story) or rather acceptable and defendable in some cases?</p>
  
  <p>Typed on my phone so I couldn't  put the code examples in the right tags..</p>