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
-
Switch spaces with tabs, and tabs with spaces.
Who wants to read 18000+ lines of code anyway ?
Is death an option ? -
XPoint52718yOne more thing I forgot to mention
That the file I am refactoring
Is the backend of a Windows form
meaning it is using variables from the form
π -
common sense of programming software .... every fu***** function, method, procedure, etc ... that takes more than 4 screens ... must ... and this is not a recommendation..... must be splited in multiple function, classes, etc ...
-
You can say I'm crazy but it could be actually fun and challenging
I mean imagine the satisfaction you'll get when you finish
Oh yea... And be sure to have been paid in advance lol -
XPoint52718y@dontPanic
Ok I wouldn't panic
And I am not...
You got a point there
Here some thing I didn't say yet
That I have 10 days to do it
Yeah I know there is no challenge anymore
But I will challenge my self to finish it in couple of days
π -
burn it with fire. or minify, and then make them refactor it again.
Or bring a hacksaw to work, and while holding it nonchalantly, ask them to do a better job. -
7Raiden8758yIn my work place we have a single file of ~65k LOC with multiple class in it that have cached state (i.e. variables with meaningless names used to store local variables)!
Still, good luck :D -
nocgod17558yDon't do it... If it works, don't touch it.
You'll just get into a journey for which you know the start point but the ending is not visible in the horizon. -
XPoint52718y@nocgod
The thing is I want to refractor the code to be in a separate environment
Where the windows app still use it and run normally
And will be used by another process
So it should be refactored in order to be used both ways -
moort43078yChallenge accepted ( remove all line breaks to make one giant line)
And maybe writing it from scratch is faster then refactoring -
Voxera113888y@zombie01 word of advice.
Unless its relatively small or well covered in unit tests, avoid rewrite.
Many small but important checks or edge cases are probably covered by the code but not documented.
Those are easily missed on a rewrite. -
XPoint52718yEventually,
I checked the code and refactored some main functions(a 1,200 line mainly)
And made it accessible from an API
But I am never to touch that thing again in a 1000 years
π -
@Nosvampire more than 4 screens?? That's a joke right? 50 lines is already an absolute limit. Check out SIG guidelines, they are even much stricter.
-
@CodeMasterAlex i would usually be agree wirh you .... but now that im working in a place where the policy is, declare every var in a line, and in the end of the functions release those vars, set to nothing, etc.. if those functions has an average of 30 vars, that left you nothing to deal with, and get the ideal of 50 lines
-
And this right here is way templates and mother/daughter classes were introduced to C++.
May you survive this! -
CWins48088y@AboMahdi
So, what does it do? What does it contain? ( and what is it's maintainability score in codemetric?) -
XPoint52718y@CWins
Its functionality I can't say sorry
But it is a code of a winform written in c#
The goal to be achieved is to make it work as a logic of a webservice
Meaning refactor the functions in order to make the software run as a rest api when run from cmd, and do all its functionality normally
Same time keeping it working normally if it was run by double click as a form
Related Rants
I am asked to refactor this file in order to make it readable
what do you say guys ?
undefined
whole logic
cs
c#
one file