Skip to content

Deleted unused code and parameters in PhotoViewer and MediaController #1410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

artjimlop
Copy link

Yesterday, I found lot of commented code at PhotoViewer and MediaController so I decided help a little with it. I've just removed all commented code I've seen and unused parameters at methods declarations.
The main reason is YAGNI: you ain't gonna need it, and it only increases complexity in the code.
The reason why I've deleted commented code lines can be found in this commit: a369df5

Hope it helps!

arturet added 2 commits May 13, 2016 11:23
Here are some reasons why unused code should be removed:

For anyone new working on a project, they not only have to understand the working code, they have to understand unused material also. This is wasted time and creates confusion.

There is a danger that at sometime someone will make a change which inadvertently involve the 'dormant' code and can introduce bugs. I know it's happened on projects I've worked on.

The maintenance of any code is an administrative burden. By preserving old redundant code that burden is increased. For example, merging changes in the main branch becomes harder because there is more code to work through and more possibility to make a mistake.

What happens over time is that more and more old unused code is added to the codebase. This increases the confusion, potential misunderstanding and administrative overhead.

The chances that the unused code will ever be used again is very unlikely. With time that possibility of re-use diminishes. If code to be removed and is considered important enough then the code can be branched off and documented.

Any personal feelings that a coder may have about code they may have worked hard on are understandable. But part of being professional requires that those thoughts have to put to one side for the better good. Time stands for no-one and there is no place for preserving historical code in a working codebase.
Just deleted unused parameters in method declarations and more commented code I have found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants