Last active
March 23, 2022 06:58
-
-
Save jaskirat1208/d9a3d92a42d8d5bf93076523da8b1fed to your computer and use it in GitHub Desktop.
Parsing CSV file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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