DEV Community

loading...

Discussion on: Stop Using "data" as a Variable Name

Collapse
etienneburdet profile image
Etienne Burdet

req and res are two good candidates too! Especially when you start caching, fetching from backend and api… resFromServ, resFromCache, resFromNetwork etc. make things much easier to understand!

Collapse
vitalcog profile image
Chad Windham

I really like this example, good call out😉

Collapse
darkain profile image
Vincent Milum Jr

It is until it isn't. This is one of the large problem with the suggestion to use shorthands, is they mean different things to different people.

Coming from a Win32 background, "res" is a "resource", such as icons, images, etc. They're non-code elements compiled into a file exe file.

Its easy to get keyword conflictions between people when shortening them like this.