Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

why.


In this case, bragging about the steps taken to produce a strictly worse solution because the dev didn't want to learn what should be a basic dev skill.

That said, criticizing all Python developers with this brush was very unfair.


What happens when the program crashes in the middle of writing the data to disk? Now all the data you wanted to store is corrupted.


You see, before you overwrite the actual file with the new content, you should wrote the new content in a separate temporary file first. That way, when your app detect corrupted files on startup due to power loss, you can program your app to look for the temporary files and write them to the main files if they pass your data validation.

... and before long, you'll reinvent database servers but shittier.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: