# Enemy of the State

DevFeed: [Enemy of the State](<https://devfeed.tech/articles/enemy-of-the-state-40623.md>)

Original publisher: [Read original article](<https://eviltrout.com/blog/2013-10-05-enemy-of-the-state/>)

Published: 2013-10-05T00:00:00Z

Content type: opinion

Language: en

Sources: [Robin Ward](<https://devfeed.tech/sources/robin-ward.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [test](<https://devfeed.tech/topics/test.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Rails](<https://devfeed.tech/topics/rails.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [activerecord](<https://devfeed.tech/tags/activerecord.md>), [code](<https://devfeed.tech/tags/code.md>), [database](<https://devfeed.tech/tags/database.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [rails](<https://devfeed.tech/tags/rails.md>), [test](<https://devfeed.tech/tags/test.md>)

## AI overview

The article argues that developers should make code resilient to misuse and forgotten implementation details. It emphasizes comprehensive tests, carefully designed functions, and protecting against inconsistent object state. Using ActiveRecord as an example, it explains that selecting only needed database columns can reduce data transfer and deserialization overhead but may produce partially populated objects that cause bugs.

## Source excerpt

I learned very quickly while working on a large open source project is that it is important to make my code hard to break. The primary line of defense for this is a comprehensive test suite, but I think it's also very important to create functions that are easy to use and difficult to damage. I find I even code this way on personal projects that will never be released. Even if you never work on a team with other developers, there is a good chance you will forget a lot of implementation details of the code that you aren't actively working on. You need to protect your code from yourself!