16
gitpush
7y

Part 2 of this rant: https://devrant.com/rants/933393/...

Today I received the source code of the application, it has like four views but guess what, all four views have their controllers in one controller.js file that is about 1400 lines of code.

Also all their data models are in one file,
everything is in one file.

Does anyone know how to make it through that shit :(

Comments
  • 4
    Omg... 😓

    I suggest you try to refactor that first, although that might be hard if it's in a framework you're not familiar with. Try to move each controller and model into it's own file first before adding any features.
  • 3
    @shellbug I'm thinking of deleting that shit and doing it in React Native, if only boss allows me to, I'm going through the code and all vars are called:
    var a, var b, var o,
    For me I'm naming my vars as:
    var formerDevGoFuckYourSelf!
    var I'mGonnaFindYouBitch

    :(
  • 4
    @gitpush fuck... Well, that can be refactored too, but it will be a lot harder, as you'll have to trace all usages of the variables to see what they do.

    At this point you have a good argument for telling your boss you need to redo it from scratch: "It will be faster to make it from scratch than to make this work". But that is always a hard sell.
  • 2
    @shellbug I can do that but the client wants the source code back, I cannot get Ionic as input and throw React or Swift/Java as output, client wont be happy.
    I'm sure boss will agree on redoing it but only under one condition, I stick to Ionic :\
  • 3
    @gitpush don't know what else to say other than good luck :/
  • 2
    @shellbug thanks man I hope I get out of it alive 😅
  • 1
    "Refactor this"...
  • 3
    Introduce typescript and split it all up.
  • 1
    @PonySlaystation I don't know typescript 😅
  • 3
    @gitpush if you know javascript, you know typescript. It's really just js with types, like this:
  • 2
    var foo: string = 'bar';

    function sum(x: number, y: number): number {
    return x + y;
    }
  • 2
    This is actually Flow syntax, I'm assuming typescript is similar. @PonySlaystation please correct me if I'm wrong.
  • 1
    @shellbug I'm gonna check with boss, been couple of hours and I'm just shocked of what I'm seeing :\
  • 2
    @gitpush can you share some small pieces so we can suffer with you? 😉
  • 1
    @shellbug sorry I can't :/ especially that a colleague is here on devRant
  • 2
    @gitpush it's ok. 😉
Add Comment