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
Search - "refactoring"
-
Spend half an hour finding music to listen to while I code; Pause it after 30 seconds to concentrate on refactoring. Stays paused for rest of day.
Really getting the most out of those expensive new headphones.35 -
Dear diary,
Today I sold my soul... I hacked my way around a bug instead of refactoring. It was a moment of weakness... I... I was not given enough time....
I am sorry...7 -
Sad story about refactoring.
Programmer: I cleaned up the codes, extract reusable methods, reduced repetitive code and improve overall readability and maintainability.
Manager: why the page still display the same.
Programmer: ...7 -
Manager: Why are you always refactoring?
Me: Refactoring keeps the codebase's entropy in check :)
Manager: mind blown!!3 -
"Can you work on this ticket? It's kind of urgent."
-- "OK"
"And could you please not refactor? Just get this done."
-- "Why? What's the issue?"
"The logic is complex. We should not break it."
-- "Erm, that's what the tests are for. So yes, if the need arises, I'll refactor. The tests are my guidelines if the logic breaks or not."
There's a reason we create tests. So let's not hinder code base improvements by some random fear that stuff might break.
If breaks due to refactoring, we'll fix it by adding a valid test case during and then fixing the bug.
If my refactoring does not break the tests, I'll assume the code base is stable.
If your code is untested, then we have a complete different problem.3 -
Just coded for ~14h straight. Started doing some super heavy code cleanup and refactoring. Almost cried when I saw my code from the past.
Maybe it's time to call it a day...4 -
"Any fool can write code that a computer can understand.
Good programmers write code that humans can understand."
— Martin Fowler,
Refactoring: Improving the Design of Existing Code6 -
Refactored a legacy source file and reduced it from 2.8k lines to 300 lines.
Mixed feelings: happy that it is much simpler now and sad that my current project team members never go back to delete unused code.
Testing pending though 😜7 -
Refactoring and writing tests for code that was code written by intern and is on production about one year
-
Deleted over 1'500 lines of code over the last 2 days and replaced it with 80 lines of readable, simple, generic code.
And I'm feeelin' gooood 🎶7 -
Me at 11:00
"Ohh I need to split this component into two since too much has been put into this.. Seems like an easy task.. Will take me an hour max to do this.."
Me at 22:00
"Damnnn.. I think I have broken this code.. I am doomed.."
*Replaces all files with HEAD1 -
tl;dr @Root refactors some spaghetti.
I'm refactoring an api that creates a support message. It's a post route.
When seeing a magic hardcoded message string, this route instead updates the user object, and does not create a support message.
It also returns different results if the user is muted (fine) or if saving the message succeeds or fails (fine).
But if the user is creating a duplicate message, it doesn't save the message (fine) and... redirects to listing their messages instead? Wat?
Also, when refactoring this (migrating to a new message backend), I discovered that not all routes return a response. If the message is a non-duplicate, from a non-muted player, from a non-redacted client, the route doesn't respond at all!
So, I'm having fun cleaning this up. I actually am. Except I'll need to support all of the legacy clients for the next lifetime or two. I mean, really. There are still people with Android v2 devices who are using this thing. not even kidding.9 -
1. Refactor shitty code because it is hard to maintain
2. Rant about how can someone write a code like that
3. Check commit log to see who is the person to blame
4. Found out that's me1 -
That moment when the you actually think that this huge refactoring isn't worth it, but you do it anyway so you can live with yourself...
Code quality is love. Code quality is life.1 -
just wanted to look up something in an old project. saw things i could to better.
Ended up refactoring the whole project. Forgot what i was looking for.1 -
That feeling everytime you realize that you could have built something better with less code and repetition after completing a project.7
-
Refactoring
When wrote some abstraction,
commented out the old stuff,
replaced it with the new calls
and after it passes all tests
get to remove all the old crud.
( ☼ ◡ ☼ )
I feel clean again.3 -
I've found this beauty in our company's legacy code.
The main doubt is: is that possible have the required strength to refactoring this 💩?22 -
How I spend my days at work working with legacy code:
* Writing tests before I do anything
* Noticing that i cannot write tests because of antipatterns. Lots of them.
* Refactoring to make at least a tiny bit testable.
* Then writing tests.
* More rewriting and refactoring
* Finally adding that one feature my boss asked me for
* Writing tests for that new feature (my do that before implementing)
* Explaining to my boss why it took me so long and agreeing on stopping writing tests.
* 2 days later: explaining why i still broke something.
But in the end my code works just fine.
my colleagues handle things differently. They just ignore problems as long as at least one feature works a bit.13 -
Just spent 10+ hours refactoring a code, and at the end I've figure it out a one line fix to the problem... just wasted 10 hours of my life.. :)7
-
You know a Repo is fucked when you have to rely on global text search to find and rename symbols like method or class names.4
-
After long hours of brainstorming, refactoring and redesigning, I looked at my boss, placed hand on his shoulder, smiled and said "version 2 boss, version 2" 😂1
-
Uncle Bob and Martin Fowler. Their books (“Clean code”, “Clean architecture”, “Refactoring”) and Twitter posts have changed the way I look at software development.5
-
Data Engineering cycle of hell:
1) Receive an "beyond urgent" request for a "quick and easy" "one time only" data need.
2) Do it fast using spaghetti code and manual platforms and methods.
3) Go do something else for a time period, until receiving the same request again accompanied by some excuse about "why we need it again just this once"
4) Repeat step 3 until this "only once" process is required to prevent the sun from collapsing into a black hole
5) Repeat steps 1 to 4 until it is impossible to maintain the clusterfuck of hundreds of "quick and simple" processes
6) Require time for refactoring just as a formality, managers will NEVER try to be more efficient if it means that they cannot respond to the latest request (it is called "Panic-Driven Development" or "Crappy Diem" principle)
7) GTFO and let the company collapse onto the next Data Engineering Atlas who happens to wander under the clusterfuck. May his pain end quickly.2 -
I am currently refactoring my code:
1. 200 errors
2. fixed them!!!!
3. build the solution...
4. wait for the build to complete...
5. 300 errors
6. FML5 -
When you're asked to extend a functionality on a piece of code and the 2.5k lines in the view are a juicy mix of PHP, HTML, CSS, JavaScript and the functionality relying on jQuery trasversing through the document tree and expecting things to be in their place. Oh did I mention html build with strings in JS? I'm going to love this day! WHY, JUST WHY?! *gasp*3
-
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.
-_-3 -
When you're in doubt... commit as "Refactoring"
It works 100% of the time and nobody is gonna check3 -
I spent 4 hours finding a good way to instanciate golang structures. Came up with a function that returned a value or pointer and I just kept reusing the nomenclature for an entire project. Then my buddy looks over and goes, "Ethan, you're a f****** idiot", and shows me the standard nomenclature. Now I have to refactor my entire project. FML.
(Edit: typo)13 -
I spent my last 2 months refactoring a crazy panel.
No one understood how that panel was working...I was feeling like the technological version of the chimney sweep.
I could almost breathe frustration.
So... what's your worst experience about refactoring old crazy codes?4 -
After 20 minutes refactoring code and changing methods, you realize you have been editing the wrong file -.-'1
-
!Rant
Fuckkkkkkkk youuuuuuuu CLIENT :/
Client asked why two weeks for refactoring.?? When you already know the functionality and he gave us two days.
After two days we successfully renamed everything!!! 😣5 -
Hours of refactoring just to get 0.5 seconds increase in performance per document generation.
Sounds small but makes a big difference when generating 100k documents.
Still not happy with it though...2 -
I think I have a programming disease: Premature refactoring. Sometimes I refactor the refactor that I'm doing.1
-
It's only been a few years, might need a little refactoring.... The things you find when cleaning up old directory structures on forgotten hard drives...1
-
That moment when you know your code can be much shorter and cleaner but you just keep typing because you're too lazy to restructure.1
-
Tired of reading spaghetti code written by your team mates?
Sit right next to them and ask them to write unit tests for that code.
Smash their head on the keyboard everytime they have to think longer than 10 seconds on how to test a specific logic.
Strangle them with any wire you find nearby till they agree to break up that spaghetti code unless they already started within that 10 second time frame.
When the exercise ends, tell them this is what refactoring is and ask them to pass on the knowledge.5 -
Is it common to look at code you wrote 1 to 2 years ago and think "what the hell was i thinking, this mess needs refactoring"?10
-
What a difference three lines of code can make. That's the typical case of "that seemed to be a good idea". I don't know how did I think it would work out on the long run. Next step will be reduceing the enourmous CPU usage as well.3
-
After finishing a long and arduous refactoring I got to delete some hundreds of lines of really horrible, unmaintainable and broken legacy code. Feels absolutely great.
I love the smell of deleted code in the morning. -
how often did this happen to you?
- fix a bug
- think, now that i'm here, let's smuggle in some refactoring, just this aspect, won't take too long
- spend more than half a day refactoring, finally finding yourself entangled in a spaghetti nightmare
- stash / shelve and revert all your refactoring changes
- continue on your other tasks and talk to noone about it ._.6 -
I finished a big refactoring. It makes me feel so good to delete all those lines of code. Even though I have a decided to leave this company in the near future, I am very happy that I leave the code in a better shape. Somebody who is replacing me doesn't have to go through shit anymore.3
-
!rant
It‘s just amazing how much a proper type system and a modern language makes refactoring a good dev experience.3 -
Those little moments when you finish writing and refactoring the code and the result is elegant and just works
-
Man! I love refactoring! 👨🏻💻😍
Only saved about 20 lines but it went from ugly string manipulation to beautiful JavaScript objects!6 -
New task - add new field to a form... After few hours I'm ending up committing changes in 80 files..
*Refactoring craze*1 -
So this one day I'm at work and the manager peaks into my office and just says "can you check that platform X is building, pretty much done just a basic bug check" (this bloke had negative 1 technical experience)
I'm not sure what he means, the whole thing is built in Java and I know nothing about that...
I log in the platform on dev server, sure enough it seems to work, charts are drawn, no errors, then I try to log out; this button does nothing...
I don't bother telling the manager, I just go to the dev who's a friend of mine and tell him about it.
A week later, manager jumps in the room all excited "we're launching this product tomorrow, mind checking again?"
Sure, I log in, ... There's no log out button, it's gone... I ask the dev.
"Yeah I fixed it, it's gone now!"2 -
Fuuuuuuckkk...
1month+ of debugging finally came under the sunlight 😭😭😭
It successfully run after all the pkg refactoring 🥺🥺
I was like wohoooo yeahhh 😂😂4 -
Refactoring! Refactoring! REFACTORING!
This is one of “those desk books” that you gotta have imo. Personally I love giving names to categories of things, helps us better recognize patterns if we can classify them.
Software can always be improved, this book give you a good majority of the most common refactorings it’s like a recipe book almost.. shows you the code smell... give you the detailed recipes to fix it. Great to have in code reviews.
Doesn’t matter that this book is in JavaScript the concepts and ideas are the big pictures in this book.
Classic “one of those” books.21 -
When your bitch-ass co-worker inserts something that is plain useless in the program in every degree1
-
Fine don't take my suggestion during refactoring old code. Keep the python code over 100 lines of code...we could have cut it in half, but whatever
-
Parts of the code I am working on date back to the early nineties, written in ancient C++ with lots of special cases for ancient compilers by people with 0-2 years of coding experience.
My favourite coding moment is every time when after refactoring a part of the code, it has about 1000 lines less (no exaggeration), is more reliable, AND can do a lot more than before.6 -
My 5 cents about refactoring.
People often postpone it, making it harder down the line.
From my experience, it's better to just do it as you go. 5 min can otherwise become 30 min thing after a while, and combined with some other 5 min thing, this can become 2 hour thing after some time, for example.
Also good luck convincing management (especially bad one), that you need 2 weeks of refactoring. Doing tiny 5 min refactoring, no one will notice.7 -
i am writing a piece of code that i already feel guilty about,
alternate is refactoring a complete module.2 -
I'm surprised management allows us to write false positive tests just to have high coverage instead of refactoring it first. Time to abandon ship.
-
I fucking love it!
After a full day of refactoring old shitty code into a glamorously sparkling epicness of bytes, the whole thing worked flawlessly and on speed.
Quite satisfactory. 😊
Templating in TWIG, especially using inheritance and includes, is so much more fun than doing it in raw PHP!
*cough*Fuck WordPress*cough"1 -
What the FUCK is the point of submitting a PR, if you're going to approve my code, without looking at it, and then LEAVE ME to further refactoring.
I don't mind the refactoring. At. All.
What I DO mind, is being told "yerp, looks good" and then standing aside as I break everything.
TeAmWoRk5 -
When you have the amazing refactoring idea you've been waiting for... but it will be hours before your back at a computer.1
-
Worst code I ever had to touch: a React application, createClass era, before redux was a thing, that had everything in one fucking component.
Every fucking thing.
This was a simple video chat application, but still. The component's code included:
- Views (contact list and video call screen) and logic to switch between them;
- All application state;
- API calls;
- Websocket message handling;
- WebRTC logic (getUserMedia and p2p streaming).
This app was built by one person in one month for a demo. That person left the company after the demo and I had to maintain that mess without zero React knowledge (I was doing angular at that time). On his last day he gave me a crash course and an overview of how the app worked.
Around that time I attended a few meetups and a conference with talks about React. That, my curiosity and ability to learn by refactoring helped me a lot when I had to add new features and fix bugs in that app.5 -
Just cut 2 seconds off the load time after roughly 2 months of refactoring. The code looks beautiful though.1
-
I love refactoring :) just finished going through implementing accrued knowledge from the last 6 months into all my client side code and just doing that opened all kinds of doors for new features and niceties.1
-
When you find out you didn't need that if-else statement in your code if you simply made an additional variable with an expression that works for all cases of that if-else statement
-
It's a Friday and buzzing from refactoring absolute shitty CSS code by reducing it by 2200 lines (and still not complete). Who the Fuck wrote this complete piece of shit!4
-
They say 'code drunk, refactor sober' but they fail to mention the sober refactoring dude won't have a CLUE what the drunk coder was even thinking.
Such is my life. -
Do you know feeling when you have just so much fun refactoring + ( listening + singing / humming ) to music that you can't even properly type anymore because you move around too much?
I feel so happy rn, maybe it's also the coffee ..3 -
I really don’t like when colleagues start refactoring core components in a software application just because they feel like it.
Consult the team first and get everyone’s opinion, cheers.7 -
First software refactoring in the company I worked for. No test environnement because "who needs it?", no unit testing, no comments, had to make sql updates and shit, was scared all day long that something would fuck up.
"Fuck fuck fuck, forgot a part of the where !" Had to fix everything quickly so no one would notice, no coffee/smoke pauses. On top of that, got a ton of retarded requests from the PM and other technicians working with me like "hey boi, could you add an icon to every button we made? There's like a thousand, we need it for tonight, our client will come visit us and I want to show him a better interface blablabla"
And since I was an intern, I couldn't refuse, had to work like a prostitute in virgin-land, and for what?
"Oi, you did good, now do other stuff"1 -
Ah good ol' refactoring summer.
*Me starts refactoring spaghetti bolognese*
- Hurrah everything can be generic and so much better. I'll just do this and this and this and this, oh and this also needs to be reworked cuz of this.
8 hours later.
- it wasn't that bad!
$ git status
- oh god
$ dotnet test
- welp.... I need something to do tomorrow.4 -
Refactoring a method of a 5 year old system. Probably one of the ugliest code I have ever seen. This is just a little piece of the ugliness6
-
when u feel that u wrote some godlike code. 2 months later client wants to add new features. then u realize ur code needs major refactoring. "what was i thinking, far from godlike"
-
If you think your legacy code is bad - this is what I came across in a system I'm refactoring this morning... and this isn't even the bug I was looking for.1
-
You know a meeting is boring when even refactoring some legacy garbage is more enticing than just sitting and listening 😬3
-
Spent 2 days refactoring code written by our "offshore team". I've done refactoring on the same code in the past, probably upto about a week in total of refactoring now. The code looked like it was written by someone who had literally just finished their first "Hello World" app - loads of code blocks copied and pasted instead of declaring reusable functions.
The whole thing should have been done by us in the first place.
And yet our money-conscious company wants to employ more of these developers. Cheaper than us? Sure. Quantity over quality though, but I guess money is all that matters to the big cheese1 -
The boss wants to improve the QA by introducing GUI tests (partially non-automatic) instead of refactoring the legacy blob of application with unit and integration tests.
THIS WONT MAKE IT ANY BETTER1 -
Dev: Woah look at this code! I might be a genius!
Also dev a few months later: Woah WTH is this shit? Was I totally dumb or what?2 -
Working on codebase of a 20+ year old system that the company I work for bought five years ago and in that time there’s been no refactoring, no security updates, no attempt to create automated testing (there is none), new features have just been built on the codebase with no regard for quality and it’s just spun into the horror cesspool that it is today.
I joined one year ago and I’m slowly refactoring the codebase and updating it to get it to a more modern codebase, cleaner code, faster load times and creating a ton of dev documentation so the devs in India can start getting into best practices and start producing quality code.4 -
Working on a project with tests is so nice.
I love tests. Well, I hate making them, but now refactoring is so easy :] -
Worked till late refactoring code,
Then dreamed I made a huge mistake.
Or was it real? Can't tell !2 -
I just spent an hour refactoring and output-beautifying a one-off console script
You can probably understand how bored I was in the train -
I have to create python parser (3.6) using code provided by client (2.7), that they used in their company, and it is full of crap like:
if a==1:
if not b:
c = [1,2,3]
if a==2:
if not b:
c = [1,2,3]
if b:
c = [1,2,4]
Or:
text = ""
for i in something:
text += "real text " + some_string + " \n"
text += "another line " + some_string + " \n"
text += "and another " + some_string + " \n"
text += "and so on " + some_string + " \n"
... (many lines instead of one appended text block)
Of course above variable names are just for shortening code, but there are variables like oo, ooo, var_ or var__... cause you know, PEP8 does not exist.7 -
When refactoring legacy code and your colleague committed this a week ago... As punishment we made him listen to "You're too fat to fly" all day long.
-
Spent all day refactoring lots of confusing code down to just a few lines. I am satisfied, frustrated and drained all at the same time.2
-
Pair programming a major refactoring, colleague tries to change _everything_ simultaneously. Spent hours fixing compiler errors, now it's not linking. ¯\_(ツ)_/¯
-
What I absolutely love to do is refactoring. With strongly typed languages, I often just remove or change something and then follow the compiler errors to finish the refactoring by fixing them.
It‘s not just a matter of renaming something. I will reliably get all the places in code which are affected by the change.
How do you handle that with weakly typed languages like JS? I can only imagine how horrible of an experience refactoring would be.7 -
Because almost all the answers from stackoverflow are still optimum, even if it's 7 year old code, all it needs is some good ol' spit shine refactoring
-
Refactoring is like dating. You have to remember stuff, maybe you're insecure and you may have to overcome yourself to actually do it.
But when it works out, it's great.2 -
When you find an awesome, intelligent way to do something after thinking you had already found one and implemented it already.1
-
One of the best feelings is when you're hip deep in code refactoing and you're delezing old code with your new and shiny code.
-
Yeah so I quickly hacked stuff together. Why make it beautiful before I know whether it will actually do? Hack now, refactor later!
Yeah and then that moment in refactoring where main() gets under 700 lines and I don't know whether what I'm feeling is joy or despair. Gaaaahhhh!
At least I have also written automatic tests so that I can see when something breaks.3 -
We just found out that refactoring our code -base is no longer optimal for the health of the company because our deadlines are too tight. We'll get back to refactoring in a year.1
-
I don't know what's wrong with me this morning. I started refactoring, and I know I'm overdoing it. I can't stop myself. I'm stuck fiddling over it like a meth head scratching his skin.
Please stop me. I'm hurting the code.2 -
Spent the day refactoring a REST app into graphQL, that feeling when all tests are green and everything is committed and merged 😧🤓3
-
That emotional rollercoaster when you refactor a huge mess and finally there are no more compile errors in it. But there are still endless broken tests to fix :(
-
From the book
Refactoring JavaScript
Turning Bad Code into Good Code
Evan Burchard
HOW CONVERSATIONS ABOUT REFACTORING SHOULD GO UNTIL TESTS ARE WRITTEN
“I refactored login to take email address and username.” “No, you didn’t.”
“I’m refactoring the code to ____”
“No, you aren’t.”
“Before we can add tests, we need to refactor.” “No.”
“Refactoring th–”
“No.”
“Refa–” “No.”7 -
I can't make progress on my private project.
I just started and already refactoring my code.
Yesterday I started to refactor my tests -.-'
I'm sure I will lose the interest in this project because I start a new one I can refactor to death.8 -
!rant
Oh that wonderful feeling of finishing a month long project. Updating all the comments, refactoring things, testing everything out, closing the 50 chrome tabs you have open...
Life is good -
Spent the whole day trying to refactor a program that consumes an API and didn’t work out. Now we have one less day to try to improve the product.
I think the fault was that we were aiming too high by looking at other libraries and we ended up over-complicating it. -
Ugh. That may have been a mistake.
I'm deep in a large effort to refactor my project. It's a one man deal and something I've been working on pretty much every day in some fashion for nearly 10 years (five years ago I started a scratch rewrite to move from a fully CGI server rendered application to a browser rendered asynchronous version built around JS) and that took me three years.
I started this refactor about 8 weeks ago. Turns out I've been tackling the largest modules and progress has been decent. So that's good.
But I got to wondering ... Just how much code is there?
So I whipped up a quick script to do some calculations. Read each file and get a line and word count, skipping empty lines.
In JS it turns out I have 83,973 lines and 467,683 words.
On the back end, 86,230 lines and 580,422 words.
Average publishing stats say the are about 250 words/printed page.
That means I'm confronting refactoring 1,870 pages of JS. That's the size of several decent sized novels. (I think I've done the equivalent of Maybe 400 at this point).
Makes me feel like the walls are creeping in to know how much is left to go ... -
Man... I hate refactoring. After I had finished up an issue this morning, I had to refactor old sql queries and the parsing to the views.
I've worked on it all day and I still haven't finished! Still loving my job, tasks like these are unavoidable but they drain the life out of me.3 -
I was doing some refactoring code, I was about to commit , but I realised this, I chuckled , what a silly of me.....4
-
Finally started new job this week in programming language and frameworks I never worked with.
I’m already refactoring code 😂4 -
Just found a crystal subreport with 33 shared variables. For those who don't know what that is (lucky), they're super global variables that exist everywhere.
Please send help. I'm supposed to refactor this...19 -
Refactoring a long, nauseating piece of code while the mouse died.
Finished the job, about to push, KDE froze.
Good enough excuse for trying a new distro I guess.4 -
Watching a video on YouTube that shows: Refactoring and Extract Method features in xcode 9 beta brings a tear to my eye, never thought we will get that basic functionality 😢
-
So I've been back to work for 2 weeks after going on a holiday. Getting back into the flow of things was easy, but seeing the status of the project that I am a part of, and seeing the kind of implementation work that my co-workers has done, it's kind of a no surprise.
So the past 2 weeks I've been completing features that I left my co-workers to finish, but didn't. And rewriting other features that they worked on, but does not meet the specifications.
Will I ever be able to work with reliable/competent developers? -
i strongly recommend considering multi language support before starting a project. implementing it afterwards istn't that much fun as anticipated4
-
I discovered the Source Making website a couple weeks ago, it's awesome.
It gives you clear tutorials on the essential design patterns and refactoring techniques complete with example situations and code. Love it!3 -
i had an epiphany today, in a discussion with the software architect of our new project.
i'm having the epic job to design & implement a prototype for a C++ library in a new software project and collected some inspiration in our "old" software, where i'm maintaining the module that fulfills the same functionality (i thought). i've been maintaining this module for around a year now. i analyzed the different features and stuff to consider and created a partial model of the new library.
when i showed it to the architect today, he was like "oh my god, no no no, you don't need all this functionality, this shall not be part of the new library!"
this was the moment when i realized how deeply fucked up the code base of the old module is.
imagine it like this:
you want to automate the process of making yourself a good ol' cup of coffee.
the reasonable thing would be to have
- a smart water boiler where you set parameters water temperature and amount of water to be fetched from the water supply
- a smart coffee bean grinder where you can set type of beans, amount of beans and grinding fineness
- a component where water and ground coffee are joined to brew the coffee, where parameters like duration, pressure etc. are set
- a milk tank where amount of milk, desired temperature and duration / speed of foaming can be set
- a sugar dispenser where amount of applied sugar can be set
- optionally, additional modules with spices, syrup, ice cubes, whatever for your very personal coffee experience
on requesting a coffee, you would then configure and orchestrate all components to your wishes to make you a fine cup of coffee. you can also add routines like "makeCappucchino()", "makeEspresso()", or whatever.
our software is not like this.
it is like this:
- a smart water boiler consisting of submodules that know how to cook water for e.g. "cappucchino with sugar" or for "espresso without sugar, but with milk and ice cubes"
- 5 smart bean grinders that know how to grind beans for e.g. cappucchino, espresso, latte macchiato and for 73ml of water preheated to 82°C
- a very smart sugar dispenser that knows how to add sugar to 95, 98 and 100°C coffee and to coffee made of BOTH coffee arabica AND coffee robusta beans.
etc. etc., i think you're getting the gist.
when i realized this, it was like, right in front of my eyes, this terrible pattern emerged like a foul, corrupted caleidoscope of chaos, through the whole code base of this module.
i've already known how rotten from the core this code base is, but today i've actually identified a really bad pattern that i hadn't realized before. the whole architecture is so bloated that it is hard to have an overview of the whole thing. and it would require a LOT of refactoring to repair this pattern.
but i guess it would also be infinitely satisfying because i could probably reduce the code base for 30% or something...
but unfortunately, this is never going to happen, because screw refactoring.
it's a great feeling to start this new library from scratch, tho...6 -
This night I had nightmares about our codebase.
After the deadline I should seriously suggest some refactoring.1 -
A colleague blocked a full big refactoring to go live just because there were missing marker interface which they wanted to be implemented by any other interface which was actually part of the core functionality. A marker interface...a marker interface...
P.S. we can't merge stuff on main branch if a team member vetos2 -
When your senior says he may as well stops working as I'm always refactoring his code...
Same sentence says I copy what you've done in other places so I don't see why it isn't good enough. By copy he leaves redundant code in there too.
Am I a being a douche is he just being over the top?
- He writes code and expects it to live for a long time.
- I write code and will go home and refactor my own code.2 -
I totally want to refactor my project's code, but I don't have any time for it and now it's a working piece of spaghetti-ish 😭
I'm just praying I'll get to do it once it's actually finished, so I don't have to work with it again in like a year and want to travel back in time and murder myself.13 -
After a few months of working in an actually well coded project, I'm back in the one where I find abominations like this every day:
boolean result=false;
<do stuff>
if(<condition>){
<do stuff>
return true;
}
<do stuff>
return result;
Do they even read their code before submitting? -
I have to stop refactoring everything. 4 weeks on one of my private projects and I'm still on the same place. But I have refactored the code like 4-5 times now ...2
-
Sometimes i like to break my code on purpose, to force me to refactor those parts and rewrite them more efficiently.
I find it hard to improve existing, working code, because it limits me and it does not inspire me to come up with something better -
I promised myself that if I didn't start up a new relationship by September that I would plan to start a new lease in life and move in 2019. The online dating subscription I've used for a few years will cancel at the end of this month.
I used to doubt that fate was real, but times like this make me come close to believing in it. Maybe fate is just one large karmic refactoring.4 -
Talking to my architect:
- hey, we have a lot of code smell and data is structured usually in a chaotic way, also its hard to understand what is going on with all these code duplications, maybe we can think about refactoring, better structure, maybe even we can extract some domains and make life less painful?
- what is domain?
- *facepalm*4 -
Refactoring code that I've wrote like a year ago, made me realise how much I've grown in the past year, do you guys ever go back to old code that you've wrote?3
-
Last week I had two days training about how to code modern with the language I use.
Now I wanna refactor every single line of code I ever wrote :D3 -
I get this weird itchy, antsy feeling when in the midst of doing a tedious, but precise work. Like pixel-perfect mouse operations or keyboard-intensive code refactoring.
Please tell me I'm not alone in this. -
has anyone here done a proper refactoring? i mean, documenting, following some rules, etc.
i need to know the process and guidelines for refactoring, what & how to document, where to start, etc.
i am assigned to a project for a short term and my job is to do refactoring of Reactjs code. and i need to do it in a really good way.
any help would be highly appreciated.
thank you.2 -
WTF?
Just found this code:
"It is assumed that all 'static final String'-Attributes of this class are a key in the property file (which is validated by reflection)."
SO REFACTORING YOUR FUCKING MAGIC NUMBERS WITH A MEANINGFUL CONSTANT MADE THE APP CRASH. ASSHOLE. -
When you spend a couple days cleaning up and refactoring a bunch of classes, then someone else comes in and places needless and empty return's at the end of every method 😒🔫
-
Why do I always have to refactor bad written code ? Is this some kind of karma ?
Undocumented, written by a senior but looks like it was a junior, no unit tests, variables with meaningless names, duplicated code and every possible thing you can find in that kind of code.3 -
I'm a bit cornered. A week into an ambitious refactoring effort that was supposed to take just a couple of days to finish, the end doesn't seem anywhere near. The system went from a messy albeit perfectly functional state to a much better structured non functional bag of bugs. If I leave the branch all the efforts are lost. If I soldier forward I'll be unproductive for good knows how many days to come.
How did I ever fuck myself so hard!1 -
Not being able to do refactoring on an app that contains 900+ line view controllers because "its not safe to do refactoring before the demo at the end of the month"
F.M.L -
To all those open source contributors who only believe in refactoring code .... If u really want to clean trash come to India coz we have lots of it3
-
My project is a cloud based automated testing product. My current story is to extend a module to support multiple of a particular testcase type in one test run instead of just one. This has uncovered a rats nest of complexity because everything is designed with the assumption that there will only ever be one of these testcases.
Refactoring about 5 different classes just to get into a state where i can pass a list of testcases into a service instead of just one. Wrecking my head... -
Colleague says some of my code sucks, says he's gonna rewrite and improve it.
After he finish his work, I look in his new written code:
F*ckload of unused methods and classes,
some usings of deprecated API calls...
god. It's okay, if you want to help and improve code (my code wasn't the best, I admit)... but when you do, do it the fuck right. -
I just finished refactoring the code of a single jupyter notebook into a decent structure with comments. It feels good.
Unfortunately I still have stuff to implement and it's 2:50am :(5 -
Things could be soo much better if I could just refactor this code to accommodate more than one web service... #soapmessages #devwoes
-
When you have to refactor the whole microservice to fix package structuring so it can be modular...why can't people do it correctly the first time?
-
Started refactoring our app with Android Architecture Components 1 week ago.
Now Android Oreo is released and I don't have to worry about breaking changes anymore.
Yaaasssss! -
Now as I am refactoring the internal codebase of my company
I understand how important it is to have a good code documentation and writing patterns.
And also how much it is important to help his a junior when someone is in senior position when the junior was given the task of refactoring the internal codebase.
It's such a pain the brain situation these days for me. The documentation is not properly matched here and there and code writings are random. It makes me hates the code.2 -
I was on a call with a colleague and we talked about my next tasks.
He was building some stubs and shared his screen with me so I knew what to do after he pushed these changes.
We talked about refactoring one method and he wrote "throw new NotImplementedException()" in the first line of the method and said: "I'm evil ;)". -
I am starting to think the biggest problem with my current project isn't the business unit changing their minds all the time. It looks like the biggest problem is me continuously refactoring the code.
-
Inherited a massive code base today... All JS is still being accessed via global scope... what are modules & modular design even... SOLID and DRY are things that clearly never crossed the devs mind during inception of this beast... and to top it all off all there is a weird BEM / SCSS style going on that somehow manages to confuse the IDE... thus all style helper utilities in the IDE are useless...2
-
Writes 4 years worth of CRM code.
Forgets TimeZone Support.
1 Week later, supports TimeZone.
REFACTORING! -
Today I learned if you ack a message twice, RabbitMQ shits the bed. Dang. Another day wasted on a dumb refactoring regression.2
-
Having to deal with my own stupidity.
Refactoring sometimes is as hard as remembering the date of birth of a douchebag2 -
Refactoring code to meet style guide..... 20 bucks says outside of my code reviews no one will look at it for years.
-
Just by refactoring to use the correct data types to skip all checking and conversions and also use data bindings, the performance increased several folds.
Why take the time to refactor? It would probably take longer to implement the new features if I did not. -
IntelliJ refactoring tools because......because.
Least favourite dev tool: Xcode refactoring tools because they still dont support Apples own language. -
Who else likes refactoring more than writing new code?
I really like improving a system, rather than writing something completely new. Maybe it‘s because of my inescapable fear of introducing a myriad of bugs.2 -
Spent the day refactoring old copy-pasted astronomical code with minimal commentary, cryptic variable names and missing mathematical symbols. Self documenting code my ass.1
-
- divide large refactoring and architecture changes into multiple small pull requests
How do you go about getting code reviews? Wait till you have all the pieces so people have the big picture?2 -
can't use IDE automated refactoring to extract method because we can't figure out the types of parameters and variables
fuck you typescript, javascript, graphql3 -
i am so excited learning. now i'll start refactoring my plate of spaghetti into object portions. both are new topics to me.
-
Was going to have some fun refactoring js code on the weekend, gf dragged me to a jazz festival instead </3
I enjoyed it, though -
We're doing refactoring and deciding on which class to go into which module. A colleague said, "garbage put in core, shit put in common".
Me: -
4:35a.m and I trashed my personal side project app because attempt to add a feature led from one refactoring to another to another till I got lost.. lol Starting fresh tomorrow. #newbieDev4
-
"We don't have time for refactoring this PR now, please open a new task and we'll work on it asap."
Merge, Deploy, and set new task as Won'tFix two hours later :-/ -
TDD shows you just how much "junk" you've added to the codebase before without TDD. Then it becomes TDD refactoring. Wtf, what a mess. 😑4
-
Just to clarify my previous rant:
In this case, refactoring meant changing class, method and variable names -
"Anyways trust code that you wrote before but... never rely on that!"
I wrote some code mounts ago, now when I want to refactor it see a bunch of shit, I delete them all and after hours write exactly the previous code!!! just because i don't put some STUPID comments... 😑1 -
there is no time in the budget for refactoring the code that is being shipped to live.
the only refactoring i get done is the code going into my portfolio. -
So the product has been labeled "ready for launch" for months, but the client has apparently been procrastinating and weren't ready.
Finally, earlier this week, they claimed they were set for launch, and that I should prepare the final bits.
And now they demand additional functionality which requires refactoring code.
Sigh. Why, oh why?1 -
Refactoring is the revelation that the name "foobar" is pretty dumb and you should rename the function to "sine".
-
I'd have the power to lint developer brains so they'd write clean code and I wouldn't spend so much time refactoring crap.2
-
I have a changed a project that has many many many bugs because of outdated code that kept it from working. In the process, I changed the structure of some feature implementations in order to get the application to work again. Can this be considered refactoring, or is it just a special kind of bugfixing?
Also, can I call something a rewrite even though I'm not actually writing anything, just using a GUI environment to create the same functionality again?
I need this because I'm writing about what I'm doing for my university and I can't find it on google - I guess it's opinion based.1 -
Sometimes I feel like my PM might as well just say "I don't believe in refactoring, as I don't make any mistakes."
-
This moment, you know ur movement mechanic in Unity works just as u want it to be. But its so damn hacky, u are afraid of refactoring, because u know.. u would break it...1
-
I was planning on migrating my Mastodon instance to a new node, but then I looked carefully at my deployment scripts. I had built in support for multiple servers, but not everything supports it, and the configuration is messy now that I think about it.
Now I need to write a bunch of tests, and then refactor a bunch of my code. Hopefully I can get this done before I run out of space on my Mastodon instance. It's gonna be a fun day. :-P -
Is it just me or do people sometimes do major refactoring not because it needs to, but purely because they are inheriting old code and can't be bothered to understand it5
-
"We need to refactor THIS section of the Frontend because BE wants to implement THAT - we will agree the new structure, and we will migrate the previous structure"
- refactoring the app 4 times a year because reasons -
Ahhh, this kindda makes me sick...
Wrote something.
Wrote documentation - 2 weeks.
Changed few things and refactored - 3 days.
Refactoring and updating documentation - week and counting.3 -
I start with a POC or a prototype to prove it can be done and to fart around with possibilities. Then I start refactoring the prototype into a full product.
-
When people "simplify" their code by refactoring a singular line of code into a completely separate function. The purpose of which is to prepend "https://"3
-
!rant One of the better refactoring insights I've heard today: "With great power comes great responsibility".
Just because a language may not care about certain constructs, doesn't mean you should be relaxed about them (e.g. weak/dynamic typing/not caring about (variable name) consistency).3 -
A beautiful but fundamentally flawed Rust one-liner I found in my own code during refactoring today:
iter.size_hint().1.map_or_else(Vec::new, Vec::with_capacity)random size_hint.1 gets _really big_ sometimes rust allocate maximum possible memory needed one-liners14 -
!rant
Just did some really satisfying refactoring. Much happier with my work now. Its a little cli app to poll M-bus devices and write the data to file if the user wants. Can scan the whole range, search for specific devices and VIFE codes, parse an input file for lots of the previous data and one or two other things.
How's everyone's else's weekend? -
when you don't know the timeline of the project you're working on. So you don't know if you should rewrite everything to be more flexible in the future2
-
Looking into some javascript. Which function should I use... guess I have to start the day refactoring. What the f*ck, is good naming so hard:
...
function removeColumn(column) {
selectedColumns.remove(column);
};
function columnRemove(column) {
appliedColumns.remove(column);
}; -
does anyone else have ReSharper and open a file to change a small piece of code, but can't stop refactoring till you get the green check mark at the top?... Or is it just me being ocd?
-
Spent 4 days to refactor the most used word in the system. And that moment, when techlead asked to stop refactoring and keep as it is. 😖😖😖
-
Anyone moved from GraphQL to tRPC? Thinking about doing that. I wonder about the struggles I might face while I do the refactoring.6
-
I love and hate javascript. I set out to do a fully ajax/state driven form interface that operates with multiple interdependent data objects which all extend a base class.
React/Angular may have been a better call but I just didn't have time so I needed to rapid prototype in jquery /vanilla JS.
I'm in the midst of learning and refactoring all the ajax calls to promises and then to async/await, so it's a huge learning experience...
Meanwhile I've got to build objects to represent the data on the backend which is all legacy OScommerce/PHP
Hell of a ride. -
[GIF] This code looks pretty old, I wonder if I can delete th.... what the... https://twitter.com/iammerrick/...
(Sorry, I was not able to download the GIF from Twitter's app) -
What music do you like to listen while writing tests, implementing feature, bugfixing, refactoring, coding, scripting?1
-
WTF ! Spent the whole day yesterday refactoring an old code and today a new requirement came, which adds a new functionality changing the entire code again.
-
When you are asked to show a minimal working demo of what you have been working on past 2 days but you realise you are in the middle of refactoring those 7 files. Now you don't want to undo nor have time to finish remaining work.
-
That thing where you stay up way too late and end up dereleasing and refactoring a huge chunk of The Monolith....
-
Arrgh...
I need to do a lot of refactoring and testing (%80 percent of which is integration) and ITS SO TEDIOUS!!!
Now, for anyone who says "oh, you write spaghetti code, your code shouldn't be so tedious to refactor". No. It's only tedious because it's a few thousand lines that I've been too lazy to refactor till now, and I need to go through it all.
Anybody have any advice for refactoring or testing in Go?17 -
The one thing I don't like about vue is how you have to switch between using `this.something` and just `something` from the javascript part to the template part, it makes refactoring very hard
-
I'm currently refactoring some Fastlane code at work, and I'm wondering what is the fundamental difference between a "lane" and an "action"? I can't really find anything in their documentation explaining the difference.7
-
Got a new user story for code refactoring of my previous stories.To motivate myself i am trying to think like
" it's much better to clean my own shit then others."