Hacker News new | past | comments | ask | show | jobs | submit login

I agree wholeheartedly about preemptive TDD: http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-s...

Almost nobody in the Rails community uses foreign key constraints with ActiveRecord. I chafed against it at first, but if you're drinking their validation koolaid, it wouldn't add value in most cases, since the validations can add stronger constraints with better exceptions.




I am not familiar with the validation koolaid (can you summarize it?), but from my experience, you want great constraints in your database because there may be more than one entry point to your database. If your software layers outside the database are your only entry point, then you might be able to do away with constraints...

But also in my experience with multiple developers working on changing the schema and adding new features that result in new data, we are often very glad the database has the constraints in order to keep people honest and not screw up the data during release transitions and even during development. If the software layers below that business logic do a super great job of handling the constraints, then this is not an issue.




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

Search: