I have an application with some code smells. I know there is code smells but I don’t know how to resolve them. I will be very happy if someone can look at my code and check for problems and solutions. In exchange, I will do it too.
You can find the repo of my application here : https://github.com/GCorbel/lescollectionneursassocies
This is an example :
I have a controller which is responsible to show a form with order information (credit card an product information). As you can see, there is a two form objects, one for services and one for paintings. Also, there is an ordre creator which is responsible to save the form, do the payment and send a notification. I made a creator because I think there is too much work for the controller.
There is some elements I did not like. First, I must to create forms in the controller because I need it in views. I need to pass it in argument to the creator. I think it’s a bad spaghetti code.
Also, I have some depedent objects which are responsible to do only one thing, like this one. It’s good to have classes with single responsabilities but I think there is too much classes with no apparent structures.
When I look screencasts of the thoughtbot’s team, they do awsome thinks very easily. I think I am 10 times slower and I produce a code 10 times worse. I hope I will be a ruby ninja one day.
Thanks for your help!