Live geek or die tryin'

Clean Code vs Efficiency

I have recently submitted my first pull request ever, to the Symfony2 project.

The code I contributed with is a 3 lines long method that simply checks whether a form field is hidden or not. I have no doubt about the usefulness of this method, especially after seeing few people using a similar one (it seems that it was removed).

The pull request was refused because the class in question isn’t supposed to be aware of information we need. I agree with this and approve the good practices and clean code, but in this case we penalize the end user for the sake of doing things the right way.

The purpose of my post is to answer the following question: should efficiency and simplicity be sacrificed for the sake of good practices and clean code?

In my opinion, the answer is no. Especially when we’re dealing with a big project that thousands of people use, and that claims easiness and simplicity.

I’m looking forward to know your opinion about the subject. Feel free to leave a comment.

Programming Motherfucker

Comments