5
greendev
18d

I'm a Ruby on Rails developer. I love Rails because you can get so much done so quickly. I've built huge websites on Rails at the consultant shop where I work.

A couple of years ago we added a frontend guy to the team. We switched from doing full stack Rails to using Rails for API only with Vue with Typescript as the frontend. Since this transition took place, I am unable to get anything done on frontend. It takes a huge amount of effort to just add a new input box to a page. Our whole team is on the edge of getting laid off because we can't get things done in a timely fashion for clients and our products consistently run over time and over budget.

Here I'm trying to add an "Are you sure you want to delete this?" message to a form, and I'm on third hour trying to make Typescript happy. I want to assign a variable a value and I have to decipher errors like this "Type 'Ref<string>' is missing the following properties from type 'Vue<string, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>': $data, $props, $parent, $root, and 30 more." WTF?!?!

Am I just not smart enough for this? Why did programming suddenly become so hard for me? If I had to start off this way I wouldn't be a programmer because I wouldn't have been able to figure this out alone and it wouldn't have been any fun. Anyone else have the HATE for Typescript that I do?

Comments
  • 1
    curious, what was the frontend for the other rails apps?
  • 2
    @jestdotty Rails templates with a sprinkling of JQuery. I've worked with AngularJS too without this level of problem.
  • 1
    yeah jQuery was pretty nice

    idk never vibed with angular or react. went to svelte but it has its own issues in some ways
  • 3
    No, it's not you. Lesser programmers made bad things a standard making it actually harder. For a long while it was not done to work on something without framework and many devs can't do JS at all. If you're really good at it, the basics and dom, you'll see you don't need a frontend or typescript at all. Javascript type issues? Skill issue. I never had them. JS is so much fun and the development speed is so high, build your own templating and state framework. Reinventing the wheel is good for education.

    I did like Vue actually, vuetify to be precise. I'm a terrible designer and never made smth beautiful in my life. With vuetify I actually made smth decent.

    Ruby on rails developer is awesome. I don't do ruby, but watched three hours of interviews with that amazing man. He's also racecar driver. He now sells source code of a product for 309,-.a kinda slack app. So, you become real owner of the software after purchase. Good concept right. Commercial open source
  • 2
    TypeScript wouldn't be my area but it sounds like simple incompatible types are being used, maybe use a global type. does this make sense?

    The documentation says:

    "any"

    can be used to get past errors, it disables type checking.
  • 4
    Nodejs and typescript are more complicated than Rails.
    The first question is, do you need them? More often than not, you do not.
    You can use Vue like a library, similar to old jquery or angular 1.
    If you do not need to put up with nodejs and typescript, by all means avoid them.
  • 4
    Typescript is a dog. Nothing wrong with the idea of extending JS to make it strongly typed, but TS doesn't quite get there, and either something's strongly typed or it's not.

    Like a water bottle either leaks or it doesn't.

    Typescript is a leaky water bottle that's been wrapped in duct tape and it still leaks, so now it's a leaky bottle wrapped in soggy duct tape.
  • 3
    @ars1 No, we don't need Typescript for this simple app with forms for storing business data. Most projects for small scale websites don't need it. Our frontend guy has full authority over what stack we use on the frontend unfortunately and he uses these frameworks because it's trendy. It's cost our customer hundreds of thousands of dollars, our consulting firm more than we're getting paid to make this, and the app doesn't meet the level of functionality the customer wants because development time takes so long. I'm probably going to get laid off thanks to Typescript.
  • 2
    @bazmd 😆I'd love to use 'any` everywhere that but I'd get yelled at by management.

    I understand how types can be useful, but goddamn TS goes nuts with it. Most of the error messages I read I'm like wtf is it talking about?! Another thing I hate about Vue is it's confusing when variable should be wrapped in a Ref, which is what trips me up a lot with the Typescript. In the case I cited, it doesn't like what I put in the Ref and I couldn't figure out how to declare it so it would be happy with either a string or null.
  • 3
    @retoor Thanks for reassuring it isn't just me. Most TS fans like our frontend dev tell me that I just am not as familiar with it. While that's true, even with familiarity I see it creating so much overhead that it gets in the way of getting code shipped. Who cares if it prevents an occasional bug caused by a type mismatch? It's frontend so it will get spotted quickly anyway! It feels gaslighty when the Typescript cult keeps telling me this is the way. I hate it! You can do so much with VanillaJS, and it's faster!

    Maybe it's called Typescript because you spend all your time doing purposeless typing on your keyboard instead of getting work done!
  • 2
    @greendev I did typescript a short while and the thing is, it's quite fun and it makes you feel like a ninja. But what problem does it solve ffs? It only adds. The best thing you could do is to learn it very well and accept it I guess
  • 0
    @greendev if it helps It's not types it's contracts, that's why type A with the same properties as type B are interchangeable. Then again, I've never been insane enough to do explicit typing for everything in Vue, also haven't used it in years 😅 (type inference is generally pretty good, and I can see the inferred type in intelij)

    While any might get you chewed out, try unknown, or look at some of the meta types like Parameters<typeof annoyingFunction>[0] or using generics?

    Hope that helps
Add Comment