DEV Community

Discussion on: Compact or Verbose Codestyle?

Collapse
 
f1lt3r profile image
F1LT3R • Edited

One thing you get from The verbosity of the ending variables, is that you don't have to break apart the line to debug the code. You could identify whether your bug resides in the JSON parse or the store getter without changing any lines of code.

I think generally, developers are more comfortable compacting things we understand well, especially when they are stable and behave in expected ways (like JSON.parse and window.localStorage).

I believe I observe people compacting calls to their own code more often, (because they understand it well), and use more verbosity calling their peers' code (because they understand it less).

Personally I lean more towards universal verbosity for the ability to debug without changing lines of code. In my opinion, this also fosters self documenting code, especially when calling internal code and not common environment/library APIs.