Good to write flat code or bad? Any examples of flat Java code? Can anyone know why he is called that?

  • There is a "any-language" label. - maestro
  • @maestro well, I am interested in Java - Anton Sorokin
  • Can you indicate where you came across the use of this term and in what context? - default locale
  • @defaultlocale toster.ru/q/569396 - Anton Sorokin

1 answer 1

A flat or linear code is a code in which operations are performed sequentially without nesting of structures, for example:

a.soSmth(1, 2, 3); b = a.clone(); b.doSmth(4, 5, 6); c.setX(311); 
  • 3
    When using if the code automatically becomes non-flat? - Grundy
  • @Grundy like yes? - Qwertiy