Skip to content

Instantly share code, notes, and snippets.

@jaskirat1208
Last active March 23, 2022 06:58
Show Gist options
  • Save jaskirat1208/d9a3d92a42d8d5bf93076523da8b1fed to your computer and use it in GitHub Desktop.
Save jaskirat1208/d9a3d92a42d8d5bf93076523da8b1fed to your computer and use it in GitHub Desktop.
Parsing CSV file
/* Bad practice */
address = col[5] + col[6] + col[7]
/* Clean code. Preferable and a lot easier to read by the team
as well as yourself when you have spent time away from the project. */
HOME_IDX = 5
STREET_IDX = 6
LANDMARK_IDX = 7
address = col[HOME_IDX] + col[STREET_IDX] + col[LANDMARK_IDX]
/* Now, comparing these two codes, a small question, which candidate would you like to hire?
The one who writes the first or the one who writes the second one? */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment