WesleyyC / Image-Editor

A command line image editor written in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactoring in Editor...

SerinaTan opened this issue · comments

I read through the code base and found some possible refactoring we might be able to do.

-switch statement for command selection instead of a giant else-if statement?
-duplicate code for im1 null checking. How about pulling it up somehow and reject any comand other than load when the image is null. Still thinking about it.

I can do it on my own branch and make a pull request. Then you can review my code and let me know if you disagree with anything and we can fix it.

Agree. The editor is a homework version I wrote in a rush and we definitely should refactor the code.

I just make some change on the else-if part, so let me refactor the switch and you can do the other part.

Refer to #6 for refactoring the exceptions and error handling. Recent commit resolved the refactoring tasks listed above. Closing.