thepsion5 said:
The goal that I post some "ugly" Laravel code and we, as a community, discuss the best ways to go about cleaning it up, making it more readable, testable, etc.
I'm going to request you make this open to not just you posting, but other members. Otherwise it kinda feels like you're pretty much just trying to get people to refactor your code for free.
machuga said:
thepsion5 said:
The goal that I post some "ugly" Laravel code and we, as a community, discuss the best ways to go about cleaning it up, making it more readable, testable, etc.
I'm going to request you make this open to not just you posting, but other members. Otherwise it kinda feels like you're pretty much just trying to get people to refactor your code for free.
I assumed a section called "Submission Rules" would imply that the whole idea is to accept other people's code. ;)
Why just the controller file? Push the entire framework with migrations, seeds, routes, models... How can I test if my refactors actually work with just this?
And that way everyone would have the same starting point to work off of. Make a simple working example with all the code stuffed in a controller or two.
pogachar said:
Why just the controller file? Push the entire framework with migrations, seeds, routes, models... How can I test if my refactors actually work with just this?
And that way everyone would have the same starting point to work off of. Make a simple working example with all the code stuffed in a controller or two.
Two reasons:
I didn't want to increase the barrier of entry by requiring people to install the entire framework, run migrations, etc
I assumed people would be far less comfortable submitting their entire codebase as opposed to a few files. Where I've worked, at least, that would be grounds for getting fired as all our code is proprietary
I've just submitted my solution, and would welcome discussion/comment/criticism. You can see it here: https://github.com/thepsion5/refactoring-exercise-1/tree/author-solution
The other submitted solutions (well, solution...) can be found here: https://github.com/thepsion5/refactoring-exercise-1/pulls
How do you all believe those particular solutions measure up? What would you do instead?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community