re: Compact or Verbose Codestyle? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I'm not a js developer, but I would use this middle ground (hoping it actually does the same thing) : const get = (store, key) => { if (!...
 

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.

code of conduct - report abuse