Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Welcome to devrant! here is your first upvote...
rewrite from scratch, is better then tring to reuse the old code. But I feel your pain. -
eeee31227y@AlinaWithAFace the object oriented pattern 'facade' is nice for a single application (so not an entire architecture). It's basically a fancy word for: interfaces everywhere.
It's useful to refactoring shitty code bases, for example:
Consider some shitty implementation of some ORM class. First, build a facade with the specifications needed in the rest of the application. Then adapt the bad situation to work behind the facade and put the facade to work. Then, start building the new situation behind the facade, separated from the old situation. Write new code, classes or whatever, or reuse parts of the bad code. Just make sure you can test your facade and therefore your new implementation. Last step once done: use the new facade implementation by flipping the switch from old to new situation. Boom, bad old code gone in one or a few lines of code! -
eeee31227yMore on the facade pattern:
https://sourcemaking.com/design_pat...
With some fantasy, it can be extrapolated to a system architecture as well.
Related Rants
-
devmonster84My friend said an intern designed this UI for an internal site. No. Just... no
-
Korvax31Italian chef: We have the best spaghetti in the world PHP developer: I doubt that
-
adnanh86Got assigned an intern to mentor him, with an explicit order not to do any of the legwork for him. We start o...
Almost 3 weeks back I joined a company as a React developer. For a week I had nothing to work on as they were already working on few projects.
So my senior asked me to take up a project(not yet live) which was developed by 2 interns, as the frontend guy's internship was about to end in 4 days I have to take over the front-end role.
So I talked to that guy for next 2 days regarding all the project scope, codebase and whatnot. But still not entirely convinced. As i got the repo access, I began to check the codes. God !! It was all spaghetti code. I was damn frustrated. And still I am.
This whole week I am trying to do the refactoring as much as I can, I completely lost interest.
I cannot blame the intern guy, he is smart and tried to do the best he could, as he didn't know about the company standards. Maybe I was too the same kind back then. Now he is gone and I am stuck building components over that code.
Bonus: He used some old react boilerplate.
-_-
rant
react
spaghetti code
reactjs
refactoring nightmare
refactoring
intern