22
Root
1y

Spent an hour and a half renaming a method everywhere in a project from `feature_name` to `feature_name!`. There are a lot of constants, symbols, and other methods that use "feature_name" as a prefix (plus comments and spec descriptions), so was a little more difficult than normal.

Should have taken like 5 minutes with a proper IDE refactor tool. but noo, it was too difficult for RubyMine. wah wah wah. Stupid thing. Not even the search tool was useful -- it's limited to 100 results, and there were around 250 for that substring.

I ended up having to run specs repeatedly to find all the remaining instances, which took freaking forever. blahhh

Comments
  • 1
    Wait, what?
  • 5
    @johnmelodyme I fought with the IDE’s tools for longer than I should have and eventually gave up. Instead, I grepped the codebase for the string, and updated all the calls, method symbols, comments, etc. manually then ran specs to verify I found and changed them all. The specs take bloody forever to run (~15 min for this feature), and I needed several runs before I found and fixed them all.

    It ate my time and I’m pissy because it shouldn’t have. The codebase is complicated and all, but come on, this exactly what the “refactor” tool is supposed to do. Grr.
  • 5
    @Root ~15mins ? Sounds familiar….

    One thing I found out that sometimes the messy codebase can slow down the time for achieving the target.

    For instance, the manager wants you to complete the task by this week , but the code base are as messy as their hair. This is something they don’t understand.

    Time consuming is the other problem. I assume while you are refactoring the code, your common cuss and swear phrase will be

    “Yo who the fuck coded this shit?”
    “This is the codebase?”
    “How the fuck this is allowed and approved?”
    “Is this all the college degree can provide? My 15 year old self can do it better.”
    “Why why why is NOT FUCKING WORK?”
    “RAWRRRRRRRR”
    “Oh , that’s why”
    “Give me some time , will you?”
    “Fuck you”
    “Jesus Christ , what the fuck”
    “Seriously?”

    πŸ˜‚
  • 6
    @johnmelodyme Jeez, am I that predictable? Like, you’re spot on with almost every one of those.
  • 3
    @Root I know this because I am facing the same shit πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚
  • 0
    Maybe sed would've helped here? you'd still be able to review what it had done in git changes
  • 1
    @Hazarth Yeah. There’s lots of tools that could have done this. I’m just angry that the ones specifically designed to, and built into the IDE, could not.
  • 0
    Sounds like a task where even I would use regex in my text editor's search-n-replace. (if 'search complete words' is not enough)
  • 1
    @electrineer I tried. RubyMine wasn’t finding all of the instances (it seriously didn’t find a few spec files), and I have no idea why. I stopped caring. I just gave up and used the terminal and ran specs to verify.
  • 1
    Static analysis doesn't work in languages that don't provide static guarantees.
  • 0
    @Root sounds like the sort of thing why many prefer text editors over IDEs
  • 0
    find + grep + sed + mv. Maybe a while loop, idk...
  • 7
    🀦🏻‍♀️
    Can’t I complain without getting suggested solutions?

    I don’t need a solution. I already fixed it. But I’m mad that the tools suck!
  • 0
    Building tools for Ruby is like making a chisel for mud.
  • 4
    @Root sure you can!

    Can we pointlessly pretend to be smarter after the crisis w/o any clue of the context of the situation you had to deal with in the comments to make us feel better?
  • 0
    afaik their are 2 types of searches in every intellij s/w : file search (opened via shift pressed twice on mac) and text search/replace (cmd shift f/r). and their is a refactoring option also, which changes the usage by putting the cursor on the variable name and pressing shift +fn+f6 .
    i am guessing you would need to use 3rd option i.e refactoring and not replacing (i.e 2nd option which i guess you are trying to use),. also there is a small "expand search results" button at the bottom of searches, which when expanded opens the search results in a seperate section without any limit on searches.

    don't know why jetbrains would make a shitty version of their IDE for ruby but my experience with jetbrains tools( intellij, AS, webstorm, phpstorm, datagrip, pycharm) has been very nice. it only sometimes suck at renaming packages in android, but i guess that's just an android level problem
  • 0
    Bruh any other IDE has "refactor > rename (βœ“change all occurrences)"
  • 1
    @dotenvironment @AlgoRythm Did you not read the rant/comments? I used those and gave up on them.

    @dotenvironment I did not see the “expand search results”; I’ll have to look again.
  • 1
    @Root I read the rant, I couldn't be fucked about the comments. Tldr

    Decided to blindly drop in my two cents.
  • 1
    @AlgoRythm Fair fair.
Add Comment