I'm sure it's common sense knowledge, but I admit this article in the sense of self-discipline because I've done it.
--You can't leave a space behind the backspace. --In the first place, the description that divides into multiple lines with backspace is not recommended.
I modified the code written by others in the git project managed by others. The modification is a simple thing of adding Where in the SQL statement.
I modified the code as follows.
Before correction
...
sql = "SELECT "\
" user.id ,"\
" user.name "\
"FROM "\
" user "\
"WHERE "\
" user.age >= 20 "\
" AND user.sex == 'M' "
c.execute(sql)
...
Revised
...
sql = "SELECT "\
" user.id ,"\
" user.name "\
"FROM "\
" user "\
"WHERE "\
" user.age >= 20 "\
" user.age <= 60 "\␣␣␣␣␣␣␣␣
" AND user.sex == 'M' "
c.execute(sql)
...
A few weeks after uploading the code to git. Around the time when I forgot to apply it to the production after passing reviews and verifications. The customer told me that the place where I was pulling SQL did not seem to work. After investigating, I got this error.
SyntaxError: EOL while scanning string literal
Cant Believe It.
Actually, this code was a file with separate management for the production environment and the test environment. ← This structure itself is not good However, it's not the code I manage, so I modified the code for the test environment as I was told. After passing the developer test, copy and submit the modified code to the production source. At that time, it seems that a space was mixed in at the end.
Comprehensive verification was carried out for the corrected part and passed. The test code was also used at this time. Since there is a space only in the production code, it is released undetected. And it happened when the customer used it.
There are many things I want to say in the organizational development flow,
For the time being, implement the following as a personal measure
I can't do anything ...
Recommended Posts