jcommon icon indicating copy to clipboard operation
jcommon copied to clipboard

Changes from clean code first part

Open adamtnagy opened this issue 7 years ago • 3 comments

Dear David,

I was studying the book Clean Code and it has a section where the class SerialDate in Jcommon library is refactored. It is horrible to follow a refactoring process in a book format and I could not find those changes online so I decided to do them myself. I think it is worthwile to have these changes in this repository.

It took quite some time to make the commits as small and obvious as possible, but I am finished with SerialDateTest completely and fixed some issues in the SerialDate class. It should be straightforward from the commit messages where I diverged from the book and followed conventions of the existing code or my taste.

I saw that this Jcommon library is to be retired that is why I selected this as a playground.

I would say that I am one third finished with the whole I have in mind. I plan to finish the refactoring of the SerialDate class following the book as close as possible. (Then Make It Right section, page 270.) Then maybe I have my own ideas both to the class and its tests. I have doubts though that those are relevant in the sense to be able to follow the book's ideas. Hmmm.


Anyway, here is a pull request with the changes so far.

If you find these useful I would be happy to help migrating these to the development branch of JFreeChart - Future State Edition.


I am not sure how the copyrights work in your country and in this particular case, but if you are willing to merge this, then I would suggest to contact the author/publisher for a permit. It would collide with the boyscouting rule not to allow these changes in so it must go smooth. ;-) I also added Robert C. Martin as a contributor to the class and I mention the book in the commit messages too. He is also quite active on Github, probably easy to find. (In case of course if you don't already know each other.)


Finally I would like to mention that I made these changes for educational purposes so it is possible to follow the book. I am sure few people bother to look the source up online, and most of those did turned away when they started to compare it with a book format.

Although It has a nostalgic feeling to keep 4-6 fingers simultaneously between the pages in the book and turn pages like crazy sometimes pressing unwanted keys on the keyboard with the book, but... well it is not efficient in the 21st century anymore. :-)

I hope I can help/inspire other developers in their studies with these changes.

Best regards, Ádám T. Nagy

adamtnagy avatar Oct 10 '17 18:10 adamtnagy

Bump.

adamtnagy avatar Feb 15 '19 13:02 adamtnagy

I think this is great! Why has this not been checked out by anyone? :D

frle10 avatar Sep 23 '23 09:09 frle10

6 years... Time flies, I still remember the Saturday mornings dealing with this, haha.

Maybe I wasn't pushy enough. Probably the owner did not see the mail from this pull request or he has better things to do.

Or he simply hates that book and the author. ;-)

adamtnagy avatar Oct 04 '23 06:10 adamtnagy