c++ - Which code is more readable? -


This is not a difficult question. I just want to know which of these two C ++ code snippets are better (Readability versus length vs. boiler-platarium ):

option # 1

  unit = square = unit: : Builder (). PositionX (0.0) .positionY (0.0) Controller (Ctrl) .representation (Rep. )build ();   

Option # 2

  Entity: Builder Build; Bld.positionX (0.0) .positionY (0.0) .controller (Ctrl) .representation (delegation); Unit * class = build.bild ();   

I personally prefer the first option, but this can be because I am the author of the code and already know what the code does (it's that person's Which can be confusing code). I like this because it focuses on the unit object on the Entity :: Builder object (and because it is low).

option # 3

  = Class = unit :: builder () .positionX (0.0) .positionY (0.0). Controller (ctrl) .representation (rep) .build ();    

Comments